-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Nette DI: suspicious dumping of objects when generating the container #306
Comments
It looks like the But I understand why you use it that way, let's try to find a solution. The solution I can think of is that |
I am confused what does it have to do with DI compiler. Isn't config schema used just to access config values of the extension? They are not passed to generated DIC For objects that are passed to generated DIC, I am using explicit serialization, which is fine as long as changing the object forces DIC to regenerate (can be done by adding object to compiler dependencies) https://github.com/orisai/localization/blob/ae99720c58b10408b099e68c9692f75a45c4b627/src/Bridge/NetteDI/LocalizationExtension.php#L131-L136 |
I think having some better decision making when triggering error would be fine? Plus some changes in If I have simple class like this class Data {
public string $url;
public string $query;
} I would say it is really close to |
I don't know how to dump this object: class Data {
public string $url;
public string $query;
} but I can dump this one: class Data {
function __construct(
public string $url,
public string $query,
) {}
} |
Tried it with 6b9910cece1e074ad1d1babc6a62c48dfa9ea870 and it works now - thanks. 👍 However, would it be better if I changed those DTOs to classes with private properties and a constructor? |
@Gappa I'm not sure yet, I'll let you know |
Version: 3.2.0
Bug Description
Steps To Reproduce
Expected Behavior
No error message is shown or a message that is better at explaining what is suspicious about the object/class and how to fix it.
Possible Solution
N/A
I'm not really sure what to do about this or what actually is the problem - I'm using objects like this:
Edit - relevant commit:
The text was updated successfully, but these errors were encountered: