-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PropertyAccess][DX] Enhance exception that say that some methods are missing if they don't #18732
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
Conversation
@nykopol Can you please also add a test to prevent future regressions? |
@xabbuh I added the test. |
'"%s" given.', | ||
$property, | ||
$reflClass->name, | ||
implode(' and ', array_map(function($method){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is offending PSR-2 - 6.Closures.
@@ -714,6 +714,19 @@ private function getWriteAccessInfo($class, $property, $value) | |||
// we call the getter and hope the __call do the job | |||
$access[self::ACCESS_TYPE] = self::ACCESS_TYPE_MAGIC; | |||
$access[self::ACCESS_NAME] = $setter; | |||
} elseif (null !== $this->findAdderAndRemover($reflClass, $singulars)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null !== $methods = ...
Thank you @nykopol. |
…methods are missing if they don't (nykopol) This PR was squashed before being merged into the 2.7 branch (closes #18732). Discussion ---------- [PropertyAccess][DX] Enhance exception that say that some methods are missing if they don't | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #18694 | License | MIT | Doc PR | When you try do define a manyToMany association but you don't give an array or \Traversable, the raised exception say that some methods are missing while they don't. This PR check if the adder and setter methods exists and if so, give a exception that pointing on the real problem. Commits ------- c46519b [PropertyAccess][DX] Enhance exception that say that some methods are missing if they don't
When you try do define a manyToMany association but you don't give an array or \Traversable, the raised exception say that some methods are missing while they don't. This PR check if the adder and setter methods exists and if so, give a exception that pointing on the real problem.