Skip to content

Commit

Permalink
Remove PHP-CS-Fixer in favor of forbidden multibyte string functions …
Browse files Browse the repository at this point in the history
…in PHP_CodeSniffer
  • Loading branch information
kevinsmith committed Oct 22, 2024
1 parent 81a2039 commit 50de3fc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
php-version: '7.1'
- name: Install Composer Dependencies
uses: ramsey/composer-install@v1
- name: Run PHP-CS-Fixer
run: php vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no
- name: Run PHP_CodeSniffer
run: php vendor/bin/phpcs --no-cache --no-colors

Expand Down
10 changes: 0 additions & 10 deletions .php-cs-fixer.php

This file was deleted.

3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
},
"require-dev": {
"doctrine/coding-standard": "^9.0",
"friendsofphp/php-cs-fixer": "^3.0",
"nyholm/psr7": "^1.6",
"nyholm/psr7-server": "^1.1",
"phpstan/phpstan": "^1.4",
Expand Down Expand Up @@ -52,14 +51,12 @@
},
"scripts": {
"test": [
"php-cs-fixer fix --verbose --dry-run",
"phpcs",
"phpstan analyse",
"psalm",
"phpunit"
],
"fix": [
"php-cs-fixer fix --verbose",
"phpcbf"
]
}
Expand Down
20 changes: 20 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,24 @@
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint"/>
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint"/>
</rule>

<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="str_split" value="mb_str_split"/>
<element key="strlen" value="mb_strlen"/>
<element key="strpos" value="mb_strpos"/>
<element key="strrpos" value="mb_strrpos"/>
<element key="substr" value="mb_substr"/>
<element key="strtolower" value="mb_strtolower"/>
<element key="strtoupper" value="mb_strtoupper"/>
<element key="stripos" value="mb_stripos"/>
<element key="strripos" value="mb_strripos"/>
<element key="strstr" value="mb_strstr"/>
<element key="stristr" value="mb_stristr"/>
<element key="strrchr" value="mb_strrchr"/>
<element key="substr_count" value="mb_substr_count"/>
</property>
</properties>
</rule>
</ruleset>

0 comments on commit 50de3fc

Please sign in to comment.