Skip to content

Commit

Permalink
[TASK] Update phpstan to 1.2 and rector to 0.12.6
Browse files Browse the repository at this point in the history
  • Loading branch information
brotkrueml committed Dec 9, 2021
1 parent 92ed0ab commit 187c30a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -53,6 +53,7 @@ jobs:
restore-keys: ${{ runner.os }}-composer-
- name: Install composer dependencies
run: |
composer remove symplify/phpstan-rules --dev --no-update
composer require typo3/cms-core=${{ matrix.typo3-versions }} --no-progress --prefer-dist --optimize-autoloader
- name: Run PHP linter
run: |
Expand All @@ -71,7 +72,7 @@ jobs:
- name: Setup PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.0
coverage: xdebug
extensions: mbstring
- name: Get Composer Cache Directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yaml.yml
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup PHP version
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.0
extensions: mbstring
- name: Get Composer Cache Directory
id: composer-cache
Expand Down
Expand Up @@ -14,6 +14,7 @@
use Brotkrueml\JobRouterBase\Enumeration\FieldTypeEnumeration;
use Brotkrueml\JobRouterBase\Event\ResolveFinisherVariableEvent;
use Brotkrueml\JobRouterBase\Exception\VariableResolverException;
use TYPO3\CMS\Core\Site\Entity\SiteLanguage;

/**
* @internal
Expand Down Expand Up @@ -55,8 +56,9 @@ public function __invoke(ResolveFinisherVariableEvent $event): void

$this->checkValidFieldTypes($event);

$language = $event->getRequest()->getAttribute('language', null);
$languageIsoCode = $language ? $language->getTwoLetterIsoCode() : '';
/** @var SiteLanguage|null $language */
$language = $event->getRequest()->getAttribute('language');
$languageIsoCode = $language !== null ? $language->getTwoLetterIsoCode() : '';
$jobRouterLanguage = self::LANGUAGE_MAPPINGS[$languageIsoCode] ?? '';
$value = \str_replace(self::VARIABLE_TO_RESOLVE, $jobRouterLanguage, $value);

Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/VariableResolvers/VariableResolver.php
Expand Up @@ -51,7 +51,7 @@ public function setCorrelationId(string $correlationId): void
}

/**
* @param mixed[] $formValues
* @param array<string, string> $formValues
*/
public function setFormValues(array $formValues): void
{
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Expand Up @@ -30,11 +30,11 @@
"ergebnis/composer-normalize": "^2.18",
"php-coveralls/php-coveralls": "^2.4",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^0.12.99",
"phpstan/phpstan": "^1.2",
"phpunit/phpunit": "^9.5",
"rector/rector": "^0.11.58",
"rector/rector": "^0.12.6",
"symfony/yaml": "^4.4 || ^5.4 || ^6.0",
"symplify/phpstan-rules": "^9.3",
"symplify/phpstan-rules": "^10.0",
"typo3/cms-dashboard": "^10.4.11 || ^11.5.3",
"typo3/cms-extbase": "^10.4.11 || ^11.5.3",
"typo3/cms-form": "^10.4.11 || ^11.5.3"
Expand Down
4 changes: 2 additions & 2 deletions phpstan.neon
Expand Up @@ -5,8 +5,8 @@ includes:
- .Build/vendor/symplify/phpstan-rules/config/size-rules.neon

parameters:
phpVersion: 70400
level: 8
phpVersion: 80000
level: 9
paths:
- Classes

Expand Down
17 changes: 8 additions & 9 deletions rector.php
Expand Up @@ -5,32 +5,31 @@
use Rector\Core\Configuration\Option;
use Rector\Core\ValueObject\PhpVersion;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\TypeDeclaration\Rector\ClassMethod\AddArrayParamDocTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddArrayReturnDocTypeRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import(LevelSetList::UP_TO_PHP_73);
$containerConfigurator->import(SetList::CODE_QUALITY);
$containerConfigurator->import(SetList::DEAD_CODE);
$containerConfigurator->import(SetList::EARLY_RETURN);
$containerConfigurator->import(SetList::PHP_52);
$containerConfigurator->import(SetList::PHP_53);
$containerConfigurator->import(SetList::PHP_54);
$containerConfigurator->import(SetList::PHP_55);
$containerConfigurator->import(SetList::PHP_56);
$containerConfigurator->import(SetList::PHP_70);
$containerConfigurator->import(SetList::PHP_71);
$containerConfigurator->import(SetList::PHP_72);
$containerConfigurator->import(SetList::PHP_73);
$containerConfigurator->import(SetList::TYPE_DECLARATION);
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_CODE_QUALITY);
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_EXCEPTION);
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_MOCK);
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD);
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_YIELD_DATA_PROVIDER);

$services = $containerConfigurator->services();

$services->set(StringClassNameToClassConstantRector::class)
->configure(['']);

$parameters = $containerConfigurator->parameters();

$parameters->set(Option::PATHS, [
Expand Down

0 comments on commit 187c30a

Please sign in to comment.