Skip to content

Commit f365ef5

Browse files
committed
try to fix enums
1 parent ff90717 commit f365ef5

File tree

5 files changed

+57
-2
lines changed

5 files changed

+57
-2
lines changed

.github/workflows/test.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Check Coding Standard"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "[0-9]+.[0-9]+.x"
10+
11+
jobs:
12+
static-analysis-coding-standard:
13+
name: "Static Analysis by patchlevel/coding-standard"
14+
15+
runs-on: ${{ matrix.operating-system }}
16+
17+
strategy:
18+
matrix:
19+
dependencies:
20+
- "highest"
21+
php-version:
22+
- "8.1"
23+
operating-system:
24+
- "ubuntu-latest"
25+
26+
steps:
27+
- name: "Checkout"
28+
uses: "actions/checkout@v2"
29+
30+
- name: "Install PHP"
31+
uses: "shivammathur/setup-php@v2"
32+
with:
33+
coverage: "pcov"
34+
php-version: "${{ matrix.php-version }}"
35+
ini-values: memory_limit=-1
36+
extensions: pdo_sqlite
37+
38+
- uses: "ramsey/composer-install@v2"
39+
with:
40+
dependency-versions: ${{ matrix.dependencies }}
41+
42+
- name: "Coding Standard"
43+
run: "vendor/bin/phpcs tests/fixed"

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
"squizlabs/php_codesniffer": "^3.6.0"
3434
},
3535
"config": {
36-
"sort-packages": true
36+
"sort-packages": true,
37+
"allow-plugins": {
38+
"dealerdirect/phpcodesniffer-composer-installer": true
39+
}
3740
}
3841
}

phpcs.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
<arg value="p"/>
1515
<file>src</file>
1616

17-
<rule ref="Patchlevel"/>
17+
<rule ref="PatchlevelCodingStandard"/>
1818
</ruleset>

tests/fixed/enum.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
enum Suit: string
4+
{
5+
case Hearts = 'H';
6+
case Diamonds = 'D';
7+
case Clubs = 'C';
8+
case Spades = 'S';
9+
}

0 commit comments

Comments
 (0)