src/Standards/BestIt/Sniffs/Formatting/TraitUseSpacingSniff.php
private function checkLinesAfterLastUse(int $lastUsePos): void
    {
        $lastUseEndPos = $this->getLastUseEndPos($lastUsePos);

        list($realLinesAfterUse, $whitespaceEnd) = $this->getRealLinesAfterLastUse($lastUseEndPos);

        $requiredLinesAfter = $this->isEndOfClass($lastUseEndPos)
            ? self::LINES_AFTER_LAST_USE_WHEN_LAST_IN_CLASS
            : self::LINES_AFTER_LAST_USE;

        if ($realLinesAfterUse !== $requiredLinesAfter) {
            $fix = $this->getFile()->addFixableError(
                self::MESSAGE_INCORRECT_LINES_COUNT_AFTER_LAST_USE,
                $lastUsePos,
                self::CODE_INCORRECT_LINES_COUNT_AFTER_LAST_USE,
                [
                    $requiredLinesAfter,
                    $realLinesAfterUse
                ]
            );

            if ($fix) {
                $this->fixLineAfterLastUse($lastUseEndPos, $whitespaceEnd, $requiredLinesAfter);
            }
        }
    }
private function checkLinesAfterLastUse(int $lastUsePos): void
    {
        $lastUseEndPos = $this->getLastUseEndPos($lastUsePos);

        list($realLinesAfterUse, $whitespaceEnd) = $this->getRealLinesAfterLastUse($lastUseEndPos);

        $requiredLinesAfter = $this->isEndOfClass($lastUseEndPos)
            ? self::LINES_AFTER_LAST_USE_WHEN_LAST_IN_CLASS
            : self::LINES_AFTER_LAST_USE;

        if ($realLinesAfterUse !== $requiredLinesAfter) {
            $fix = $this->getFile()->addFixableError(
                self::MESSAGE_INCORRECT_LINES_COUNT_AFTER_LAST_USE,
                $lastUsePos,
                self::CODE_INCORRECT_LINES_COUNT_AFTER_LAST_USE,
                [
                    $requiredLinesAfter,
                    $realLinesAfterUse
                ]
            );

            if ($fix) {
                $this->fixLineAfterLastUse($lastUseEndPos, $whitespaceEnd, $requiredLinesAfter);
            }
        }
    }
private function checkLinesAfterLastUse ( int $ lastUsePos ) : void { $ lastUseEndPos = $ this -> getLastUseEndPos ( $ lastUsePos ) ; list ( $ realLinesAfterUse , $ whitespaceEnd ) = $ this -> getRealLinesAfterLastUse ( $ lastUseEndPos ) ; $ requiredLinesAfter = $ this -> isEndOfClass ( $ lastUseEndPos ) ? self :: LINES_AFTER_LAST_USE_WHEN_LAST_IN_CLASS : self :: LINES_AFTER_LAST_USE ; if ( $ realLinesAfterUse !== $ requiredLinesAfter ) { $ fix = $ this -> getFile ( ) -> addFixableError ( self :: MESSAGE_INCORRECT_LINES_COUNT_AFTER_LAST_USE , $ lastUsePos , self :: CODE_INCORRECT_LINES_COUNT_AFTER_LAST_USE , [ $ requiredLinesAfter , $ realLinesAfterUse ] ) ; if ( $ fix ) { $ this -> fixLineAfterLastUse ( $ lastUseEndPos , $ whitespaceEnd , $ requiredLinesAfter ) ; } } }
Checks the line after the last use and registers an error if needed.

@param int $lastUsePos

@return void
Checks the line after the last use and registers an error if needed .