Skip to content

Use PHP 8.0 syntax and add CI automation to enforce it#5

Merged
namithj merged 11 commits into
fairpm:mainfrom
kasparsd:fix-8.0-syntax
May 16, 2026
Merged

Use PHP 8.0 syntax and add CI automation to enforce it#5
namithj merged 11 commits into
fairpm:mainfrom
kasparsd:fix-8.0-syntax

Conversation

@kasparsd
Copy link
Copy Markdown
Contributor

@kasparsd kasparsd commented May 15, 2026

Fixes #4.

mago and a few other dependencies require PHP 8.1 (as described in the issue).

To ensure consistency with the FAIR plugin requirements for PHP 8.0:

  • switch from mago to phpcs and phpstan.
  • use PSR-12 phpcs ruleset since that matches the existing mago ruleset.

Comment thread composer.lock Outdated
@kasparsd
Copy link
Copy Markdown
Contributor Author

The CI checks now pass (need to merge before they run in the context of this repo) https://github.com/kasparsd/did-manager-wordpress/actions/runs/25928537085

kasparsd added 4 commits May 16, 2026 09:37
Signed-off-by: Kaspars Dambis <hi@kaspars.net>
Signed-off-by: Kaspars Dambis <hi@kaspars.net>
Signed-off-by: Kaspars Dambis <hi@kaspars.net>
Signed-off-by: Kaspars Dambis <hi@kaspars.net>
Signed-off-by: Kaspars Dambis <hi@kaspars.net>
Comment thread composer.lock Outdated
@kasparsd kasparsd mentioned this pull request May 16, 2026
Make it pass `composer validate --strict`

Signed-off-by: Kaspars Dambis <hi@kaspars.net>
Comment thread composer.json
"afragen/wordpress-plugin-readme-parser": "^1.2025.12",
"erusev/parsedown": "^1.7",
"fairpm/did-manager": ">=0.0.5"
"fairpm/did-manager": "^0.0.5"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Make it pass composer validate --strict without require.fairpm/did-manager : unbound version constraints (>=0.0.5) should be avoided.

kasparsd added 5 commits May 16, 2026 19:38
Signed-off-by: Kaspars Dambis <hi@kaspars.net>
Signed-off-by: Kaspars Dambis <hi@kaspars.net>
Signed-off-by: Kaspars Dambis <hi@kaspars.net>
Signed-off-by: Kaspars Dambis <hi@kaspars.net>
Signed-off-by: Kaspars Dambis <hi@kaspars.net>
@namithj namithj merged commit a3abe8d into fairpm:main May 16, 2026
1 check passed
*/
private function contains_markdown(string $content): bool
{
$pattern = '/(\*\*[^*]+\*\*|__[^_]+__|`[^`]+`|'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Splitting this up to not exceed the max line length.

}

return $this->parser->warnings ?? [];
return $this->parser->warnings;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reported by phpstan that these are not nullable so ?? doesn't make sense.

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.

Using PHP 8.3 syntax while declaring PHP 8.0 support

2 participants