Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UserBlockService to Bootstrap build class map #556

Merged

Conversation

AndreScara11
Copy link
Contributor

Added UserBlockService in the build class map to be able to overwrite it

@AndreScara11
Copy link
Contributor Author

AndreScara11 commented Jul 16, 2024

It seems that many other classes are missing in the class map, maybe it's worth opening an issue?

@TonisOrmisson
Copy link
Contributor

Why not use the DI contauiner instead of classMap? Should also be probably workable for the "other" classes.
UserBlockService is injected as a dependency in Yii's internal container and created only via ->make(), getting the dependency from container. So you can just set your own custom class to DI container after loading this module and you should be good to go with nothing added to classMap

@mp1509
Copy link

mp1509 commented Jul 16, 2024

IMHO, since usuario uses this classMap to register class definitions, it would be better to have it so you can list every override there instead of having some in another place. Also, I don't know if it'd ever be useful, but the class mapping would also be missing from the ClassMapHelper singleton.

@maxxer
Copy link
Collaborator

maxxer commented Aug 1, 2024

I remember I used DI in the past for classes overload. @mp1509 if you feel some classes are missing here, please add them to the PR so we have a consistent behaviour.

@AndreScara11
Copy link
Contributor Author

I added more classes to the classMap, not all, only those of the folders already present

@maxxer maxxer merged commit 300b4d9 into 2amigos:master Sep 18, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants