diff --git a/src/Console/Commands/Hooks/BaseCodeAnalyzerPreCommitHook.php b/src/Console/Commands/Hooks/BaseCodeAnalyzerPreCommitHook.php index ff4f300..62e150d 100644 --- a/src/Console/Commands/Hooks/BaseCodeAnalyzerPreCommitHook.php +++ b/src/Console/Commands/Hooks/BaseCodeAnalyzerPreCommitHook.php @@ -67,9 +67,16 @@ abstract class BaseCodeAnalyzerPreCommitHook implements CodeAnalyzerPreCommitHoo */ protected string $dockerContainer = ''; + /** + * @var Chunk size used for analyze + */ + protected int $chunkSize = 100; + public function __construct() { $this->setCwd(base_path()); + + $this->chunkSize = config('git-hooks.analyzer_chunk_size'); } /** @@ -191,10 +198,8 @@ public function getDockerContainer(): string */ protected function analizeCommittedFiles(Collection $commitFiles): self { - $chunkSize = config('git-hooks.analyzer_chunk_size'); - /** @var Collection $chunk */ - foreach ($commitFiles->chunk($chunkSize) as $chunk) { + foreach ($commitFiles->chunk($this->chunkSize) as $chunk) { $filePaths = []; /** @var ChangedFile $file */