8000 [Config] Add more type-hints as follow-up of #32201 by jschaedl · Pull Request #32287 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Config] Add more type-hints as follow-up of #32201 #32287

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

Closed

Conversation

jschaedl
Copy link
Contributor
Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #32179
License MIT
Doc PR N/A

As @Tobion pointed out I missed some type hints in #32201
This PR should fix this.

@jschaedl jschaedl force-pushed the improvement/config-type-hints_2 branch from 5b69087 to 467b59e Compare June 29, 2019 19:35
{
if (!\is_callable($callback)) {
throw new \InvalidArgumentException(sprintf('Invalid type for callback argument. Expected callable, but got "%s".', \gettype($callback)));
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

With the callable type-hint we will get a TypeError now. So no need to check the argument anymore.

* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Invalid type for callback argument. Expected callable, but got "object".
*/
public function testCacheWithInvalidCallback()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test didn't make sense anymore, thanks to the callable type-hint of the callback argument.

@derrabus
Copy link
Member

Now we have two competing PRs. 😕

/cc @Tobion #32286

@Tobion
Copy link
Contributor
Tobion commented Jun 29, 2019

Closing in favor of #32286 as there is much more missing. But thanks for following up so far.

@Tobion Tobion closed this Jun 29, 2019
@jschaedl jschaedl deleted the improvement/config-type-hints_2 branch February 23, 2020 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0