for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types = 1);
namespace Churn\Processes;
use Churn\Values\File;
use Symfony\Component\Process\Process;
class ChurnProcess
{
/**
* The Symfony Process Component.
* @var Process
*/
private $process;
* GitCommitCountProcess constructor.
* @param File $file The file the process is being executed on.
* @param Process $process The process being executed on the file.
* @param string $type The type of process.
public function __construct(File $file, Process $process, string $type)
$this->file = $file;
file
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
$this->process = $process;
$this->type = $type;
type
}
* Start the process.
* @return void
public function start()
$this->process->start();
* Determines if the process was successful.
* @return boolean
public function isSuccessful(): bool
return $this->process->isSuccessful();
* Gets the output of the process.
* @return string
public function getOutput(): string
return $this->process->getOutput();
* Gets the file name of the file the process
* is being executed on.
public function getFilename(): string
return $this->file->getDisplayPath();
* Gets a unique key used for storing the process in data structures.
public function getKey(): string
return $this->getType() . $this->file->getFullPath();
* Get the type of this process.
public function getType(): string
return $this->type;
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: