Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php-versions: [ '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
php-versions: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
psr-http-versions: [ '~1.0.0', '^1', '^2' ]
exclude:
- php-versions: '7.3'
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "library",
"require": {
"psr/http-message": "^1 || ^2",
"php": ">=7.3"
"php": ">=7.4"
},
"require-dev": {
"phpunit/phpunit": "^9.6.19",
Expand All @@ -15,7 +15,7 @@
"friendsofphp/php-cs-fixer": "^3.4",
"donatj/mddoc": "^0.10.1",
"donatj/drop": "^1.1",
"phpstan/phpstan": "^1.12"
"phpstan/phpstan": "^2.1.18"
},
"license": "MIT",
"authors": [
Expand Down
4 changes: 2 additions & 2 deletions src/ProxyAwareSchemer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
class ProxyAwareSchemer {

/** @var array<string,scalar> */
/** @var array<string,mixed> */
private $server;

public const HTTPS_EXPECTED_SERVER_VALUES = [
Expand All @@ -46,7 +46,7 @@
private $proxyServerPortKeys;

/**
* @param array<string,scalar> $server Server array to inspect. Defaults to $_SERVER.
* @param array<string,mixed> $server Server array to inspect. Defaults to $_SERVER.
*
* @param array<string,string>|null $proxyServerHttpsKeyValues Map of $_SERVER keys to their expected https-positive value.
* Defaults to ProxyAwareSchemer::HTTPS_EXPECTED_SERVER_VALUES
Expand Down Expand Up @@ -105,7 +105,7 @@
) : UriInterface {
foreach( $this->proxyServerHttpsKeyValues as $serverKey => $serverValue ) {
if( isset($this->server[$serverKey])
&& strtolower((string)$this->server[$serverKey]) === $serverValue

Check failure on line 108 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.3, ^1)

Cannot cast mixed to string.

Check failure on line 108 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.0, ^1)

Cannot cast mixed to string.

Check failure on line 108 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.1, ^1)

Cannot cast mixed to string.

Check failure on line 108 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.2, ^2)

Cannot cast mixed to string.

Check failure on line 108 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.4, ~1.0.0)

Cannot cast mixed to string.

Check failure on line 108 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.1, ^1)

Cannot cast mixed to string.

Check failure on line 108 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.0, ^2)

Cannot cast mixed to string.

Check failure on line 108 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.1, ^2)

Cannot cast mixed to string.

Check failure on line 108 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.3, ~1.0.0)

Cannot cast mixed to string.

Check failure on line 108 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.4, ^2)

Cannot cast mixed to string.

Check failure on line 108 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.0, ~1.0.0)

Cannot cast mixed to string.

Check failure on line 108 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 7.4, ~1.0.0)

Cannot cast mixed to string.

Check failure on line 108 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.4, ^1)

Cannot cast mixed to string.

Check failure on line 108 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.1, ~1.0.0)

Cannot cast mixed to string.

Check failure on line 108 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.2, ^1)

Cannot cast mixed to string.
) {
$newUri = $uri->withScheme('https');

Expand All @@ -127,7 +127,7 @@
public function withDetectedPort( UriInterface $uri, ?int $default = null ) : UriInterface {
foreach( $this->proxyServerPortKeys as $portKey ) {
if( isset($this->server[$portKey]) ) {
$port = (int)$this->server[$portKey];

Check failure on line 130 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.3, ^1)

Cannot cast mixed to int.

Check failure on line 130 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.0, ^1)

Cannot cast mixed to int.

Check failure on line 130 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.1, ^1)

Cannot cast mixed to int.

Check failure on line 130 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.2, ^2)

Cannot cast mixed to int.

Check failure on line 130 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.4, ~1.0.0)

Cannot cast mixed to int.

Check failure on line 130 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.1, ^1)

Cannot cast mixed to int.

Check failure on line 130 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.0, ^2)

Cannot cast mixed to int.

Check failure on line 130 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.1, ^2)

Cannot cast mixed to int.

Check failure on line 130 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.3, ~1.0.0)

Cannot cast mixed to int.

Check failure on line 130 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.4, ^2)

Cannot cast mixed to int.

Check failure on line 130 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.0, ~1.0.0)

Cannot cast mixed to int.

Check failure on line 130 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 7.4, ~1.0.0)

Cannot cast mixed to int.

Check failure on line 130 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.4, ^1)

Cannot cast mixed to int.

Check failure on line 130 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.1, ~1.0.0)

Cannot cast mixed to int.

Check failure on line 130 in src/ProxyAwareSchemer.php

View workflow job for this annotation

GitHub Actions / Tests (ubuntu-latest, 8.2, ^1)

Cannot cast mixed to int.
if( $port > 0 && $port <= 65535 ) {
return $uri->withPort($port);
}
Expand Down
Loading