classes/ModelFileParser.php
public function extractModelRelationsFromSource($fileContents)
    {
        $result = [];

        $stream = new PhpSourceStream($fileContents);

        while ($stream->forward()) {
            $tokenCode = $stream->getCurrentCode();

            if ($tokenCode == T_PUBLIC) {
                $relations = $this->extractRelations($stream);
                if ($relations === false) {
                    continue;
                }
            }
        }

        if (!$result) {
            return null;
        }

        return $result;
    }
public function extractModelRelationsFromSource($fileContents)
    {
        $result = [];

        $stream = new PhpSourceStream($fileContents);

        while ($stream->forward()) {
            $tokenCode = $stream->getCurrentCode();

            if ($tokenCode == T_PUBLIC) {
                $relations = $this->extractRelations($stream);
                if ($relations === false) {
                    continue;
                }
            }
        }

        if (!$result) {
            return null;
        }

        return $result;
    }
public function extractModelRelationsFromSource ( $ fileContents ) { $ result = [ ] ; $ stream = new PhpSourceStream ( $ fileContents ) ; while ( $ stream -> forward ( ) ) { $ tokenCode = $ stream -> getCurrentCode ( ) ; if ( $ tokenCode == T_PUBLIC ) { $ relations = $ this -> extractRelations ( $ stream ) ; if ( $ relations === false ) { continue ; } } } if ( ! $ result ) { return null ; } return $ result ; }
Extracts names and types of model relations.
@param string $fileContents Specifies the file contents.
@return array|null Returns an array with keys matching the relation types and values containing relation names as array.
Returns null if the parsing fails.
Extracts names and types of model relations .