Skip to content
This repository was archived by the owner on Feb 16, 2019. It is now read-only.

Conversation

@shulard
Copy link
Contributor

@shulard shulard commented Jan 20, 2016

A PhpParser\Node\Name\FullyQualified parsed parameter type is not handle like it must be. The resolveAlias method check for the \\ prefix which is missing here so we got a wrong alias.

Now, the parameter parsed type is checked to add the prefix when necessary.

Work on #194

Copy link
Contributor

Choose a reason for hiding this comment

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

So the $param->type is sometimes a string with string or other scalar type and sometimes it's a FullyQualified class instance if this is class or interface (I wonder how PhpParser distinguishes between two class/interface or a scalar type).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right !

When the parameter is typed as array, the $param->type property is a string. I've checked with PHP7 and with the types string or float for the moment there is a problem (it return a FullyQualified to A\B\string. Maybe another PR for that 😄.

Copy link
Member

Choose a reason for hiding this comment

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

Can you remove the spaces after '(' and before ')' and add a space after if?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove the spaces after '(' and before ')' and add a space after if?

Usually fabpot.io detects any CS issues and offers quick fix for them. Maybe it's broken.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated !

@shulard shulard force-pushed the features/issue-194 branch 2 times, most recently from 5c894b2 to 3644eec Compare January 21, 2016 14:52
Copy link
Member

Choose a reason for hiding this comment

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

should be removed :)

@shulard shulard force-pushed the features/issue-194 branch from 3644eec to 78c2870 Compare January 21, 2016 15:34
Copy link
Member

Choose a reason for hiding this comment

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

one more!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

... updated

A `PhpParser\Node\Name\FullyQualified` parsed parameter type is not handle like it must be. The `resolveAlias` method check for the `\\` prefix which is missing here so we got a wrong alias.

Now, the parameter parsed type is checked to add the prefix when necessary.

Work on #194
@shulard shulard force-pushed the features/issue-194 branch from 78c2870 to fa383f7 Compare January 21, 2016 15:37
@fabpot
Copy link
Member

fabpot commented Jan 22, 2016

Thank you @shulard.

@fabpot fabpot merged commit fa383f7 into FriendsOfPHP:master Jan 22, 2016
fabpot added a commit that referenced this pull request Jan 22, 2016
This PR was merged into the 3.1-dev branch.

Discussion
----------

Handle FQCN parsed parameter as it

A `PhpParser\Node\Name\FullyQualified` parsed parameter type is not handle like it must be. The `resolveAlias` method check for the `\\` prefix which is missing here so we got a wrong alias.

Now, the parameter parsed type is checked to add the prefix when necessary.

Work on #194

Commits
-------

fa383f7 Handle FQCN parsed parameter as it
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants