public static function getDiagnostics(Node $n) : array {
        $diagnostics = [];

        /**
         * @param \Microsoft\PhpParser\Node|\Microsoft\PhpParser\Token $node
         */
        $n->walkDescendantNodesAndTokens(function($node) use (&$diagnostics) {
            if (($diagnostic = self::checkDiagnostics($node)) !== null) {
                $diagnostics[] = $diagnostic;
            }
        });

        return $diagnostics;
    }
public static function getDiagnostics(Node $n) : array {
        $diagnostics = [];

        /**
         * @param \Microsoft\PhpParser\Node|\Microsoft\PhpParser\Token $node
         */
        $n->walkDescendantNodesAndTokens(function($node) use (&$diagnostics) {
            if (($diagnostic = self::checkDiagnostics($node)) !== null) {
                $diagnostics[] = $diagnostic;
            }
        });

        return $diagnostics;
    }
public static function getDiagnostics ( Node $ n ) : array { $ diagnostics = [ ] ; /**
         * @param \Microsoft\PhpParser\Node|\Microsoft\PhpParser\Token $node
         */ $ n -> walkDescendantNodesAndTokens ( function ( $ node ) use ( & $ diagnostics ) { if ( ( $ diagnostic = self :: checkDiagnostics ( $ node ) ) !== null ) { $ diagnostics [ ] = $ diagnostic ; } } ) ; return $ diagnostics ; }
Traverses AST to generate diagnostics.
@param \Microsoft\PhpParser\Node $n
@return Diagnostic[]
Traverses AST to generate diagnostics .