Conversation
|
Issued by Coverage Checker: |
arnaud-23
reviewed
Mar 25, 2024
| public function generate(\ReflectionClass $originalClass, ClassGenerator $classGenerator, array $proxyOptions = []) | ||
| { | ||
| if (!\array_key_exists('methods', $proxyOptions)) { | ||
| throw new \InvalidArgumentException(sprintf('Generator %s needs a methods proxyOptions', __CLASS__)); |
Contributor
There was a problem hiding this comment.
Suggested change
| throw new \InvalidArgumentException(sprintf('Generator %s needs a methods proxyOptions', __CLASS__)); | |
| throw new \InvalidArgumentException(sprintf('Generator %s needs a property "methods" in proxyOptions', __CLASS__)); |
also I'm not sure what you meant with this errors, that the array proxyOptions must have a key 'methods' in it or if the key 'methods' doesn't exist in the array, the Generator class that extends this one must have a method "getProxyOptions()" or something similare ?
Contributor
Author
There was a problem hiding this comment.
proxyOptions must have a "methods" key
kletord
commented
Mar 29, 2024
| $factoryDefinition->setTags($definition->getTags()); | ||
|
|
||
| if ($definition->getFactory() !== null) { | ||
| $this->compiler->log($this, "Service {$taggedServiceName} is not compatible with service proxy"); |
kletord
commented
Mar 29, 2024
| { | ||
| foreach ($this->proxies as $proxy) { | ||
| if ($proxy instanceof LazyLoadingInterface && !$proxy->isProxyInitialized()) { | ||
| $proxy->initializeProxy(); |
Contributor
Author
There was a problem hiding this comment.
What is LazyLoadingInterface doesn't exist
kletord
commented
Mar 29, 2024
kletord
commented
Mar 29, 2024
kletord
commented
Mar 29, 2024
sidux
reviewed
Apr 2, 2024
| { | ||
| $instanceRef = new \ReflectionObject($object); | ||
| $methods = $instanceRef->getMethods(\ReflectionMethod::IS_PUBLIC); | ||
| $instanceRef = new \ReflectionClass($class); |
Contributor
There was a problem hiding this comment.
although scanning all methods of a class permits us to throw errors on decorated private methods, the cost of loading annotation for each method maybe high in dev env
sidux
approved these changes
Apr 2, 2024
a1e73ed to
48b6ea4
Compare
sidux
approved these changes
Jun 21, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Time to open this PR.
Main change: remove the value holder proxy to create an extended class with the interceptor.
This fix some bug and limitation and add another bunch of limitation.
Removed limitations:
New limitations:
Also this PR add a few errors when an impossible operation is asked and add a cache warmer to generate proxies.
I kept the term proxy but is not a proxy anymore ;-)