Skip to content
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
12 changes: 0 additions & 12 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,12 @@ parameters:
count: 3
path: src/BrandEmbassyCodingStandard/Sniffs/Classes/TraitUseSpacingSniffTest.php

-
message: '#^Parameter \#2 \$subject of function preg_match expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: src/BrandEmbassyCodingStandard/Sniffs/Commenting/CreateMockFunctionReturnTypeOrderSniff.php

-
message: '#^Parameter \#4 \$startPointer of static method SlevomatCodingStandard\\Helpers\\TokenHelper\:\:findNextContent\(\) expects int, mixed given\.$#'
identifier: argument.type
count: 1
path: src/BrandEmbassyCodingStandard/Sniffs/Commenting/CreateMockFunctionReturnTypeOrderSniff.php

-
message: '#^Parameter \#1 \$string of function strtolower expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: src/BrandEmbassyCodingStandard/Sniffs/ForbiddenElseStatementSniff.php

-
message: '#^Binary operation "\-" between mixed and 1 results in an error\.$#'
identifier: binaryOp.invalid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\Sniff;
use SlevomatCodingStandard\Helpers\TokenHelper;
use function assert;
use function is_string;
use function preg_match;
use const T_FUNCTION;

Expand Down Expand Up @@ -80,6 +82,7 @@ public function process(File $phpcsFile, $stackPtr): void
}

$returnType = $tokens[$returnTypePtr]['content'];
assert(is_string($returnType));

if (preg_match('~^MockInterface&(\w+)$~', $returnType, $matches) !== 1) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\Sniff;
use function assert;
use function is_string;
use function strtolower;
use const T_ELSE;
use const T_ELSEIF;
Expand Down Expand Up @@ -37,7 +39,9 @@ public function process(File $phpcsFile, $stackPtr): void
{
$tokens = $phpcsFile->getTokens();

$statement = strtolower($tokens[$stackPtr]['content']);
$content = $tokens[$stackPtr]['content'];
assert(is_string($content));
$statement = strtolower($content);

$error = 'Use of ' . $statement . ' is forbidden. See: https://github.com/BrandEmbassy/developers-manifest/issues/365.';

Expand Down
Loading