Skip to content

Commit

Permalink
Update dev tools (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos committed Feb 24, 2024
1 parent 29fc063 commit 19b32c4
Show file tree
Hide file tree
Showing 8 changed files with 528 additions and 611 deletions.
24 changes: 11 additions & 13 deletions .dev-tools/composer.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
{
"type": "project",
"require": {
"composer/composer": "^2.5.5",
"ergebnis/composer-normalize": "^2.30.2",
"composer/composer": "^2.7.1",
"ergebnis/composer-normalize": "^2.42.0",
"kubawerlos/composer-smaller-lock": "^1.0.1",
"kubawerlos/php-cs-fixer-config": "^3.15",
"kubawerlos/types-checker": "^2.2",
"maglnet/composer-require-checker": "^4.5",
"kubawerlos/php-cs-fixer-config": "^3.26",
"maglnet/composer-require-checker": "^4.8",
"mi-schi/phpmd-extension": "^4.3",
"phpmd/phpmd": "^2.13",
"phpstan/extension-installer": "^1.2",
"phpstan/phpstan": "^1.10.10",
"phpstan/phpstan-phpunit": "^1.3.11",
"phpstan/phpstan-strict-rules": "^1.5.1",
"squizlabs/php_codesniffer": "^3.7.2",
"vimeo/psalm": "^5.9"
"phpmd/phpmd": "^2.15",
"phpstan/extension-installer": "^1.3.1",
"phpstan/phpstan": "^1.10.59",
"phpstan/phpstan-phpunit": "^1.3.16",
"phpstan/phpstan-strict-rules": "^1.5.2",
"squizlabs/php_codesniffer": "^3.9.0",
"vimeo/psalm": "^5.22.2"
},
"config": {
"allow-plugins": {
Expand All @@ -33,7 +32,6 @@
"composer-require-checker --config-file=composer-require-checker.json check ../composer.json",
"phpcs",
"php-cs-fixer fix --ansi --diff --dry-run --verbose",
"types-checker --autoloader=../vendor/autoload.php ../src ../tests",
"phpmd ../src text phpmd.xml",
"phpstan analyse --no-progress",
"psalm --no-progress --shepherd"
Expand Down
632 changes: 290 additions & 342 deletions .dev-tools/composer.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .dev-tools/generate_readme.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env php
<?php
<?php declare(strict_types=1);

/*
* This file is part of composer-smaller-lock.
Expand All @@ -16,7 +16,7 @@
$originalComposerLockContent = file_get_contents($composerLockPath);
$originalNumberOfLines = substr_count($originalComposerLockContent, "\n") + 1;

$eventProvider = new class () extends \PHPUnit\Framework\TestCase {
$eventProvider = new class () extends PHPUnit\Framework\TestCase {
public function getEvent()
{
$configSource = $this->createMock(Composer\Config\ConfigSourceInterface::class);
Expand Down
2 changes: 2 additions & 0 deletions .dev-tools/phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<exclude name='Generic.Files.LineLength' />
<exclude name='PSR12.Files.FileHeader.SpacingAfterBlock' />
<exclude name='PSR12.Files.OpenTag.NotAlone' />
<exclude name='Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine' />
<exclude name='Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore' />
</rule>

</ruleset>
1 change: 1 addition & 0 deletions .dev-tools/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parameters:
level: max
paths:
- ../src
treatPhpDocTypesAsCertain: false

includes:
- ./vendor/phpstan/phpstan/conf/bleedingEdge.neon
1 change: 0 additions & 1 deletion .dev-tools/psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
xmlns='https://getpsalm.org/schema/config'
xsi:schemaLocation='https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd'
allowStringToStandInForClass='true'
autoloader='../vendor/autoload.php'
errorLevel='1'
findUnusedCode='true'
findUnusedVariablesAndParams='true'
Expand Down
457 changes: 216 additions & 241 deletions README.md

Large diffs are not rendered by default.

18 changes: 6 additions & 12 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,11 @@ final class Plugin implements EventSubscriberInterface, PluginInterface
'version',
];

public function activate(Composer $composer, IOInterface $io): void
{
}
public function activate(Composer $composer, IOInterface $io): void {}

public function deactivate(Composer $composer, IOInterface $io): void
{
}
public function deactivate(Composer $composer, IOInterface $io): void {}

public function uninstall(Composer $composer, IOInterface $io): void
{
}
public function uninstall(Composer $composer, IOInterface $io): void {}

public static function getSubscribedEvents(): array
{
Expand All @@ -65,7 +59,7 @@ public static function clean(Event $event): void
$composerLockContent = \file_get_contents($composerLockPath);
\assert(\is_string($composerLockContent));

/** @var array<string, array<string, array<array<string>>>> $composerLockData */
/** @var array<string, array<string, array<string, array<string, string>>>> $composerLockData */
$composerLockData = \json_decode($composerLockContent, true);

foreach (['packages', 'packages-dev'] as $section) {
Expand All @@ -78,9 +72,9 @@ public static function clean(Event $event): void
}

/**
* @param array<array<string>> $data
* @param array<string, array<string, string>> $data
*
* @return array<array<string>>
* @return array<string, array<string, string>>
*/
private static function cleanPackage(array $data): array
{
Expand Down

0 comments on commit 19b32c4

Please sign in to comment.