File tree 4 files changed +34
-4
lines changed
4 files changed +34
-4
lines changed Original file line number Diff line number Diff line change 11
11
xsi : schemaLocation =" https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
12
12
>
13
13
<projectFiles >
14
+ <directory name =" config" />
14
15
<directory name =" src" />
16
+ <ignoreFiles >
17
+ <file name =" config/bootstrap.php" />
18
+ </ignoreFiles >
15
19
</projectFiles >
20
+ <issueHandlers >
21
+ <PossiblyUnusedMethod >
22
+ <errorLevel type =" suppress" >
23
+ <!-- Only called via dependency injection -->
24
+ <referencedMethod name =" Phpcq\RepositoryBuilder\Api\GithubClient::__construct" />
25
+ <referencedMethod name =" Phpcq\RepositoryBuilder\Command\RebuildCommand::__construct" />
26
+ <referencedMethod name =" Phpcq\RepositoryBuilder\Kernel::configureContainer" />
27
+ <referencedMethod name =" Phpcq\RepositoryBuilder\SourceProvider\Plugin\Github\RepositoryFactory::__construct" />
28
+ <referencedMethod name =" Phpcq\RepositoryBuilder\SourceProvider\Tool\Github\TagProviderRepositoryFactory::__construct" />
29
+ <referencedMethod name =" Phpcq\RepositoryBuilder\SourceProvider\Tool\PharIo\RepositoryFactory::__construct" />
30
+
31
+ <!-- Only called via from tests for now - will be used when adding more loaders? -->
32
+ <referencedMethod name =" Phpcq\RepositoryBuilder\SourceProvider\LoaderContext::getPluginConstraint" />
33
+ <referencedMethod name =" Phpcq\RepositoryBuilder\SourceProvider\LoaderContext::getPluginName" />
34
+ <referencedMethod name =" Phpcq\RepositoryBuilder\SourceProvider\Plugin\Github\JsonEntry::getRepository" />
35
+ <referencedMethod name =" Phpcq\RepositoryBuilder\SourceProvider\Plugin\Github\JsonEntry::getTagName" />
36
+
37
+ <!-- Writing of XML files currently not needed in this project. -->
38
+ <referencedMethod name =" Phpcq\RepositoryBuilder\File\XmlFile::createElement" />
39
+ <referencedMethod name =" Phpcq\RepositoryBuilder\File\XmlFile::addElement" />
40
+ <referencedMethod name =" Phpcq\RepositoryBuilder\File\XmlFile::save" />
41
+ </errorLevel >
42
+ </PossiblyUnusedMethod >
43
+ </issueHandlers >
16
44
</psalm >
Original file line number Diff line number Diff line change @@ -143,7 +143,8 @@ public function getContents(): array
143
143
private function makeAbsolute (string $ uri ): string
144
144
{
145
145
$ scheme = parse_url ($ uri , PHP_URL_SCHEME );
146
- if (empty ($ scheme )) {
146
+ assert ((null === $ scheme ) || is_string ($ scheme ));
147
+ if ((null === $ scheme ) || ('' === $ scheme )) {
147
148
// Must be relative to repository then.
148
149
return $ this ->githubClient ->fileUri ($ this ->repository , $ this ->tagName , $ uri );
149
150
}
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ private function handleJsonFile(JsonEntry $jsonEntry): void
95
95
private function loadPluginRequirements (?array $ requirements ): PluginRequirements
96
96
{
97
97
$ result = new PluginRequirements ();
98
- if (empty ( $ requirements) ) {
98
+ if ([] === $ requirements || null === $ requirements ) {
99
99
return $ result ;
100
100
}
101
101
@@ -129,7 +129,8 @@ private function loadPluginRequirements(?array $requirements): PluginRequirement
129
129
private function createHash (string $ absoluteUriPlugin ): PluginHash
130
130
{
131
131
$ scheme = parse_url ($ absoluteUriPlugin , PHP_URL_SCHEME );
132
- if (!empty ($ scheme ) && $ scheme !== 'file ' ) {
132
+ assert ((null === $ scheme ) || is_string ($ scheme ));
133
+ if (null !== $ scheme && $ scheme !== 'file ' ) {
133
134
try {
134
135
return PluginHash::createForString (
135
136
$ this ->httpClient ->request ('GET ' , $ absoluteUriPlugin )->getContent ()
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ public function getPluginIterator(): Generator
100
100
private function loadPluginRequirements (?array $ requirements ): PluginRequirements
101
101
{
102
102
$ result = new PluginRequirements ();
103
- if (empty ( $ requirements) ) {
103
+ if ([] === $ requirements || null === $ requirements ) {
104
104
return $ result ;
105
105
}
106
106
You can’t perform that action at this time.
0 commit comments