src/Standards/BestIt/Sniffs/Functions/MultipleReturnSniff.php
protected function processToken(): void
    {
        $returnPositions = $this->loadReturnsOfThisFunction();

        if (count($returnPositions) > 1) {
            array_shift($returnPositions);

            array_walk($returnPositions, function (int $returnPos): void {
                $this->file->addWarning(
                    self::WARNING_MULTIPLE_RETURNS_FOUND,
                    $returnPos,
                    static::CODE_MULTIPLE_RETURNS_FOUND
                );
            });
        }
    }
protected function processToken(): void
    {
        $returnPositions = $this->loadReturnsOfThisFunction();

        if (count($returnPositions) > 1) {
            array_shift($returnPositions);

            array_walk($returnPositions, function (int $returnPos): void {
                $this->file->addWarning(
                    self::WARNING_MULTIPLE_RETURNS_FOUND,
                    $returnPos,
                    static::CODE_MULTIPLE_RETURNS_FOUND
                );
            });
        }
    }
protected function processToken ( ) : void { $ returnPositions = $ this -> loadReturnsOfThisFunction ( ) ; if ( count ( $ returnPositions ) > 1 ) { array_shift ( $ returnPositions ) ; array_walk ( $ returnPositions , function ( int $ returnPos ) : void { $ this -> file -> addWarning ( self :: WARNING_MULTIPLE_RETURNS_FOUND , $ returnPos , static :: CODE_MULTIPLE_RETURNS_FOUND ) ; } ) ; } }
Iterates through the returns of this function and registers warnings if there is more then one relevant return.

@return void
Iterates through the returns of this function and registers warnings if there is more then one relevant return .