Skip to content

Commit

Permalink
Merge branch 'main' into global-functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dpi committed Jun 4, 2024
2 parents f58002c + 7bc86ad commit 92ee35a
Show file tree
Hide file tree
Showing 75 changed files with 506 additions and 2,596 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.0', '8.1', '8.2']
php-versions: ['8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: "shivammathur/setup-php@v2"
with:
php-version: ${{ matrix.php-versions }}
Expand All @@ -23,9 +23,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.0', '8.1', '8.2']
php-versions: ['8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: "shivammathur/setup-php@v2"
with:
php-version: ${{ matrix.php-versions }}
Expand All @@ -41,10 +41,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.0', '8.1', '8.2']
php-versions: ['8.1', '8.2', '8.3']
dependency-versions: ['highest', 'lowest']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: "shivammathur/setup-php@v2"
with:
php-version: ${{ matrix.php-versions }}
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.idea/
/bin/
/vendor/
.idea
composer.lock
.phpunit.result.cache
.phpunit.cache
bin/
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
check: test lint

test:
bin/phpunit

lint: codestyle static-analysis

fix:
bin/phpcbf

codestyle:
bin/phpcs

static-analysis:
bin/phpstan
32 changes: 30 additions & 2 deletions PreviousNextDrupal/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,25 @@
</properties>
</rule>

<rule ref="SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature">
<properties>
<property name="minLineLength" value="80"/>
<property name="includedMethodPatterns" type="array">
<element value="/__construct/" />
</property>
</properties>
</rule>

<!-- SlevomatCodingStandard.Commenting -->
<rule ref="SlevomatCodingStandard.Commenting.UselessInheritDocComment" />

<!-- SlevomatCodingStandard.ControlStructures -->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullSafeObjectOperator" />

<!-- SlevomatCodingStandard.Functions -->
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall" />
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration" />
<rule ref="SlevomatCodingStandard.Functions.StaticClosure" />
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure" />

<!-- SlevomatCodingStandard.Namespaces -->
Expand All @@ -35,15 +52,14 @@
<!-- SlevomatCodingStandard.TypeHints -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="spacesCountAroundEqualsSign" type="int" value="1" />
<property name="spacesCountAroundEqualsSign" type="int" value="0" />
</properties>
</rule>

<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification"/>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing" />
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.UselessAnnotation"><severity>0</severity></rule>

<!-- Squiz.PHP -->
<rule ref="Squiz.PHP.NonExecutableCode.Unreachable"><severity>0</severity></rule>
Expand All @@ -54,6 +70,14 @@
<!-- Drupal -->
<rule ref="Drupal" />

<!-- Undo the DeclareStrictTypesMissing ignore introduced by
https://www.drupal.org/project/coder/issues/3407995
This must be placed after the above ref="Drupal"
-->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing">
<severity>5</severity>
</rule>

<!-- Drupal.Arrays -->
<rule ref="Drupal.Arrays.Array.LongLineDeclaration"><severity>0</severity></rule>

Expand All @@ -69,4 +93,8 @@
<rule ref="Drupal.Commenting.TodoComment.TodoFormat"><severity>0</severity></rule>
<!-- Do not require @var for properties since PHP has property typing -->
<rule ref="Drupal.Commenting.VariableComment.Missing"><severity>0</severity></rule>

<!-- Drupal.Functions -->
<!-- This duplicates SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration -->
<rule ref="Drupal.Functions.MultiLineFunctionDeclaration.MissingTrailingComma"><severity>0</severity></rule>
</ruleset>
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Latest Stable Version](http://poser.pugx.org/previousnext/coding-standard/v)](https://packagist.org/packages/previousnext/coding-standard)
[![Total Downloads](http://poser.pugx.org/previousnext/coding-standard/downloads)](https://packagist.org/packages/previousnext/coding-standard)
[![GitHub branch checks state](https://img.shields.io/github/checks-status/previousnext/coding-standard/master)][ci]
[![GitHub branch checks state](https://img.shields.io/github/checks-status/previousnext/coding-standard/main)][ci]
[![License](http://poser.pugx.org/previousnext/coding-standard/license)](https://packagist.org/packages/previousnext/coding-standard)

This is a PHP Codesniffer standard enhancing the [Drupal Coder][drupal-coder]
Expand Down Expand Up @@ -130,7 +130,11 @@ function doesAThing(array $data): int {

#### PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose
#### SlevomatCodingStandard.Classes.ClassStructure
#### SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature
#### SlevomatCodingStandard.Commenting.UselessInheritDocComment
#### SlevomatCodingStandard.ControlStructures.RequireNullSafeObjectOperator
#### SlevomatCodingStandard.Functions.RequireTrailingCommaInCall
#### SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration
#### SlevomatCodingStandard.Functions.StaticClosure
#### SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure
#### SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses
Expand Down Expand Up @@ -161,10 +165,6 @@ Developers are entrusted to properly self-describe code. Suggestions to improve

This rule has trouble with newer PHP syntax, especially expression throwables. In any case this rule is best enforced with static analysis.

#### SlevomatCodingStandard.TypeHints.ReturnTypeHint.UselessAnnotation

This rule is too greedy about what it thinks is 'useless'. Unique detail is removed.

---

_Drupal is a registered trademark of Dries Buytaert._
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"require": {
"php": "^8.0",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
"drupal/coder": "^8.3.16",
"slevomat/coding-standard": "^8.7.1",
"drupal/coder": "^8.3.24",
"slevomat/coding-standard": "^8.13.2",
"squizlabs/php_codesniffer": "^3.7.1"
},
"require-dev": {
Expand Down
Loading

0 comments on commit 92ee35a

Please sign in to comment.