phpcsFile->getTokens();
$target = $this->getTargetToken($testMarker, [T_NULLABLE, T_INLINE_THEN]);
$tokenArray = $tokens[$target];
$this->assertSame(T_NULLABLE, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_NULLABLE (code)');
$this->assertSame('T_NULLABLE', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_NULLABLE (type)');
}//end testNullable()
/**
* Data provider.
*
* @see testNullable()
*
* @return array>
*/
public static function dataNullable()
{
return [
'property declaration, readonly, no visibility' => ['/* testNullableReadonlyOnly */'],
'property declaration, private set' => ['/* testNullablePrivateSet */'],
'property declaration, public and protected set' => ['/* testNullablePublicProtectedSet */'],
'property declaration, final, no visibility' => ['/* testNullableFinalOnly */'],
'property declaration, abstract, no visibility' => ['/* testNullableAbstractOnly */'],
];
}//end dataNullable()
/**
* Test that a "?" when used as part of a ternary expression is tokenized as `T_INLINE_THEN`.
*
* @param string $testMarker The comment which prefaces the target token in the test file.
*
* @dataProvider dataInlineThen
*
* @return void
*/
public function testInlineThen($testMarker)
{
$tokens = $this->phpcsFile->getTokens();
$target = $this->getTargetToken($testMarker, [T_NULLABLE, T_INLINE_THEN]);
$tokenArray = $tokens[$target];
$this->assertSame(T_INLINE_THEN, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_INLINE_THEN (code)');
$this->assertSame('T_INLINE_THEN', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_INLINE_THEN (type)');
}//end testInlineThen()
/**
* Data provider.
*
* @see testInlineThen()
*
* @return array>
*/
public static function dataInlineThen()
{
return [
'ternary in property default value' => ['/* testInlineThenInPropertyDefaultValue */'],
];
}//end dataInlineThen()
}//end class