diff --git a/app/Services/PHPUnitConfigurationService.php b/app/Services/PHPUnitConfigurationService.php index e1c3515..1de9c0f 100644 --- a/app/Services/PHPUnitConfigurationService.php +++ b/app/Services/PHPUnitConfigurationService.php @@ -35,7 +35,7 @@ public function setConfigurationFile(string $configurationFile): self */ public function generateTestsSuites(string $testsDirectory, int $numberTestsSuites = 4) { - throw_if(!$this->isInitialized(), new \Exception('Configuration file is not set.')); + $this->isInitialized(); $phpunit = $this ->configurationFile @@ -58,7 +58,9 @@ public function generateTestsSuites(string $testsDirectory, int $numberTestsSuit }) ->split($numberTestsSuites) ->each(function ($filesList, $index) use ($testSuites) { - $testSuite = $this->configurationFile->createElement('testsuite'); + $testSuite = $this + ->configurationFile + ->createElement('testsuite'); $testSuite->setAttribute('name', "sliced-testsuite-{$index}"); collect($filesList) @@ -82,16 +84,19 @@ public function generateTestsSuites(string $testsDirectory, int $numberTestsSuit */ public function saveTo(string $destination) { - throw_if(!$this->isInitialized(), new \Exception('Configuration file is not set.')); + $this->isInitialized(); return $this->configurationFile->save($destination); } /** - * @return bool + * @return void + * @throws \Throwable */ - private function isInitialized(): bool + private function isInitialized(): void { - return $this->configurationFile instanceof \DOMDocument; + $isInitialized = $this->configurationFile instanceof \DOMDocument; + + throw_if(!$isInitialized, new \Exception('Configuration file is not set.')); } } diff --git a/builds/phpunit-slicer b/builds/phpunit-slicer index 21bf4e8..91b16c1 100755 Binary files a/builds/phpunit-slicer and b/builds/phpunit-slicer differ