Skip to content

Commit 14e14d0

Browse files
committed
update to PHP 8
closes #14
1 parent 627bb0a commit 14e14d0

23 files changed

+364
-542
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ docs/
33
composer.phar
44
phpunit.phar
55
composer.lock
6+
*.bak
7+
*.cache
8+
.idea/

composer.json

+13-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
}
1313
],
1414
"require": {
15-
"php": ">=5.4.0"
15+
"php": ">=8.0.0"
1616
},
1717
"require-dev": {
18-
"phpunit/phpunit": "^4.8 || ^5.7 || ^6.5",
19-
"phpdocumentor/phpdocumentor": "2.8.1"
18+
"phpunit/phpunit": "^11.0.6"
2019
},
2120
"autoload": {
2221
"psr-4": {
@@ -27,5 +26,16 @@
2726
"psr-4": {
2827
"Tivie\\HtaccessParser\\": "tests/"
2928
}
29+
},
30+
"config": {
31+
"sort-packages": true,
32+
"preferred-install": "dist",
33+
"optimize-autoloader": true,
34+
"classmap-authoritative": true,
35+
"apcu-autoloader": true,
36+
"allow-plugins": {
37+
"phpdocumentor/unified-asset-installer": true,
38+
"symfony/flex": true
39+
}
3040
}
3141
}

phpunit.xml

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
<phpunit bootstrap="tests/bootstrap.php">
2-
<testsuites>
3-
<testsuite name="htaccessparser">
4-
<directory suffix=".php">tests</directory>
5-
</testsuite>
6-
</testsuites>
7-
<filter>
8-
<whitelist>
9-
<directory suffix=".php">src</directory>
10-
</whitelist>
11-
</filter>
1+
<?xml version="1.0"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd" cacheDirectory=".phpunit.cache">
3+
<testsuites>
4+
<testsuite name="htaccessparser">
5+
<directory suffix=".php">tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
<source>
9+
<include>
10+
<directory suffix=".php">src</directory>
11+
</include>
12+
</source>
13+
<coverage includeUncoveredFiles="true"
14+
pathCoverage="false"
15+
ignoreDeprecatedCodeUnits="true"
16+
disableCodeCoverageIgnore="true">
17+
</coverage>
1218
</phpunit>

src/Exception/DomainException.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* -- PHP Htaccess Parser --
44
* DomainException.php created at 02-12-2014
55
*
6-
* Copyright 2014 Estevão Soares dos Santos
6+
* Copyright 2014-2024 Estevão Soares dos Santos
77
*
88
* Licensed under the Apache License, Version 2.0 (the "License");
99
* you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
2525
* Exception thrown if a value does not adhere to a defined valid data domain.
2626
*
2727
* @package Tivie\HtaccessParser\Exception
28-
* @copyright 2014 Estevão Soares dos Santos
28+
* @copyright 2014-2024 Estêvão Soares dos Santos
2929
*/
3030
class DomainException extends Exception
3131
{

src/Exception/Exception.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* -- PHP Htaccess Parser --
44
* Exception.php created at 02-12-2014
55
*
6-
* Copyright 2014 Estevão Soares dos Santos
6+
* Copyright 2014-2024 Estevão Soares dos Santos
77
*
88
* Licensed under the Apache License, Version 2.0 (the "License");
99
* you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@
2727
* Note: This exception and all its children change the line and file in the backtrace log. If you
2828
*
2929
* @package Tivie\HtaccessParser\Exception
30-
* @copyright 2014 Estevão Soares dos Santos
30+
* @copyright 2014-2024 Estêvão Soares dos Santos
3131
*/
3232
class Exception extends \Exception
3333
{
@@ -51,7 +51,7 @@ public function __construct($message = null, $code = 0, \Exception $exception =
5151
parent::__construct($message, $code, $exception);
5252
}
5353

54-
private function changeLineAndFile()
54+
private function changeLineAndFile(): void
5555
{
5656
$trace = $this->getTrace();
5757
if (!isset($trace[0])) {
@@ -72,7 +72,7 @@ private function changeLineAndFile()
7272
*
7373
* @param bool $debugLibrary
7474
*/
75-
public static function debugLibrary($debugLibrary)
75+
public static function debugLibrary($debugLibrary): void
7676
{
7777
self::$debugLibrary = !!$debugLibrary;
7878
}

src/Exception/InvalidArgumentException.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* -- PHP Htaccess Parser --
44
* InvalidArgumentException.php created at 02-12-2014
55
*
6-
* Copyright 2014 Estevão Soares dos Santos
6+
* Copyright 2014-2024 Estevão Soares dos Santos
77
*
88
* Licensed under the Apache License, Version 2.0 (the "License");
99
* you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
2525
* Exception thrown if an argument is not of the expected type.
2626
*
2727
* @package Tivie\HtaccessParser\Exception
28-
* @copyright 2014 Estevão Soares dos Santos
28+
* @copyright 2014-2024 Estêvão Soares dos Santos
2929
*/
3030
class InvalidArgumentException extends Exception
3131
{

src/Exception/SyntaxException.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* -- PHP Htaccess Parser --
44
* SyntaxException.php created at 02-12-2014
55
*
6-
* Copyright 2014 Estevão Soares dos Santos
6+
* Copyright 2014-2024 Estevão Soares dos Santos
77
*
88
* Licensed under the Apache License, Version 2.0 (the "License");
99
* you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
2525
* An exception thrown if there's a syntax error in .htaccess
2626
*
2727
* @package Tivie\HtaccessParser\Exception
28-
* @copyright 2014 Estevão Soares dos Santos
28+
* @copyright 2014-2024 Estêvão Soares dos Santos
2929
*/
3030
class SyntaxException extends Exception
3131
{

0 commit comments

Comments
 (0)