-
Notifications
You must be signed in to change notification settings - Fork 132
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
create reflection parameter from closure #256
create reflection parameter from closure #256
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.
Looks like a useful change, just couple of minor fixes please! 👍
* @param string $parameterName | ||
* @return ReflectionParameter | ||
*/ | ||
public static function createFormClosure(\Closure $closure, $parameterName) |
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.
- typo in method name
createFromClosure
- also please add type declarations (
string $parameterName
and: ReflectionParameter
) (I'm working on adding type declarations everywhere else as we're min PHP 7 for next release now)
{ | ||
$parameterInfo = ReflectionParameter::createFormClosure(function ($a) {}, 'a'); | ||
|
||
$this->assertInstanceOf(ReflectionParameter::class, $parameterInfo); |
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.
please use self::assertInstanceOf
$parameterInfo = ReflectionParameter::createFormClosure(function ($a) {}, 'a'); | ||
|
||
$this->assertInstanceOf(ReflectionParameter::class, $parameterInfo); | ||
$this->assertSame('a', $parameterInfo->getName()); |
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.
please use self::assertSame
fixed the minor changes |
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.
Nice - thanks for the patch 😄
solves #255