for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types = 1);
namespace Churn\Logic;
use Churn\Results\ResultsParser;
use Illuminate\Support\Collection;
class ResultsLogic
{
/**
* ResultsLogic constructor.
* @param ResultsParser $parser Results Parser.
*/
public function __construct(ResultsParser $parser)
$this->parser = $parser;
parser
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;
}
* Processes the results into a ResultCollection.
* @param Collection $completedProcesses Collection of completed processes.
* @param float $minScore Minimum score to show.
* @param integer $filesToShow Max number of files to show.
* @return mixed
public function process(Collection $completedProcesses, float $minScore, int $filesToShow)
$resultCollection = $this->parser->parse($completedProcesses);
$resultCollection = $resultCollection->whereScoreAbove($minScore);
$resultCollection = $resultCollection->orderByScoreDesc();
return $resultCollection->take($filesToShow);
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: