Skip to content

Commit

Permalink
ci: Fix strict types sniff
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasnorre committed Nov 12, 2024
1 parent 1df6486 commit 2bcb394
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<property name="spacesCountAroundEqualsSign" value="0" />
</properties>
</rule>
<rule ref="src/Sniffs/ExplainStrictTypesSniff.php">
<rule ref="src/Sniffs/StrictTypes/ExplainStrictTypesSniff.php">
<exclude-pattern>*/*Test\.php</exclude-pattern>
<exclude-pattern>*/.meta/*\.php</exclude-pattern>
<exclude-pattern>src/*</exclude-pattern>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Exercism\Sniffs;
namespace Exercism\Sniffs\StrictTypes;

use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Fixer;
Expand Down Expand Up @@ -48,13 +48,13 @@ public function register(): array
];
}

public function process(File $file, $stackPtr)
public function process(File $phpcsFile, $stackPtr): void
{
$this->fixer = $file->fixer;
$this->fixer = $phpcsFile->fixer;
$this->position = $stackPtr;

if (!$file->findPrevious($this->tokens, $stackPtr)) {
$file->addFixableError(
if (!$phpcsFile->findPrevious($this->tokens, $stackPtr)) {
$phpcsFile->addFixableError(
'Missing explanation of declaration of strict types.',
$stackPtr - 1,
self::class
Expand Down

0 comments on commit 2bcb394

Please sign in to comment.