Skip to content

Warn if property does not exist and add it to DiContainerTrait#329

Merged
mvorisek merged 7 commits intodevelopfrom
warn_if_property_does_not_exist
Oct 4, 2021
Merged

Warn if property does not exist and add it to DiContainerTrait#329
mvorisek merged 7 commits intodevelopfrom
warn_if_property_does_not_exist

Conversation

@mvorisek
Copy link
Copy Markdown
Member

@mvorisek mvorisek commented Oct 3, 2021

This highly improves code quality as something like:

$m->noLongerSupportedProperty = 'x';

or

$m->eckbox= 'x'; // notice the typo

will warn if the new trait is added. To add it to the most of the code, we add it to DiContainerTrait by default.

The deprecation warnings can be supressed by a custom error handler or by overriding the warnIfPropertyDoesNotExist method.

Copy link
Copy Markdown
Collaborator

@abbadon1334 abbadon1334 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mvorisek mvorisek merged commit 6cd61da into develop Oct 4, 2021
@mvorisek mvorisek deleted the warn_if_property_does_not_exist branch October 4, 2021 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants