-
Notifications
You must be signed in to change notification settings - Fork 13
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
IBX-4000: Changed the method name creation for logCall in callable function #410
Conversation
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.
@mateuszdebinski could you please describe what was the issue here, so everyone can understand what was changed and why?
Also, what could be done so such easy to miss mistake won't happen in any future implementations?
@alongosz The problem is that the |
This is something which should land in the PR description ;-) That doesn't answer however section question - what can be done to ensure all implementations reference a correct method? |
@@ -219,7 +219,10 @@ final public function testLoadMethodsCacheMiss( | |||
$cacheItem = $this->getCacheItem($key, null); | |||
$handlerMethodName = $this->getHandlerMethodName(); | |||
|
|||
$this->loggerMock->expects($this->once())->method('logCall'); | |||
$handler = $this->persistenceCacheHandler->$handlerMethodName(); |
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.
Why is the handler acquisition moved?
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.
We currently use this variable in the test
->with(get_class($handler) . '::' . $method, self::isType('array'));
Quality Gate passedIssues Measures |
Related PRs:
Description:
The problem is that the Ibexa\Bundle\Debug\Collector\PersistenceCacheCollector::getCalls function expects us to format the method as Namespace::Function. With callable functions, METHOD returns Namespace{closure} instead of the correct value. To prevent this, we must use CLASS in these functions and add the method name manually, which will allow us to correctly save the call function to log.
For QA:
Documentation: