Skip to content

Commit

Permalink
Merge pull request #441 from mimmi20/updates
Browse files Browse the repository at this point in the history
upgrade to PHP 8.3
  • Loading branch information
mimmi20 authored Dec 4, 2024
2 parents 39bcbca + 10986d2 commit 07efe05
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 58 deletions.
12 changes: 6 additions & 6 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
version: "2"
checks:
argument-count:
enabled: true
enabled: false
complex-logic:
enabled: true
enabled: false
file-lines:
enabled: false
method-complexity:
enabled: true
enabled: false
method-count:
enabled: true
enabled: false
method-lines:
enabled: true
enabled: false
nested-control-flow:
enabled: true
return-statements:
enabled: true
enabled: false
similar-code:
enabled: false
identical-code:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
validate:
name: "Validate Project"

uses: "mimmi20/ci/.github/workflows/validate.yml@8.1"
uses: "mimmi20/ci/.github/workflows/validate.yml@8.3"
with:
extensions: "ctype, curl, dom, iconv, intl, mbstring, simplexml, tokenizer, xml, xmlwriter"
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
Expand All @@ -37,7 +37,7 @@ jobs:

needs: "validate"

uses: "mimmi20/ci/.github/workflows/install.yml@8.1"
uses: "mimmi20/ci/.github/workflows/install.yml@8.3"
with:
extensions: "ctype, curl, dom, iconv, intl, mbstring, simplexml, tokenizer, xml, xmlwriter"
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
Expand All @@ -50,7 +50,7 @@ jobs:

needs: "install"

uses: "mimmi20/ci/.github/workflows/analytics.yml@8.1"
uses: "mimmi20/ci/.github/workflows/analytics.yml@8.3"
with:
extensions: "ctype, curl, dom, iconv, intl, mbstring, simplexml, tokenizer, xml, xmlwriter"
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
Expand All @@ -59,7 +59,7 @@ jobs:
skip-phpcs: false
skip-phpstan: false
skip-rector: false
skip-phpmd: false
skip-phpmd: true
skip-eslint: true
skip-stylelint: true
skip-prettier: true
Expand All @@ -70,7 +70,7 @@ jobs:

needs: "analytics"

uses: "mimmi20/ci/.github/workflows/test.yml@8.1"
uses: "mimmi20/ci/.github/workflows/test.yml@8.3"
with:
extensions: "ctype, dom, fileinfo, intl, simplexml, tokenizer, xml, xmlwriter"
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
Expand Down
6 changes: 4 additions & 2 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

declare(strict_types = 1);

$header = <<<'EOF'
$year = date('Y');

$header = <<<EOF
This file is part of the mimmi20/laminas-router-hostname package.
Copyright (c) 2021-2024, Thomas Mueller <[email protected]>
Copyright (c) 2021-{$year}, Thomas Mueller <[email protected]>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
Expand Down
13 changes: 13 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ codecov:
notify:
wait_for_ci: false

coverage:
status:
project:
default: # default is the status check's name, not default settings
target: 100%
threshold: 1%
if_ci_failed: success #success, failure, error, ignore
informational: true
only_pulls: false
patch:
default:
informational: true

comment:
layout: "reach, diff, flags, files"
behavior: default
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"source": "https://github.com/mimmi20/laminas-router-hostname"
},
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"php": "~8.3.0 || ~8.4.0 || ~8.5.0",
"ext-mbstring": "*",
"laminas/laminas-router": "^3.14.0",
"laminas/laminas-stdlib": "^3.20.0",
Expand All @@ -31,19 +31,19 @@
"ext-xml": "*",
"ext-xmlwriter": "*",
"infection/infection": "^0.29.8",
"laminas/laminas-http": "^2.20.0",
"laminas/laminas-http": "^2.21.0",
"laminas/laminas-modulemanager": "^2.17.0",
"laminas/laminas-servicemanager": "^3.22.1",
"mimmi20/coding-standard": "^5.2.45",
"mimmi20/coding-standard": "^6.0.0",
"nikic/php-parser": "^5.3.1",
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan": "^1.12.9",
"phpstan/phpstan-deprecation-rules": "^1.2.1",
"phpstan/phpstan-phpunit": "^1.4.0",
"phpunit/phpunit": "^10.5.27",
"phpunit/phpunit": "^11.4.4",
"rector/rector": "^1.2.10",
"rector/type-perfect": "^1.0.0",
"symfony/process": "^6.4.15",
"symfony/process": "^7.2.0",
"symplify/phpstan-rules": "^13.0.1",
"tomasvotruba/cognitive-complexity": "^0.2.3",
"tomasvotruba/type-coverage": "^1.0.0",
Expand Down
36 changes: 0 additions & 36 deletions phpmd.ruleset.xml

This file was deleted.

4 changes: 2 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parameters:
level: max

phpVersion: 80100 # PHP 8.1
phpVersion: 80300 # PHP 8.3

parallel:
maximumNumberOfProcesses: 1
Expand Down Expand Up @@ -104,7 +104,7 @@ parameters:
return_type: 100
param_type: 77.7
property_type: 100
constant_type: 0
constant_type: 100
# also, how many files has declare strict types
declare: 100

Expand Down
4 changes: 3 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
beStrictAboutCoverageMetadata="false"
beStrictAboutOutputDuringTests="true"
beStrictAboutTestsThatDoNotTestAnything="true"
displayDetailsOnPhpunitDeprecations="true"
displayDetailsOnTestsThatTriggerWarnings="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnSkippedTests="true"
displayDetailsOnIncompleteTests="true"
failOnPhpunitDeprecation="true"
failOnEmptyTestSuite="true"
failOnIncomplete="true"
failOnRisky="true"
Expand Down Expand Up @@ -51,7 +53,7 @@
</testsuite>
</testsuites>

<coverage includeUncoveredFiles="true">
<coverage>
<report>
<clover outputFile=".reports/clover.xml"/>
<html outputDirectory=".reports/report/" lowUpperBound="50" highLowerBound="80"/>
Expand Down
2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

$rectorConfig->sets([
SetList::DEAD_CODE,
LevelSetList::UP_TO_PHP_81,
LevelSetList::UP_TO_PHP_83,
PHPUnitSetList::PHPUNIT_100,
]);

Expand Down
3 changes: 3 additions & 0 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use Laminas\ModuleManager\Feature\ConfigProviderInterface;
use Laminas\ModuleManager\Feature\DependencyIndicatorInterface;
use Override;

final class Module implements ConfigProviderInterface, DependencyIndicatorInterface
{
Expand All @@ -24,6 +25,7 @@ final class Module implements ConfigProviderInterface, DependencyIndicatorInterf
*
* @throws void
*/
#[Override]
public function getConfig(): array
{
$provider = new ConfigProvider();
Expand All @@ -41,6 +43,7 @@ public function getConfig(): array
*
* @throws void
*/
#[Override]
public function getModuleDependencies(): array
{
return ['Laminas\Router'];
Expand Down
5 changes: 5 additions & 0 deletions src/Router/HostName.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Laminas\Stdlib\RequestInterface as Request;
use Laminas\Uri\Exception\InvalidUriPartException;
use Laminas\Uri\Http;
use Override;
use Traversable;

use function array_key_exists;
Expand Down Expand Up @@ -76,6 +77,7 @@ public function __construct(private readonly array $hosts = [], private readonly
*
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
*/
#[Override]
public static function factory($options = []): self
{
if ($options instanceof Traversable) {
Expand Down Expand Up @@ -125,6 +127,7 @@ public static function factory($options = []): self
*
* @throws void
*/
#[Override]
public function match(Request $request): RouteMatch | null
{
if (!method_exists($request, 'getUri')) {
Expand Down Expand Up @@ -162,6 +165,7 @@ public function match(Request $request): RouteMatch | null
*
* @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
*/
#[Override]
public function assemble(array $params = [], array $options = []): string
{
$this->assembledParams = [];
Expand Down Expand Up @@ -215,6 +219,7 @@ public function assemble(array $params = [], array $options = []): string
*
* @throws void
*/
#[Override]
public function getAssembledParams(): array
{
return $this->assembledParams;
Expand Down
2 changes: 2 additions & 0 deletions src/Router/HostNameFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Laminas\Router\Exception\InvalidArgumentException;
use Laminas\ServiceManager\Exception\ServiceNotCreatedException;
use Laminas\ServiceManager\Factory\FactoryInterface;
use Override;
use Psr\Container\ContainerInterface;

use function is_array;
Expand All @@ -32,6 +33,7 @@ final class HostNameFactory implements FactoryInterface
* @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
*/
#[Override]
public function __invoke(ContainerInterface $container, $requestedName, array | null $options = null): HostName
{
if (!is_array($options)) {
Expand Down
2 changes: 2 additions & 0 deletions tests/Router/HostNameFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Laminas\ServiceManager\Exception\ServiceNotCreatedException;
use Mimmi20\Routing\Router\HostName;
use Mimmi20\Routing\Router\HostNameFactory;
use Override;
use PHPUnit\Framework\Exception;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerInterface;
Expand All @@ -27,6 +28,7 @@ final class HostNameFactoryTest extends TestCase
private HostNameFactory $object;

/** @throws void */
#[Override]
protected function setUp(): void
{
$this->object = new HostNameFactory();
Expand Down

0 comments on commit 07efe05

Please sign in to comment.