getTokens(); if ( isset( $tokens[ $stackPtr ] ) === false ) { return false; } $ignore = Tokens::$methodPrefixes; $ignore[ \T_WHITESPACE ] = \T_WHITESPACE; for ( $comment_end = ( $stackPtr - 1 ); $comment_end >= 0; $comment_end-- ) { if ( isset( $ignore[ $tokens[ $comment_end ]['code'] ] ) === true ) { continue; } if ( \T_ATTRIBUTE_END === $tokens[ $comment_end ]['code'] && isset( $tokens[ $comment_end ]['attribute_opener'] ) === true ) { $comment_end = $tokens[ $comment_end ]['attribute_opener']; continue; } break; } if ( \T_DOC_COMMENT_CLOSE_TAG !== $tokens[ $comment_end ]['code'] ) { // Function doesn't have a doc comment or is using the wrong type of comment. return false; } $comment_start = $tokens[ $comment_end ]['comment_opener']; foreach ( $tokens[ $comment_start ]['comment_tags'] as $tag ) { if ( '@deprecated' === $tokens[ $tag ]['content'] ) { return true; } } return false; } }