Skip to content

Commit

Permalink
Merge pull request #45 from madewithlove/upgrades
Browse files Browse the repository at this point in the history
Upgrades
  • Loading branch information
jdrieghe authored Apr 20, 2023
2 parents af994c9 + cb55616 commit 0a0fe28
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 33 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"symfony/yaml": "^4.0 || ^5.0 || ^6.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"vimeo/psalm": "^4.4",
"psalm/plugin-phpunit": "^0.15.1",
"friendsofphp/php-cs-fixer": "^3.8"
"phpunit/phpunit": "^10.1",
"vimeo/psalm": "^5.9",
"psalm/plugin-phpunit": "^0.18",
"friendsofphp/php-cs-fixer": "^3.16"
},
"autoload": {
"psr-4": {
Expand Down
20 changes: 6 additions & 14 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/</directory>
</testsuite>
</testsuites>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
8 changes: 4 additions & 4 deletions src/Commands/CheckLicenses.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class CheckLicenses extends Command
protected static $defaultName = 'check';

public function __construct(
private UsedLicensesParser $usedLicensesParser,
private AllowedLicensesParser $allowedLicensesParser,
private DependencyTree $dependencyTree,
private TableRenderer $tableRenderer
private readonly UsedLicensesParser $usedLicensesParser,
private readonly AllowedLicensesParser $allowedLicensesParser,
private readonly DependencyTree $dependencyTree,
private readonly TableRenderer $tableRenderer
) {
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/CountUsedLicenses.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CountUsedLicenses extends Command
protected static $defaultName = 'count';

public function __construct(
private UsedLicensesParser $usedLicensesParser
private readonly UsedLicensesParser $usedLicensesParser
) {
parent::__construct();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/GenerateConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class GenerateConfig extends Command
protected static $defaultName = 'generate-config';

public function __construct(
private AllowedLicensesParser $allowedLicensesParser,
private UsedLicensesParser $usedLicensesParser
private readonly AllowedLicensesParser $allowedLicensesParser,
private readonly UsedLicensesParser $usedLicensesParser
) {
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/ListAllowedLicenses.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ListAllowedLicenses extends Command
protected static $defaultName = 'allowed';

public function __construct(
private AllowedLicensesParser $allowedLicensesParser
private readonly AllowedLicensesParser $allowedLicensesParser
) {
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/ListUsedLicenses.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ListUsedLicenses extends Command
protected static $defaultName = 'used';

public function __construct(
private UsedLicensesParser $usedLicensesParser
private readonly UsedLicensesParser $usedLicensesParser
) {
parent::__construct();
}
Expand Down
8 changes: 4 additions & 4 deletions src/Composer/DependencyTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
class DependencyTree
{
public function __construct(
private DependencyTreeRetriever $retriever,
private UsedLicensesParser $parser,
private readonly DependencyTreeRetriever $retriever,
private readonly UsedLicensesParser $parser,
) {
}

Expand All @@ -26,7 +26,7 @@ public function getDependencies(bool $noDev): array
$license = $this->parser->getLicenseForPackage($package['name'], $noDev) ?? '';
$dependency = new Dependency($package['name'], $license);
if (isset($package['requires'])) {
/** @psalm-suppress MixedArgumentTypeCoercion */
/** @psalm-suppress ArgumentTypeCoercion */
foreach ($this->getSubDependencies($package['requires']) as $subDependency) {
$dependency->addDependency($subDependency);
}
Expand All @@ -52,7 +52,7 @@ private function getSubDependencies(array $subTree): array
foreach ($subTree as $subTreeItem) {
$subDependencies[] = $subTreeItem['name'];
if (isset($subTreeItem['requires'])) {
/** @psalm-suppress MixedArgumentTypeCoercion */
/** @psalm-suppress ArgumentTypeCoercion */
$subDependencies = array_merge($subDependencies, $this->getSubDependencies($subTreeItem['requires']));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Composer/UsedLicensesParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class UsedLicensesParser
{
public function __construct(
private UsedLicensesRetriever $retriever
private readonly UsedLicensesRetriever $retriever
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/AllowedLicensesParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class AllowedLicensesParser
private const DEFAULT_CONFIG_FILE_NAME = '.allowed-licenses';

public function __construct(
private string $workingDirectory
private readonly string $workingDirectory
) {
}

Expand Down

0 comments on commit 0a0fe28

Please sign in to comment.