Closed arzola closed 2 years ago
The complaint is from a file in Pressbooks, not this plugin.
https://github.com/pressbooks/pressbooks/blob/dev/symbionts/custom-metadata/custom_metadata.php#L772
It doesn't like the order of params
function is_registered_field( $field_slug, $group_slug = '', $object_type ) {
Optional params ($group_slug = ''
) must come last.
The fix is probably removing the = ''
part. Cursory glance I don't see how is_registered_field
can work with less than all 3 params.
I didn't know that PHP 8 wasn't supported in Pressbooks.
There is another error with PHP 8 compatibility. The import of documents often (but not always) has an event stream error with the progress slidebar.
I upgraded a legacy projet with Rector recently. (because my wife's blog still runs on one of my old projects):
This was the config I used:
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/sux0r2',
]);
// Directories to skip, rules I don't agree with...
$rectorConfig->skip([
__DIR__ . '/sux0r2/includes/symbionts',
__DIR__ . '/sux0r2/data',
__DIR__ . '/sux0r2/temporary',
\Rector\Php80\Rector\FunctionLike\UnionTypesRector::class,
\Rector\Php81\Rector\FunctionLike\IntersectionTypesRector::class,
\Rector\RemovingStatic\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector::class,
\Rector\Transform\Rector\StaticCall\StaticCallToNewRector::class,
]);
// define sets of rules
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_81
]);
};
More info about Rector: https://getrector.org/
Four errors in current CI tests matrix when running against PHP8:
Example: