Skip to content

Commit

Permalink
chore!: Bump PHP version to 8.1
Browse files Browse the repository at this point in the history
- Update dependencies to PHP 8.1
- Increase phpstan level to 9
- Update infection configuration, upload HTML report to Stryker

BREAKING CHANGE: Minimum required PHP version is 8.1
  • Loading branch information
MontealegreLuis committed Apr 26, 2022
1 parent 1416ae2 commit b654bd9
Show file tree
Hide file tree
Showing 234 changed files with 618 additions and 556 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ box.phar
phuml.phar
phuml.phar.pubkey
phuml.phar.version
infection.html
infection.log
4 changes: 2 additions & 2 deletions .php-cs-fixer-tests.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand Down Expand Up @@ -38,7 +38,7 @@
'blank_line_after_opening_tag' => false,
'declare_strict_types' => true,
'header_comment' => [
'header' => 'PHP version 8.0
'header' => 'PHP version 8.1
This source file is subject to the license that is bundled with this package in the file LICENSE.',
'comment_type' => 'PHPDoc',
Expand Down
4 changes: 2 additions & 2 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand Down Expand Up @@ -36,7 +36,7 @@
'blank_line_after_opening_tag' => false,
'declare_strict_types' => true,
'header_comment' => [
'header' => 'PHP version 8.0
'header' => 'PHP version 8.1
This source file is subject to the license that is bundled with this package in the file LICENSE.',
'comment_type' => 'PHPDoc',
Expand Down
88 changes: 44 additions & 44 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,55 @@
{
"name": "phuml/phuml",
"type": "library",
"description": "phUML is a fully automatic UML class diagram generator for PHP code",
"license": "BSD-3-Clause",
"type": "library",
"keywords": [
"uml"
],
"homepage": "https://github.com/MontealegreLuis/phuml",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Luis Montealegre",
"email": "montealegreluis@gmail.com",
"role": "Developer"
}
],
"homepage": "https://github.com/MontealegreLuis/phuml",
"support": {
"issues": "https://github.com/MontealegreLuis/phuml/issues",
"docs": "https://montealegreluis.com/phuml/"
},
"require": {
"php": "^8.0",
"php": "^8.1",
"ext-tokenizer": "*",
"league/pipeline": "^1.0.0",
"nikic/php-parser": "4.11.0",
"phpdocumentor/reflection-docblock": "^5.2",
"phpdocumentor/type-resolver": "^1.4",
"symfony/console": "^5.3.2",
"symfony/finder": "^5.3.0",
"symfony/process": "^5.3.2",
"symplify/smart-file-system": "^9.4.22",
"twig/twig": "^3.3.2",
"webmozart/assert": "^1.10.0"
"league/pipeline": "~1.0.0",
"nikic/php-parser": "~4.13.2",
"phpdocumentor/reflection-docblock": "~5.3.0",
"phpdocumentor/type-resolver": "~1.6.1",
"symfony/console": "~6.0.7",
"symfony/finder": "~6.0.3",
"symfony/process": "~6.0.7",
"symplify/smart-file-system": "~10.2.2",
"twig/twig": "~3.3.10",
"webmozart/assert": "~1.10.0"
},
"require-dev": {
"ext-imagick": "*",
"ergebnis/composer-normalize": "^2.15.0",
"friendsofphp/php-cs-fixer": "3.0.2",
"infection/infection": "^0.23.0",
"lupka/phpunit-compare-images": "^1.0.0",
"maglnet/composer-require-checker": "^3.3.0",
"phpro/grumphp": "^1.4.0",
"phpspec/prophecy-phpunit": "^2.0.1",
"phpstan/extension-installer": "^1.1.0",
"phpstan/phpstan": "^0.12.94",
"phpstan/phpstan-strict-rules": "^0.12.10",
"phpstan/phpstan-webmozart-assert": "^0.12.15",
"phpunit/phpunit": "^9.5.6",
"pyrech/composer-changelogs": "^1.7.1",
"rector/rector": "0.11.47"
},
"config": {
"optimize-autoloader": true,
"platform": {
"php": "8.0.8"
},
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-master": "6.0-dev"
}
"ergebnis/composer-normalize": "~2.25.2",
"friendsofphp/php-cs-fixer": "~3.8.0",
"infection/infection": "~0.26.8",
"lupka/phpunit-compare-images": "~1.0.0",
"maglnet/composer-require-checker": "~4.0.0",
"phpro/grumphp": "~1.11.0",
"phpspec/prophecy-phpunit": "~2.0.1",
"phpstan/extension-installer": "~1.1.0",
"phpstan/phpstan": "~1.5.7",
"phpstan/phpstan-strict-rules": "~1.1.0",
"phpstan/phpstan-webmozart-assert": "~1.1.2",
"phpunit/phpunit": "~9.5.20",
"pyrech/composer-changelogs": "~1.8.1",
"rector/rector": "~0.12.21"
},
"prefer-stable": true,
"autoload": {
"psr-4": {
"PhUml\\": "src"
Expand All @@ -71,12 +64,19 @@
]
}
},
"prefer-stable": true,
"bin": [
"bin/phuml"
],
"support": {
"issues": "https://github.com/MontealegreLuis/phuml/issues",
"docs": "https://montealegreluis.com/phuml/"
"config": {
"optimize-autoloader": true,
"platform": {
"php": "8.1.1"
},
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-master": "6.0-dev"
}
}
}
2 changes: 1 addition & 1 deletion containers/tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.0.8-cli-alpine3.13
FROM php:8.1.1-cli-alpine3.15

RUN apk add --update --no-cache autoconf g++ pkgconfig imagemagick imagemagick-dev make ttf-freefont graphviz \
&& printf "\n" | pecl install imagick \
Expand Down
5 changes: 3 additions & 2 deletions infection.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
},
"logs": {
"text": "infection.log",
"badge": {
"branch": "master"
"html": "infection.html",
"stryker": {
"report": "master"
}
},
"mutators": {
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
level: 8
level: 9
paths:
- src
inferPrivatePropertyTypeFromConstructor: true
Expand Down
4 changes: 2 additions & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
$containerConfigurator->import(SetList::CODE_QUALITY);
$containerConfigurator->import(SetList::PRIVATIZATION);
$containerConfigurator->import(SetList::EARLY_RETURN);
$containerConfigurator->import(SetList::PHP_80);
$containerConfigurator->import(SetList::PHP_81);
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_91);
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_CODE_QUALITY);
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_EXCEPTION);
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD);

$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_80);
$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_81);

// Path to PHPStan with extensions, that PHPStan in Rector uses to determine types
$parameters->set(Option::PHPSTAN_FOR_RECTOR_PATH, getcwd() . '/phpstan.neon');
Expand Down
2 changes: 1 addition & 1 deletion src/Code/Attributes/Attribute.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Code/Attributes/Constant.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand All @@ -21,7 +21,7 @@ final class Constant implements HasType, HasVisibility, Stringable
use WithTypeDeclaration;
use WithVisibility;

public function __construct(private string $name, TypeDeclaration $type, Visibility $visibility)
public function __construct(private readonly string $name, TypeDeclaration $type, Visibility $visibility)
{
$this->type = $type;
$this->modifier = $visibility;
Expand Down
2 changes: 1 addition & 1 deletion src/Code/Attributes/HasAttributes.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Code/Attributes/HasConstants.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Code/Attributes/WithAttributes.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Code/Attributes/WithConstants.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Code/ClassDefinition.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand Down Expand Up @@ -29,7 +29,7 @@ final class ClassDefinition extends Definition implements HasAttributes, HasCons
use WithTraits;

/** @var Name[] */
private array $interfaces;
private readonly array $interfaces;

/**
* @param Method[] $methods
Expand Down
2 changes: 1 addition & 1 deletion src/Code/Codebase.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Code/Definition.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Code/InterfaceDefinition.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand All @@ -20,7 +20,7 @@ final class InterfaceDefinition extends Definition implements HasConstants
use WithConstants;

/** @var Name[] */
private array $parents;
private readonly array $parents;

/**
* @param Method[] $methods
Expand Down
12 changes: 4 additions & 8 deletions src/Code/Methods/Method.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand All @@ -27,20 +27,16 @@ final class Method implements HasVisibility, CanBeAbstract, CanBeStatic, Stringa
use WithAbstractModifier;
use WithStaticModifier;

/** @var Parameter[] */
private array $parameters;

/** @param Parameter[] $parameters */
public function __construct(
private string $name,
private readonly string $name,
Visibility $modifier,
private TypeDeclaration $returnType,
array $parameters = [],
private readonly TypeDeclaration $returnType,
private readonly array $parameters = [],
bool $isAbstract = false,
bool $isStatic = false
) {
$this->modifier = $modifier;
$this->parameters = $parameters;
$this->isAbstract = $isAbstract;
$this->isStatic = $isStatic;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Code/Modifiers/CanBeAbstract.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Code/Modifiers/CanBeStatic.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Code/Modifiers/HasVisibility.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Code/Modifiers/Visibility.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand All @@ -22,7 +22,7 @@ final class Visibility implements Stringable
'protected' => '#',
];

private string $modifier;
private readonly string $modifier;

public function __construct(string $modifier)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Code/Modifiers/WithAbstractModifier.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Code/Modifiers/WithStaticModifier.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);
/**
* PHP version 8.0
* PHP version 8.1
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand Down
Loading

0 comments on commit b654bd9

Please sign in to comment.