55use Clue \React \NDJson \Decoder ;
66use Clue \React \NDJson \Encoder ;
77use Nette \Utils \Random ;
8+ use PHPStan \Analyser \AnalyserResult ;
89use PHPStan \Analyser \Error ;
910use PHPStan \Analyser \IgnoredErrorHelper ;
1011use PHPStan \Command \AnalyseCommand ;
@@ -46,7 +47,7 @@ public function __construct(
4647 * @param bool $onlyFiles
4748 * @param \Closure(int): void|null $postFileCallback
4849 * @param string|null $projectConfigFile
49- * @return array{errors: (string[]|\PHPStan\Analyser\Error[]), hasInferrablePropertyTypesFromConstructor: bool}
50+ * @return AnalyserResult
5051 */
5152 public function analyse (
5253 Schedule $ schedule ,
@@ -55,14 +56,14 @@ public function analyse(
5556 ?\Closure $ postFileCallback ,
5657 ?string $ projectConfigFile ,
5758 InputInterface $ input
58- ): array
59+ ): AnalyserResult
5960 {
6061 $ ignoredErrorHelperResult = $ this ->ignoredErrorHelper ->initialize ();
6162 if (count ($ ignoredErrorHelperResult ->getErrors ()) > 0 ) {
62- return [
63- ' errors ' => $ ignoredErrorHelperResult ->getErrors (),
64- ' hasInferrablePropertyTypesFromConstructor ' => false ,
65- ] ;
63+ return new AnalyserResult (
64+ $ ignoredErrorHelperResult ->getErrors (),
65+ false
66+ ) ;
6667 }
6768
6869 $ jobs = array_reverse ($ schedule ->getJobs ());
@@ -174,10 +175,10 @@ public function analyse(
174175 $ internalErrors [] = sprintf ('Reached internal errors count limit of %d, exiting... ' , $ this ->internalErrorsCountLimit );
175176 }
176177
177- return [
178- ' errors ' => array_merge ($ ignoredErrorHelperResult ->process ($ errors , $ onlyFiles , $ reachedInternalErrorsCountLimit ), $ internalErrors , $ ignoredErrorHelperResult ->getWarnings ()),
179- ' hasInferrablePropertyTypesFromConstructor ' => $ hasInferrablePropertyTypesFromConstructor,
180- ] ;
178+ return new AnalyserResult (
179+ array_merge ($ ignoredErrorHelperResult ->process ($ errors , $ onlyFiles , $ reachedInternalErrorsCountLimit ), $ internalErrors , $ ignoredErrorHelperResult ->getWarnings ()),
180+ $ hasInferrablePropertyTypesFromConstructor
181+ ) ;
181182 }
182183
183184 private function getWorkerCommand (
0 commit comments