Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Conversation

@marcimat
Copy link
Contributor

Correct also some warnings in PHP 8+ and PHP 8.2

@marcimat marcimat force-pushed the update_php_requirements branch from d5dcd63 to c25d2ae Compare February 15, 2023 15:13
Config:
```php
$ecsConfig->sets([SetList::PSR_12, SetList::SYMPLIFY, SetList::COMMON, SetList::CLEAN_CODE]);
$ecsConfig->rule(NoExtraBlankLinesFixer::class);
$ecsConfig->indentation('tab');
$ecsConfig->paths(['AdaptiveImages.php']);
```
@marcimat marcimat force-pushed the update_php_requirements branch from c25d2ae to 4008746 Compare February 15, 2023 15:44
@marcimat
Copy link
Contributor Author

Au final j’ai appliqué un coup de ECS, même si certaines règles s’éloignent un peu de ce qui est fait chez SPIP.

<?php

// ecs.php
use PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer;
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer;
use PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\AssignmentInConditionSniff;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return static function (ECSConfig $ecsConfig): void {
    $ecsConfig->sets([
        SetList::PSR_12, 
        SetList::SYMPLIFY, 
        SetList::COMMON, 
        SetList::CLEAN_CODE
    ]);
    $ecsConfig->skip([
        DeclareStrictTypesFixer::class, 
        AssignmentInConditionSniff::class,
        DeclareStrictTypesFixer::class,
        GeneralPhpdocAnnotationRemoveFixer::class,
    ]);
    $ecsConfig->indentation('tab');
    $ecsConfig->paths(['AdaptiveImages.php']);
};

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants