Skip to content

Assign severity to each sniff #37

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 6 commits into from
Feb 28, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Magento/Sniffs/Legacy/MageEntitySniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
*/
class MageEntitySniff implements Sniff
{
/**
* String representation of error.
*
* @var string
*/
/**
* String representation of error.
*
* @var string
*/
protected $errorMessage = 'Possible Magento 2 design violation. Detected typical Magento 1.x construction "%s".';

/**
Expand Down
2 changes: 1 addition & 1 deletion Magento/Sniffs/PHP/DiscouragedFunctionSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff
*
* @return void
*/
protected function addError($phpcsFile, $stackPtr, $function, $pattern = null)
protected function addError($phpcsFile, $stackPtr, $function, $pattern=null)

Choose a reason for hiding this comment

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

Where such spaces removal around = comes from?

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're right. I missed that part of PSR2 standard. Will fix.

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 fixed some rules to be compatible with PSR2.
Anyway, severities are all about Marketplace checks so you don't have to worry about Magento core. For core all findings will lead to build failure.

Choose a reason for hiding this comment

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

@lenaorobei I wouldn't worry about Magento core is there was a separate Marketplace coding standard based on core one. What is the reason to mix such totally different concerns?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@orlangur why do you think so? Extension developers should follow the same rules as core developers.

{
$data = [$function];
$warningMessage = 'The use of function %s() is discouraged';
Expand Down
10 changes: 5 additions & 5 deletions Magento/Sniffs/Security/IncludeFileSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
*/
class IncludeFileSniff implements Sniff
{
/**
* Warning violation code.
*
* @var string
*/
/**
* Warning violation code.
*
* @var string
*/
protected $warningCode = 'FoundIncludeFile';

/**
Expand Down
2 changes: 1 addition & 1 deletion Magento/Sniffs/Security/XssTemplateSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ private function findNextInScope($types, $start, $end)
* @param int|bool $last
* @return int|bool
*/
private function findLastInScope($types, $start, $end, $last = false)
private function findLastInScope($types, $start, $end, $last=false)
{
$types = (array)$types;
$nextInScope = $this->findNextInScope($types, $start, $end);
Expand Down
Loading