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
2 changes: 1 addition & 1 deletion src/Ruleset.php
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ public function processRuleset($rulesetPath, $depth=0)
$autoloadPath = (string) $autoload;

// Try relative autoload paths first.
$relativePath = Common::realPath(dirname($rulesetPath).DIRECTORY_SEPARATOR.$autoloadPath);
$relativePath = Common::realpath(dirname($rulesetPath).DIRECTORY_SEPARATOR.$autoloadPath);

if ($relativePath !== false && is_file($relativePath) === true) {
$autoloadPath = $relativePath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function process(File $phpcsFile, $stackPtr)
for ($i = $openingBrace; $i > $prev; $i--) {
if ($tokens[$i]['line'] === $tokens[$openingBrace]['line']) {
if ($tokens[$i]['column'] === 1) {
$phpcsFile->fixer->addNewLineBefore($i);
$phpcsFile->fixer->addNewlineBefore($i);
}

continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public function process(File $phpcsFile, $stackPtr)

if ($tokens[$parenOpener]['line'] === $tokens[$parenCloser]['line']) {
// Conditions are all on the same line, so follow PSR2.
return $this->psr2ControlStructureSpacing->process($phpcsFile, $stackPtr);
$this->psr2ControlStructureSpacing->process($phpcsFile, $stackPtr);
return;
}

$next = $phpcsFile->findNext(T_WHITESPACE, ($parenOpener + 1), $parenCloser, true);
Expand Down
2 changes: 1 addition & 1 deletion src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public function process(File $phpcsFile, $stackPtr)
$phpcsFile->fixer->replaceToken($i, '');
}

$phpcsFile->fixer->addNewLineBefore($token);
$phpcsFile->fixer->addNewlineBefore($token);

$phpcsFile->fixer->endChangeset();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function process(File $phpcsFile, $stackPtr)
$error = 'Terminating statement must be on a line by itself';
$fix = $phpcsFile->addFixableError($error, $nextCloser, 'BreakNotNewLine');
if ($fix === true) {
$phpcsFile->fixer->addNewLine($prev);
$phpcsFile->fixer->addNewline($prev);
$phpcsFile->fixer->replaceToken($nextCloser, trim($tokens[$nextCloser]['content']));
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/Util/Standards.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static function getInstalledStandardPaths()
$resolvedInstalledPaths = [];
foreach ($installedPaths as $installedPath) {
if (substr($installedPath, 0, 1) === '.') {
$installedPath = Common::realPath(__DIR__.$ds.'..'.$ds.'..'.$ds.$installedPath);
$installedPath = Common::realpath(__DIR__.$ds.'..'.$ds.'..'.$ds.$installedPath);
if ($installedPath === false) {
continue;
}
Expand Down Expand Up @@ -239,7 +239,7 @@ public static function isInstalledStandard($standard)
} else {
// This could be a custom standard, installed outside our
// standards directory.
$standard = Common::realPath($standard);
$standard = Common::realpath($standard);
if ($standard === false) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Core/File/GetConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ protected function setUpCaches()
*/
public function testNonExistentToken()
{
$result = self::$phpcsFile->getCondition(100000, Tokens::$ooScopeTokens);
$result = self::$phpcsFile->getCondition(100000, T_CLASS);
$this->assertFalse($result);

$result = self::$phpcsFile->hasCondition(100000, T_IF);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class RecurseScopeMapWithNamespaceOperatorTest extends AbstractTokenizerTe
*
* @return void
*/
public function testScopeSetting($testMarker, $tokenTypes, $open=T_OPEN_CURLY_BRACKET, $close=T_CLOSE_CURLY_BRACKET)
public function testScopeSetting($testMarker, $tokenTypes, $open=[T_OPEN_CURLY_BRACKET], $close=[T_CLOSE_CURLY_BRACKET])
{
$tokens = $this->phpcsFile->getTokens();

Expand Down