Skip to content
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

PHP 5.6: Add new sniff to detect importing const and function via a use statement #401

Merged

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Apr 12, 2017

The use operator has been extended to support importing functions and constants in addition to classes. This is achieved via the use function and use const constructs, respectively.

Refs:

Includes unit tests.

Not covered, multiple statements separated by comma's:

.. as I'm not sure if it is a valid syntax in the first place:

use const Baz, function Foo\Bar as bar;

@jrfnl jrfnl force-pushed the php5.6/use-import-const-function branch from 4e0fe69 to 316a58e Compare April 12, 2017 15:00
…se statement.

> The use operator has been extended to support importing functions and constants in addition to classes. This is achieved via the use function and use const constructs, respectively.

Refs:
* http://php.net/manual/en/migration56.new-features.php#migration56.new-features.use
* https://wiki.php.net/rfc/use_function

Includes unit tests.
@coveralls
Copy link

coveralls commented Apr 12, 2017

Coverage Status

Coverage decreased (-0.005%) to 95.892% when pulling 4e0fe69 on jrfnl:php5.6/use-import-const-function into aabac47 on wimg:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.007%) to 95.89% when pulling 316a58e on jrfnl:php5.6/use-import-const-function into aabac47 on wimg:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.007%) to 95.89% when pulling 316a58e on jrfnl:php5.6/use-import-const-function into aabac47 on wimg:master.

@coveralls
Copy link

coveralls commented Apr 12, 2017

Coverage Status

Coverage decreased (-0.007%) to 95.89% when pulling 316a58e on jrfnl:php5.6/use-import-const-function into aabac47 on wimg:master.

@wimg wimg merged commit 00f0e22 into PHPCompatibility:master Apr 26, 2017
@jrfnl jrfnl deleted the php5.6/use-import-const-function branch April 26, 2017 15:19
@jrfnl jrfnl added this to the 7.1.4 milestone May 3, 2017
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.

None yet

3 participants