Skip to content

Version 2.0.0

Choose a tag to compare

@tomudding tomudding released this 25 May 10:41
· 3 commits to main since this release
9538bf0

Requirements

  • Now requires PHP 8.5 (previously 8.2). This release targets the newest PHP projects at GEWIS.

Tooling upgrades

  • Upgraded to PHP_CodeSniffer v4 (from v3.12).
  • Bumped Slevomat Coding Standard to ^8.29 (from ^8.18).
  • Added PHPCSExtra (^1.5) for additional sniffs leveraging newer language constructs.

Ruleset changes (breaking)

  • Function calls must be multi-line when they have >= 2 arguments.
  • if conditions must be multi-line when they contain >= 2 parts.
  • assert() is now enforced via SlevomatCodingStandard.PHP.RequireExplicitAssertion -> set zend.assertions to 0 or -1 in production.

New rules enabled

  • Universal.Attributes.DisallowAttributeParentheses: no () on attributes without arguments.
  • Universal.Attributes.TrailingComma: trailing comma in multi-line attributes.
  • NormalizedArrays.Arrays.CommaAfterLast: replaces Slevomat's trailing array comma rule.
  • SlevomatCodingStandard.Classes.ClassKeywordOrder: enforces (abstract|final) readonly class order.
  • SlevomatCodingStandard.Classes.DisallowStringExpressionPropertyFetch: forbids $foo->{'bar'}.
  • SlevomatCodingStandard.Classes.TraitUseOrder: alphabetical trait use.
  • SlevomatCodingStandard.ControlStructures.NewWithoutParentheses.
  • SlevomatCodingStandard.ControlStructures.DisallowTrailingMultiLineTernaryOperator and RequireMultiLineTernaryOperator.
  • SlevomatCodingStandard.Commenting.RequireOneDocComment: multiple doc comments must be joined.
  • SlevomatCodingStandard.PHP.UselessParentheses: now also checks around new.

CI

  • Default PHP version in the reusable workflow bumped to 8.5.
  • GitHub Actions pinned to commit SHAs (checkout v6.0.2, setup-php v2.37.1, composer-install v4.0.0).