public function getBranch(string $name)
    {
        /** @var Branch $branch */
        foreach ($this->getBranches() as $branch) {
            if ($branch->getName() === $name) {
                return $branch;
            }
        }

        return null;
    }
public function getBranch(string $name)
    {
        /** @var Branch $branch */
        foreach ($this->getBranches() as $branch) {
            if ($branch->getName() === $name) {
                return $branch;
            }
        }

        return null;
    }
public function getBranch ( string $ name ) { /** @var Branch $branch */ foreach ( $ this -> getBranches ( ) as $ branch ) { if ( $ branch -> getName ( ) === $ name ) { return $ branch ; } } return null ; }
Retrieve a Branch object by a branch name

@param string $name The branch name

@throws \RuntimeException
@throws \InvalidArgumentException
@throws \Symfony\Component\Process\Exception\RuntimeException
@return null|Branch
Retrieve a Branch object by a branch name