![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/sebastianfeldmann/git/src/Command/RefLog/ |
<?php /** * This file is part of SebastianFeldmann\Git. * * (c) Sebastian Feldmann <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace SebastianFeldmann\Git\Command\RefLog; use SebastianFeldmann\Git\Command\Base; /** * Class BranchRevs * * @package SebastianFeldmann\Git * @author Sebastian Feldmann <[email protected]> * @link https://github.com/sebastianfeldmann/git * @since Class available since Release 3.10.0 */ class BranchRevs extends Base { /** * git log format * * @var string */ private string $format = ''; /** * branch name * * @var string */ private string $branch; public function format(string $format): BranchRevs { $this->format = $format; return $this; } public function fromBranch(string $branch): BranchRevs { $this->branch = $branch; return $this; } /** * Return the command to execute. * * @return string */ protected function getGitCommand(): string { $format = !empty($this->format) ? ' --format=\'' . $this->format . '\'' : ''; return 'reflog' . $format . ' ' . $this->branch; } }