Je suppose que ce sont les autorisations qui chargent include_spip("presta/$mode/config");
qui fait que ça passe avant
presta/cmcic/inc/cmcic.php.
Est-ce que simplement supprimer la déclaration de cette constante dans config.php convient ?
presta/cmcic/inc/cmcic.php Line 138 : Constant _MONETICOPAIEMENT_VERSION already defined
Effectivement, c’est ausis défini dans presta/cmcic/config.php
Hi
Some deprecated are shown when unserializing a DateTimeImmutable object, like :
Creation of dynamic property DateTimeImmutable::$date is deprecated (in JsonSerializer.php on line 463)
I think this could be treated like DateTime object, on unserializeObject()
method like
if ($className === 'DateTime' || $className === 'DateTimeImmutable') {
$obj = $this->restoreUsingUnserialize($className, $value);
$this->objectMapping[$this->objectMappingIndex++] = $obj;
return $obj;
}
Hope it helps :)
Hi,
Both Enum types can’t be deserialized and create a fatal error : Fatal error: Uncaught Error: Cannot instantiate enum ...
I think they could be both managed into unserializeObject
method by adding :
if (is_subclass_of($className, \BackedEnum::class) || is_subclass_of($className, \UnitEnum::class)) {
return constant("$className::{$value['name']}");
}
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']);
};
chore(cs-fix): Passe de ECS
Config:
$ecsConfig->sets([SetList::PSR_12, SetList::SYMPLIFY, SetList::COMMON, SetList::CLEAN_CODE]);
$ecsConfig->rule(NoExtraBlankLinesFixer::class);
$ecsConfig->indentation('tab');
$ecsConfig->paths(['AdaptiveImages.php']);
fix: Use native php function (not old SPIP function)
chore(cs-fix): Passe de ECS
Config:
$ecsConfig->sets([SetList::PSR_12, SetList::SYMPLIFY, SetList::COMMON, SetList::CLEAN_CODE]);
$ecsConfig->rule(NoExtraBlankLinesFixer::class);
$ecsConfig->indentation('tab');
$ecsConfig->paths(['AdaptiveImages.php']);
fix: Use native php function (not old SPIP function)
Correct also some warnings in PHP 8+ and PHP 8.2