Skip to content

[ExpressionLanguage] Fixed PhpDoc type-hints on Token value #24884

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

Merged
merged 1 commit into from
Nov 12, 2017

Conversation

mcg-web
Copy link
Contributor

@mcg-web mcg-web commented Nov 9, 2017

Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets none
License MIT
Doc PR none

Fixed PhpDoc type-hints on Token value and added test to prevent BC with Parser when treating numbers (example a === 123 compile as $a === "123")

Copy link
Contributor

@Tobion Tobion left a comment

Choose a reason for hiding this comment

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

The phpdoc is not accurate then. And please add a test

@mcg-web
Copy link
Contributor Author

mcg-web commented Nov 10, 2017

Thanks for review, I changed the phpdoc and added a test to cover this.

* @param string $value The token value
* @param int $cursor The cursor position in the source
* @param string $type The type of the token (self::*_TYPE)
* @param string|int|float $value The token value
Copy link
Member

Choose a reason for hiding this comment

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

|null as the previous typehint was nullable too

Copy link
Member

Choose a reason for hiding this comment

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

scalar|null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added null because scalar seems to not be recognize and I could not find it in php doc @nicolas-grekas

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

(could be merged on a lower branch I guess)

@mcg-web
Copy link
Contributor Author

mcg-web commented Nov 10, 2017

PhpDoc and tests can effectively be merged in lower branch version. But removing the typeHint is a 4.0 issue... Should I open an other PR on a lower branch? @nicolas-grekas

@nicolas-grekas
Copy link
Member

Removing the type will come naturally when merging up to master I think.

Also added tests to cover number parser BC
@mcg-web mcg-web changed the base branch from master to 2.7 November 11, 2017 07:12
@mcg-web
Copy link
Contributor Author

mcg-web commented Nov 11, 2017

I moved it to lower active branch 2.7.

@mcg-web mcg-web changed the title [ExpressionLanguage] Remove type-hints on Token [ExpressionLanguage] Fixed PhpDoc type-hints on Token value Nov 11, 2017
@nicolas-grekas nicolas-grekas added this to the 2.7 milestone Nov 11, 2017
@fabpot
Copy link
Member

fabpot commented Nov 12, 2017

Thank you @mcg-web.

@fabpot fabpot merged commit 18f0fc5 into symfony:2.7 Nov 12, 2017
fabpot added a commit that referenced this pull request Nov 12, 2017
…lue (mcg-web)

This PR was merged into the 2.7 branch.

Discussion
----------

[ExpressionLanguage] Fixed PhpDoc type-hints on Token value

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | none

Fixed PhpDoc type-hints on Token value and added test to prevent BC with Parser when treating numbers (example `a === 123` compile as `$a === "123"`)

Commits
-------

18f0fc5 [ExpressionLanguage] Fix PhpDoc type-hints on Token value
@mcg-web mcg-web deleted the patch-1 branch November 12, 2017 16:39
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.

6 participants