Skip to content

Commit

Permalink
Universal/DisallowInlineTabs: increase type safety
Browse files Browse the repository at this point in the history
... by casting to `int` for a property which expects `int`.
  • Loading branch information
jrfnl committed Aug 26, 2023
1 parent 8ffd4d8 commit 0444986
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ public function register()
public function process(File $phpcsFile, $stackPtr)
{
if (isset($this->tabWidth) === false) {
$this->tabWidth = Helper::getTabWidth($phpcsFile);
$this->tabWidth = (int) Helper::getTabWidth($phpcsFile);
}

if (\defined('PHP_CODESNIFFER_IN_TESTS')) {
$this->tabWidth = Helper::getCommandLineData($phpcsFile, 'tabWidth');
$this->tabWidth = (int) Helper::getCommandLineData($phpcsFile, 'tabWidth');
}

$tokens = $phpcsFile->getTokens();
Expand Down

0 comments on commit 0444986

Please sign in to comment.