Skip to content

Commit cd5b7f8

Browse files
authored
Merge pull request #66 from joomla-framework/fix-phpstan-errors
Fix some errors
2 parents 1db0306 + a93bdad commit cd5b7f8

4 files changed

Lines changed: 46 additions & 2 deletions

File tree

phpstan-baseline.neon

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Instanceof between ArrayAccess and ArrayAccess will always evaluate to true\.$#'
5+
identifier: instanceof.alwaysTrue
6+
count: 1
7+
path: src/AbstractTransport.php
8+
9+
-
10+
message: '#^Result of && is always false\.$#'
11+
identifier: booleanAnd.alwaysFalse
12+
count: 1
13+
path: src/AbstractTransport.php
14+
15+
-
16+
message: '#^Instanceof between ArrayAccess and ArrayAccess will always evaluate to true\.$#'
17+
identifier: instanceof.alwaysTrue
18+
count: 1
19+
path: src/Http.php
20+
21+
-
22+
message: '#^Instanceof between Joomla\\Uri\\UriInterface and Joomla\\Uri\\UriInterface will always evaluate to true\.$#'
23+
identifier: instanceof.alwaysTrue
24+
count: 1
25+
path: src/Http.php
26+
27+
-
28+
message: '#^Result of && is always false\.$#'
29+
identifier: booleanAnd.alwaysFalse
30+
count: 1
31+
path: src/Http.php
32+
33+
-
34+
message: '#^Instanceof between ArrayAccess and ArrayAccess will always evaluate to true\.$#'
35+
identifier: instanceof.alwaysTrue
36+
count: 2
37+
path: src/HttpFactory.php
38+
39+
-
40+
message: '#^Result of && is always false\.$#'
41+
identifier: booleanAnd.alwaysFalse
42+
count: 2
43+
path: src/HttpFactory.php

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
includes:
3+
- phpstan-baseline.neon
34
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
45

56
parameters:

src/Transport/Socket.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,6 @@ protected function connect(UriInterface $uri, $timeout = null)
286286
*/
287287
public static function isSupported()
288288
{
289-
return \function_exists('fsockopen') && \is_callable('fsockopen');
289+
return \function_exists('fsockopen');
290290
}
291291
}

src/Transport/Stream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,6 @@ protected function getResponse(array $headers, $body)
258258
*/
259259
public static function isSupported()
260260
{
261-
return \function_exists('fopen') && \is_callable('fopen') && ini_get('allow_url_fopen');
261+
return \function_exists('fopen') && ini_get('allow_url_fopen');
262262
}
263263
}

0 commit comments

Comments
 (0)