private function guessNextArrayTypeAndAdvance(): string
    {
        while (true) {
            if ($this->isEOF()) {
                throw new \LogicException('Could not determine array type');
            }

            // get the next char & advance immediately
            $nextCharacter = substr($this->contents, $this->currentPosition, 1);
            // advance, but without advanceCurrentPosition()
            // because we are either moving along one line until [ {
            // or we are finding a line break and stopping: indentation
            // should not be calculated
            ++$this->currentPosition;

            if ($this->isCharLineBreak($nextCharacter)) {
                return self::ARRAY_FORMAT_MULTILINE;
            }

            if ('[' === $nextCharacter || '{' === $nextCharacter) {
                return self::ARRAY_FORMAT_INLINE;
            }
        }
    }
private function guessNextArrayTypeAndAdvance(): string
    {
        while (true) {
            if ($this->isEOF()) {
                throw new \LogicException('Could not determine array type');
            }

            // get the next char & advance immediately
            $nextCharacter = substr($this->contents, $this->currentPosition, 1);
            // advance, but without advanceCurrentPosition()
            // because we are either moving along one line until [ {
            // or we are finding a line break and stopping: indentation
            // should not be calculated
            ++$this->currentPosition;

            if ($this->isCharLineBreak($nextCharacter)) {
                return self::ARRAY_FORMAT_MULTILINE;
            }

            if ('[' === $nextCharacter || '{' === $nextCharacter) {
                return self::ARRAY_FORMAT_INLINE;
            }
        }
    }
private function guessNextArrayTypeAndAdvance ( ) : string { while ( true ) { if ( $ this -> isEOF ( ) ) { throw new \ LogicException ( 'Could not determine array type' ) ; } // get the next char & advance immediately $ nextCharacter = substr ( $ this -> contents , $ this -> currentPosition , 1 ) ; // advance, but without advanceCurrentPosition() // because we are either moving along one line until [ { // or we are finding a line break and stopping: indentation // should not be calculated ++ $ this -> currentPosition ; if ( $ this -> isCharLineBreak ( $ nextCharacter ) ) { return self :: ARRAY_FORMAT_MULTILINE ; } if ( '[' === $ nextCharacter || '{' === $ nextCharacter ) { return self :: ARRAY_FORMAT_INLINE ; } } }
Attempts to guess if the array at the current position
is a multi-line array or an inline array.
Attempts to guess if the array at the current position is a multi - line array or an inline array .