Skip to content

Commit

Permalink
Merge pull request #70 from fezfez/php8.2
Browse files Browse the repository at this point in the history
Drop support php 7, add php 8.2 support
  • Loading branch information
Ocramius authored Oct 16, 2022
2 parents 7300482 + e9b6add commit ac4588d
Show file tree
Hide file tree
Showing 83 changed files with 501 additions and 657 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
"sort-packages": true
},
"require": {
"php": "^7.3 || ~8.0.0 || ~8.1.0",
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
"laminas/laminas-loader": "^2.8",
"laminas/laminas-stdlib": "^3.6",
"laminas/laminas-uri": "^2.9.1",
"laminas/laminas-validator": "^2.15"
},
"require-dev": {
"ext-curl": "*",
"laminas/laminas-coding-standard": "~2.2.1",
"phpunit/phpunit": "^9.5.5"
"laminas/laminas-coding-standard": "~2.4.0",
"phpunit/phpunit": "^9.5.25"
},
"suggest": {
"paragonie/certainty": "For automated management of cacert.pem"
Expand Down
980 changes: 333 additions & 647 deletions composer.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@

<!-- Include all rules from Laminas Coding Standard -->
<rule ref="LaminasCodingStandard"/>

<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing">
<exclude-pattern>src/</exclude-pattern>
</rule>
</ruleset>
3 changes: 1 addition & 2 deletions src/Header/ContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use function array_walk;
use function count;
use function explode;
use function get_class;
use function gettype;
use function implode;
use function is_object;
Expand Down Expand Up @@ -295,7 +294,7 @@ protected function getMediaTypeObjectFromString($string)
if (! is_string($string)) {
throw new Exception\InvalidArgumentException(sprintf(
'Non-string mediatype "%s" provided',
is_object($string) ? get_class($string) : gettype($string)
is_object($string) ? $string::class : gettype($string)
));
}

Expand Down
3 changes: 1 addition & 2 deletions src/Headers.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use function count;
use function current;
use function explode;
use function get_class;
use function gettype;
use function implode;
use function in_array;
Expand Down Expand Up @@ -160,7 +159,7 @@ public function addHeaders($headers)
if (! is_array($headers) && ! $headers instanceof Traversable) {
throw new Exception\InvalidArgumentException(sprintf(
'Expected array or Traversable; received "%s"',
is_object($headers) ? get_class($headers) : gettype($headers)
is_object($headers) ? $headers::class : gettype($headers)
));
}

Expand Down
4 changes: 3 additions & 1 deletion test/Client/CurlTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Client;

use ArrayObject;
Expand Down Expand Up @@ -580,6 +582,6 @@ public function testMustRemoveProxyConnectionEstablishedLine()
$response = $this->client->getResponse();

$this->assertSame(200, $response->getStatusCode());
$this->assertMatchesRegularExpression('#^HTTP/1.(0|1) 200 OK$#', trim(strstr($response, "\n", true)));
$this->assertMatchesRegularExpression('#^HTTP/1.(0|1) 200 OK$#', trim(strstr((string) $response, "\n", true)));
}
}
2 changes: 2 additions & 0 deletions test/Client/ProxyAdapterTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Client;

use Laminas\Http\Client;
Expand Down
2 changes: 2 additions & 0 deletions test/Client/SocketKeepaliveTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Client;

use Laminas\Http\Client\Adapter\Socket;
Expand Down
2 changes: 2 additions & 0 deletions test/Client/SocketPersistentTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Client;

use Laminas\Http\Client\Adapter\Socket;
Expand Down
2 changes: 2 additions & 0 deletions test/Client/SocketTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Client;

use ArrayObject;
Expand Down
2 changes: 2 additions & 0 deletions test/Client/StaticClientTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Client;

use Laminas\Http\Client;
Expand Down
2 changes: 2 additions & 0 deletions test/Client/StaticTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Client;

use ArrayObject;
Expand Down
2 changes: 2 additions & 0 deletions test/Client/TestAdapterTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Client;

use Exception;
Expand Down
2 changes: 2 additions & 0 deletions test/Client/TestAsset/MockAdapter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Client\TestAsset;

use Laminas\Http\Client\Adapter\Test;
Expand Down
2 changes: 2 additions & 0 deletions test/Client/TestAsset/MockClient.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Client\TestAsset;

use Laminas\Http\Client;
Expand Down
2 changes: 2 additions & 0 deletions test/Client/UseCaseTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Client;

use Laminas\Http\Client as HTTPClient;
Expand Down
2 changes: 2 additions & 0 deletions test/CookiesTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http;

use Laminas\Http\Cookies;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/AcceptCharsetTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\AcceptCharset;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/AcceptEncodingTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\AcceptEncoding;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/AcceptLanguageTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\AcceptLanguage;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/AcceptRangesTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\AcceptRanges;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/AcceptTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\Accept;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/AgeTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\Age;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/AllowTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\Allow;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/AuthenticationInfoTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\AuthenticationInfo;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/AuthorizationTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\Authorization;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/CacheControlTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\CacheControl;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/ConnectionTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\Connection;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/ContentDispositionTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\ContentDisposition;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/ContentEncodingTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\ContentEncoding;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/ContentLanguageTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\ContentLanguage;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/ContentLengthTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\ContentLength;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/ContentLocationTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\ContentLocation;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/ContentRangeTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\ContentRange;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/ContentSecurityPolicyReportOnlyTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\ContentSecurityPolicyReportOnly;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/ContentSecurityPolicyTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Exception\RuntimeException;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/ContentTransferEncodingTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\ContentTransferEncoding;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/ContentTypeTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\ContentType;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/CookieTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use ArrayObject;
Expand Down
6 changes: 4 additions & 2 deletions test/Header/DateTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use DateTime;
Expand Down Expand Up @@ -36,7 +38,7 @@ public function testDateFromTimeStringCreatesValidDateHeader()
$this->assertInstanceOf(Date::class, $dateHeader);

$date = new DateTime('now', new DateTimeZone('GMT'));
$interval = $dateHeader->date()->diff($date, 1);
$interval = $dateHeader->date()->diff($date, true);

if (PHP_VERSION_ID >= 70200) {
$this->assertSame('+11 hours 59 minutes 59 seconds', $interval->format('%R%H hours %I minutes %S seconds'));
Expand All @@ -55,7 +57,7 @@ public function testDateFromTimestampCreatesValidDateHeader()
$this->assertInstanceOf(Date::class, $dateHeader);

$date = new DateTime('now', new DateTimeZone('GMT'));
$interval = $dateHeader->date()->diff($date, 1);
$interval = $dateHeader->date()->diff($date, true);

if (PHP_VERSION_ID >= 70200) {
$this->assertSame('+11 hours 59 minutes 59 seconds', $interval->format('%R%H hours %I minutes %S seconds'));
Expand Down
2 changes: 2 additions & 0 deletions test/Header/EtagTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\Etag;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/ExpectTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\Exception\InvalidArgumentException;
Expand Down
2 changes: 2 additions & 0 deletions test/Header/ExpiresTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace LaminasTest\Http\Header;

use Laminas\Http\Header\Exception\InvalidArgumentException;
Expand Down
Loading

0 comments on commit ac4588d

Please sign in to comment.