public function scan()
 {
     $output = $this->output;
     if (!\PhutilXHPASTBinary::isAvailable()) {
         $output->writeln(\PhutilXHPASTBinary::getBuildInstructions(), $output::OUTPUT_NORMAL);
         exit;
     }
     $base_path = $this->basePath;
     $php_files = $this->allFiles($base_path);
     $total_files = count($php_files);
     $this->output->writeln("{$total_files} files to scan");
     /** @type \Generator $split */
     $split = $this->chunk($php_files, ceil($total_files / $this->workers));
     foreach ($split as $chunk) {
         $this->forkProcess($chunk);
     }
     foreach ($this->processes as $pID) {
         pcntl_waitpid($pID, $status);
     }
 }