Skip to content

[4.2] [Rector] Apply PHP 7.4 Requirement and syntax#5462

Merged
samsonasik merged 11 commits intocodeigniter4:v4.2from
samsonasik:php74-typed
Dec 14, 2021
Merged

[4.2] [Rector] Apply PHP 7.4 Requirement and syntax#5462
samsonasik merged 11 commits intocodeigniter4:v4.2from
samsonasik:php74-typed

Conversation

@samsonasik
Copy link
Copy Markdown
Member

@samsonasik samsonasik commented Dec 13, 2021

Description

@MGatner here the update to php 7.4:

  • Upgrade to php 7.4 as minimum requirement.
  • Update syntax with Rector

TODO:

  • Fix PHPStan notice
  • Apply Workflow run

Checklist:

  • Securely signed commits

@samsonasik samsonasik changed the base branch from develop to v4.2 December 13, 2021 15:09
@samsonasik samsonasik changed the title [Rector] Apply PHP 7.4 Requirement and syntax [4.2] [Rector] Apply PHP 7.4 Requirement and syntax Dec 13, 2021
@MGatner
Copy link
Copy Markdown
Member

MGatner commented Dec 13, 2021

Looking good!

@samsonasik
Copy link
Copy Markdown
Member Author

samsonasik commented Dec 14, 2021

Temporary run rector workflow on php 8.0 only due to error Call to undefined method ReflectionProperty::getDefaultValue(), fix is coming to rector rectorphp/rector-src#1482

@samsonasik
Copy link
Copy Markdown
Member Author

I temporary ignore phpstan notice on syntax $var ??= $value 71037ba

return str_replace($match['key'], bin2hex($match['key']), $match[0]);
}, urldecode($chunk));
}, $query);
$params = array_map(static fn (string $chunk) => preg_replace_callback('/^(?<key>[^&=]+?)(?:\[[^&=]*\])?=(?<value>[^&=]+)/', static fn (array $match) => str_replace($match['key'], bin2hex($match['key']), $match[0]), urldecode($chunk)), $query);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you break this into many lines?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated dd95ae7

@kenjis
Copy link
Copy Markdown
Member

kenjis commented Dec 14, 2021

Looks good!

@samsonasik
Copy link
Copy Markdown
Member Author

I am merging it ;). Thanks @paulbalandan @kenjis @MGatner for the review.

$services->set(SimplifyEmptyArrayCheckRector::class);
$services->set(TypedPropertyRector::class)
->configure([
TypedPropertyRector::PRIVATE_PROPERTY_ONLY => true,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private property only option will be removed in next rector release rectorphp/rector-src#1496, to have default change:

  • change private property
  • change protected property for final class.
  • don't update public property.

We can retry re-run when on next rector release.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants