src/ZenifyCodingStandard/Sniffs/Namespaces/UseDeclarationSniff.php
private function shouldIgnoreUse(PHP_CodeSniffer_File $file, $position) : bool
	{
		$tokens = $file->getTokens();

		// Ignore USE keywords inside closures.
		$next = $file->findNext(T_WHITESPACE, ($position + 1), NULL, TRUE);
		if ($tokens[$next]['code'] === T_OPEN_PARENTHESIS) {
			return TRUE;
		}

		// Ignore USE keywords for traits.
		if ($file->hasCondition($position, [T_CLASS, T_TRAIT]) === TRUE) {
			return TRUE;
		}

		return FALSE;
	}
private function shouldIgnoreUse(PHP_CodeSniffer_File $file, $position) : bool
	{
		$tokens = $file->getTokens();

		// Ignore USE keywords inside closures.
		$next = $file->findNext(T_WHITESPACE, ($position + 1), NULL, TRUE);
		if ($tokens[$next]['code'] === T_OPEN_PARENTHESIS) {
			return TRUE;
		}

		// Ignore USE keywords for traits.
		if ($file->hasCondition($position, [T_CLASS, T_TRAIT]) === TRUE) {
			return TRUE;
		}

		return FALSE;
	}
private function shouldIgnoreUse ( PHP_CodeSniffer_File $ file , $ position ) : bool { $ tokens = $ file -> getTokens ( ) ; // Ignore USE keywords inside closures. $ next = $ file -> findNext ( T_WHITESPACE , ( $ position + 1 ) , NULL , TRUE ) ; if ( $ tokens [ $ next ] [ 'code' ] === T_OPEN_PARENTHESIS ) { return TRUE ; } // Ignore USE keywords for traits. if ( $ file -> hasCondition ( $ position , [ T_CLASS , T_TRAIT ] ) === TRUE ) { return TRUE ; } return FALSE ; }
Check if this use statement is part of the namespace block.
@param PHP_CodeSniffer_File $file
@param int|bool $position
Check if this use statement is part of the namespace block .