1 | <?php |
||||
2 | |||||
3 | declare(strict_types=1); |
||||
4 | |||||
5 | use ChangelogGenerator\ChangelogGenerator; |
||||
6 | use ChangelogGenerator\Command\GenerateChangelogCommand; |
||||
7 | use ChangelogGenerator\IssueClient; |
||||
8 | use ChangelogGenerator\IssueFactory; |
||||
9 | use ChangelogGenerator\IssueFetcher; |
||||
10 | use ChangelogGenerator\IssueGrouper; |
||||
11 | use ChangelogGenerator\IssueRepository; |
||||
12 | use Composer\InstalledVersions; |
||||
13 | use GuzzleHttp\Client; |
||||
0 ignored issues
–
show
|
|||||
14 | use Http\Discovery\HttpClientDiscovery; |
||||
15 | use Http\Discovery\Psr17FactoryDiscovery; |
||||
16 | use Symfony\Component\Console\Application; |
||||
17 | |||||
18 | $autoloadFiles = [ |
||||
19 | __DIR__ . '/../vendor/autoload.php', |
||||
20 | __DIR__ . '/../../../autoload.php' |
||||
21 | ]; |
||||
22 | |||||
23 | $autoloader = false; |
||||
24 | |||||
25 | foreach ($autoloadFiles as $autoloadFile) { |
||||
26 | if (file_exists($autoloadFile)) { |
||||
27 | require_once $autoloadFile; |
||||
28 | $autoloader = true; |
||||
29 | } |
||||
30 | } |
||||
31 | |||||
32 | if (!$autoloader) { |
||||
33 | if (extension_loaded('phar') && ($uri = Phar::running())) { |
||||
34 | echo 'The phar has been built without dependencies' . PHP_EOL; |
||||
35 | } |
||||
36 | |||||
37 | die('vendor/autoload.php could not be found. Did you run `php composer.phar install`?'); |
||||
38 | } |
||||
39 | |||||
40 | $issueClient = new IssueClient( |
||||
41 | Psr17FactoryDiscovery::findRequestFactory(), |
||||
42 | HttpClientDiscovery::find() |
||||
43 | ); |
||||
44 | $issueFactory = new IssueFactory(); |
||||
45 | $issueFetcher = new IssueFetcher($issueClient); |
||||
46 | $issueRepository = new IssueRepository($issueFetcher, $issueFactory); |
||||
47 | $issueGrouper = new IssueGrouper(); |
||||
48 | |||||
49 | $generator = new ChangelogGenerator($issueRepository, $issueGrouper); |
||||
50 | |||||
51 | $application = new Application('Changelog Generator', InstalledVersions::getPrettyVersion('jwage/changelog-generator')); |
||||
0 ignored issues
–
show
It seems like
Composer\InstalledVersio...e/changelog-generator') can also be of type null ; however, parameter $version of Symfony\Component\Consol...lication::__construct() does only seem to accept string , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
52 | $application->add(new GenerateChangelogCommand($generator)); |
||||
53 | $application->run(); |
||||
54 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths