Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- "7.3"
- "7.4"
- "8.0"
- "8.1"
operating-system:
- "ubuntu-latest"

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "mollie/php-coding-standards",
"type": "library",
"description": "Contains PHP coding standards like rules for PHP-CS-Fixer that serves for purpose of standardization.",
"license": "BSD-2-Clause",
"type": "library",
"authors": [
{
"name": "Mollie B.V.",
Expand All @@ -13,10 +13,10 @@
"php": "^7.1.3 || ^8.0",
"friendsofphp/php-cs-fixer": "^3.1.0"
},
"minimum-stability": "stable",
"autoload": {
"psr-4": {
"Mollie\\PhpCodingStandards\\": "src/"
}
},
"minimum-stability": "stable"
}
}
41 changes: 41 additions & 0 deletions src/PhpCsFixer/Rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@
*/
class Rules
{
/**
* @deprecated php version 7.1 is no longer supported
*/
public static function getForPhp71(array $overriddenRules = []): array
{
return array_merge(self::getBaseRules(), $overriddenRules);
}

/**
* @deprecated php version 7.2 is no longer supported
*/
public static function getForPhp72(array $overriddenRules = []): array
{
$specific72Rules = [
Expand All @@ -23,6 +29,9 @@ public static function getForPhp72(array $overriddenRules = []): array
return array_merge(self::getForPhp71($specific72Rules), $overriddenRules);
}

/**
* @deprecated php version 7.3 is no longer supported
*/
public static function getForPhp73(array $overriddenRules = []): array
{
$specific73Rules = [
Expand All @@ -39,6 +48,33 @@ public static function getForPhp73(array $overriddenRules = []): array
return array_merge(self::getForPhp72($specific73Rules), $overriddenRules);
}

public static function getForPhp74(array $overriddenRules = []): array
{
$specific74Rules = [
// At the moment there are no specific 7.4 rules or configurations
];

return array_merge(self::getForPhp73($specific74Rules), $overriddenRules);
}

public static function getForPhp80(array $overriddenRules = []): array
{
$specific80Rules = [
// At the moment there are no specific 8.0 rules or configurations
];

return array_merge(self::getForPhp74($specific80Rules), $overriddenRules);
}

public static function getForPhp81(array $overriddenRules = []): array
{
$specific81Rules = [
'declare_strict_types' => true,
];

return array_merge(self::getForPhp80($specific81Rules), $overriddenRules);
}

private static function getBaseRules(): array
{
return [
Expand Down Expand Up @@ -97,6 +133,11 @@ private static function getBaseRules(): array
// TODO: Add 'use' when php-cs-fixer #3582 is fixed
],
],
'class_attributes_separation' => [
'elements' => [
'trait_import' => 'none',
],
],
'no_null_property_initialization' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => true,
Expand Down