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

declare(strict_types=1) causes static code check failure #72

Closed
lenaorobei opened this issue Mar 26, 2018 · 3 comments
Closed

declare(strict_types=1) causes static code check failure #72

lenaorobei opened this issue Mar 26, 2018 · 3 comments

Comments

@lenaorobei
Copy link
Contributor

lenaorobei commented Mar 26, 2018

The old version of PHP Codesniffer, as well as old sniffs, are used for a static code check.

As a result, when adding declare(strict_types=1); causes sniffer to throw a warning on the PSR-2 standard.
screen shot 2018-03-26 at 3 15 18 pm

As a workaround in #69 I had to add @codingStandardsIgnoreFile annotation. The old version of PHP Codesniffer has made also impossible to use @codingStandardsIgnoreStart and @codingStandardsIgnoreEnd at the beginning of the file.

Suggest updating "squizlabs/php_codesniffer": "1.5.3" to "squizlabs/php_codesniffer": "3.0.1" and use updated sniffs for Magento 2.

@lenaorobei
Copy link
Contributor Author

In addition, return type : array leads to Short array syntax must be used; expected "[]" but found "array()" error.

@okolesnyk
Copy link
Member

Hi @lenaorobei. Thank you for the report. We created internal ticket MQE-900 to track the progress. We will update you here about progress on this issue.

@KevinBKozan
Copy link
Contributor

Issue fixed in #154, thank you for reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants