for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?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\DiffTree;
use SebastianFeldmann\Git\Command\Base;
* Class ChangedFiles
* @package SebastianFeldmann\Git
* @author Sebastian Feldmann <[email protected]>
* @link https://github.com/sebastianfeldmann/git
* @since Class available since Release 2.0.1
class ChangedFiles extends Base
{
* @var string
private $from;
private $to;
* @param string $from
* @return \SebastianFeldmann\Git\Command\DiffTree\ChangedFiles
public function fromRevision(string $from): ChangedFiles
$this->from = $from;
return $this;
}
* @param string $to
public function toRevision(string $to): ChangedFiles
$this->to = $to;
* Return the command to execute.
* @return string
* @throws \RuntimeException
protected function getGitCommand(): string
return 'diff-tree --no-commit-id --name-only -r ' . $this->getVersionsToCompare();
* Return the from commit id to diff
protected function getVersionsToCompare(): string
return escapeshellarg($this->from) . (empty($this->to) ? '' : ' ' . escapeshellarg($this->to));