ObjectCalisthenics\Helper\ClassAnalyzer::extractPropertyIfFound PHP Method

extractPropertyIfFound() private static method

private static extractPropertyIfFound ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr )
$phpcsFile PHP_CodeSniffer_File
$stackPtr integer
    private static function extractPropertyIfFound(PHP_CodeSniffer_File $phpcsFile, int $stackPtr)
    {
        $tokens = $phpcsFile->getTokens();
        $property = $tokens[$stackPtr];
        // Is it a property or a random variable?
        if (!(count($property['conditions']) === 1 && in_array(reset($property['conditions']), [T_CLASS, T_TRAIT]))) {
            return;
        }
        if ($comment = MemberComment::getMemberComment($phpcsFile, $stackPtr)) {
            self::$propertyList[] = ['type' => $comment];
        }
    }