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 all 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
12 changes: 6 additions & 6 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 Expand Up @@ -93,7 +93,7 @@ public function process(File $phpcsFile, $stackPtr)
if ($hasVariable) {
$message .= ' Variables inside are insecure.';
}
$phpcsFile->addWarning(
$phpcsFile->addError(
$message,
$stackPtr,
$this->warningCode,
Expand Down
17 changes: 9 additions & 8 deletions Magento/Tests/Security/IncludeFileUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright © Magento. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Tests\Security;

use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
Expand All @@ -16,14 +17,6 @@ class IncludeFileUnitTest extends AbstractSniffUnitTest
* @inheritdoc
*/
public function getErrorList()
{
return [];
}

/**
* @inheritdoc
*/
public function getWarningList()
{
return [
3 => 1,
Expand All @@ -42,4 +35,12 @@ public function getWarningList()
34 => 1,
];
}

/**
* @inheritdoc
*/
public function getWarningList()
{
return [];
}
}
Loading