Skip to content

Commit 39b82cd

Browse files
committed
[BE] Analysis with zero files results in non-zero exit code
1 parent 0253a68 commit 39b82cd

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

changelog-2.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ Bleeding edge (TODO move to other sections)
5959
* More precise `file()` flags args ([#2476](https://github.com/phpstan/phpstan-src/pull/2476), [#2482](https://github.com/phpstan/phpstan-src/pull/2482)), thanks @staabm!
6060
* More precise `flock()` operation flags ([#2477](https://github.com/phpstan/phpstan-src/pull/2477)), thanks @staabm!
6161
* Rule for `call_user_func()` ([#2479](https://github.com/phpstan/phpstan-src/pull/2479)), thanks @staabm!
62-
* Analysis with zero files results in non-zero exit code (https://github.com/phpstan/phpstan-src/commit/46ff440648e62617df86aa74ba905ffa99897737), #9410
6362
* Report dead types even in multi-exception catch ([#2399](https://github.com/phpstan/phpstan-src/pull/2399)), thanks @JanTvrdik!
6463
* `error_log` errors with `message_type=2` ([#2428](https://github.com/phpstan/phpstan-src/pull/2428)), #9380, thanks @staabm!
6564
* Check `filter_input*` type param type ([#2271](https://github.com/phpstan/phpstan-src/pull/2271)), thanks @herndlm!
@@ -140,6 +139,7 @@ Improvements 🔧
140139
* Do not generalize template types, except when in `GenericObjectType` ([#2818](https://github.com/phpstan/phpstan-src/pull/2818), [#2821](https://github.com/phpstan/phpstan-src/pull/2821))
141140
* This fixes following **17 issues**: #8166, #8127, #7944, #7283, #6653, #6196, #9084, #8683, #8074, #7984, #7301, #7087, #5594, #5592, #9472, #9764, #10092
142141
* Non-static methods cannot be used as static callables in PHP 8+ ([#2420](https://github.com/phpstan/phpstan-src/pull/2420)), thanks @staabm!
142+
* Analysis with zero files results in non-zero exit code (https://github.com/phpstan/phpstan-src/commit/46ff440648e62617df86aa74ba905ffa99897737), #9410
143143

144144
Bugfixes 🐛
145145
=====================

src/Command/AnalyseCommand.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -244,17 +244,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
244244
}
245245

246246
if (count($files) === 0) {
247-
$bleedingEdge = (bool) $container->getParameter('featureToggles')['zeroFiles'];
248-
249247
$this->runDiagnoseExtensions($container, $inceptionResult->getErrorOutput());
250248

251-
if (!$bleedingEdge) {
252-
$inceptionResult->getErrorOutput()->getStyle()->note('No files found to analyse.');
253-
$inceptionResult->getErrorOutput()->getStyle()->warning('This will cause a non-zero exit code in PHPStan 2.0.');
254-
255-
return $inceptionResult->handleReturn(0, null, $this->analysisStartTime);
256-
}
257-
258249
$inceptionResult->getErrorOutput()->getStyle()->error('No files found to analyse.');
259250

260251
return $inceptionResult->handleReturn(1, null, $this->analysisStartTime);

0 commit comments

Comments
 (0)