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
8 changes: 4 additions & 4 deletions tests/Core/Tokenizers/PHP/NullsafeObjectOperatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class NullsafeObjectOperatorTest extends AbstractTokenizerTestCase
*
* @var array<int|string>
*/
protected $find = [
private const TARGET_TOKENS = [
T_NULLSAFE_OBJECT_OPERATOR,
T_OBJECT_OPERATOR,
T_INLINE_THEN,
Expand All @@ -38,7 +38,7 @@ public function testObjectOperator()
{
$tokens = $this->phpcsFile->getTokens();

$operator = $this->getTargetToken('/* testObjectOperator */', $this->find);
$operator = $this->getTargetToken('/* testObjectOperator */', self::TARGET_TOKENS);
$this->assertSame(T_OBJECT_OPERATOR, $tokens[$operator]['code'], 'Failed asserting code is object operator');
$this->assertSame('T_OBJECT_OPERATOR', $tokens[$operator]['type'], 'Failed asserting type is object operator');

Expand All @@ -59,7 +59,7 @@ public function testNullsafeObjectOperator($testMarker)
{
$tokens = $this->phpcsFile->getTokens();

$operator = $this->getTargetToken($testMarker, $this->find);
$operator = $this->getTargetToken($testMarker, self::TARGET_TOKENS);
$this->assertSame(T_NULLSAFE_OBJECT_OPERATOR, $tokens[$operator]['code'], 'Failed asserting code is nullsafe object operator');
$this->assertSame('T_NULLSAFE_OBJECT_OPERATOR', $tokens[$operator]['type'], 'Failed asserting type is nullsafe object operator');

Expand Down Expand Up @@ -99,7 +99,7 @@ public function testTernaryThen($testMarker, $testObjectOperator=false)
{
$tokens = $this->phpcsFile->getTokens();

$operator = $this->getTargetToken($testMarker, $this->find);
$operator = $this->getTargetToken($testMarker, self::TARGET_TOKENS);
$this->assertSame(T_INLINE_THEN, $tokens[$operator]['code'], 'Failed asserting code is inline then');
$this->assertSame('T_INLINE_THEN', $tokens[$operator]['type'], 'Failed asserting type is inline then');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class RecurseScopeMapDefaultKeywordConditionsTest extends AbstractTokenize
*
* @var array<int>
*/
protected $conditionStopTokens = [
private const CONDITION_STOP_TOKENS = [
T_BREAK,
T_CONTINUE,
T_EXIT,
Expand Down Expand Up @@ -272,7 +272,7 @@ public function testSwitchDefault($testMarker, $openerMarker, $closerMarker, $co
if (($opener + 1) !== $closer) {
$end = $closer;
if (isset($conditionStopMarker) === true) {
$end = ( $this->getTargetToken($conditionStopMarker, $this->conditionStopTokens) + 1);
$end = ( $this->getTargetToken($conditionStopMarker, self::CONDITION_STOP_TOKENS) + 1);
}

for ($i = ($opener + 1); $i < $end; $i++) {
Expand Down
Loading