Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define requirements in composer.json #3755

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
90 changes: 90 additions & 0 deletions .composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"symbol-whitelist": [
"array",
"Composer\\Autoload\\ClassLoader",
"false",
"null",
"parent",
"pcntl_fork",
"pcntl_waitpid",
"pcntl_wexitstatus",
"PHP_CODESNIFFER_CBF",
"PHP_CODESNIFFER_VERBOSITY",
"PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest",
"posix_isatty",
"self",
"T_ANON_CLASS",
"T_ASPERAND",
"T_ATTRIBUTE_END",
"T_BACKTICK",
"T_BINARY_CAST",
"T_BITWISE_AND",
"T_BITWISE_NOT",
"T_BITWISE_OR",
"T_BITWISE_XOR",
"T_BOOLEAN_NOT",
"T_CLOSE_CURLY_BRACKET",
"T_CLOSE_PARENTHESIS",
"T_CLOSE_SHORT_ARRAY",
"T_CLOSE_SQUARE_BRACKET",
"T_CLOSE_USE_GROUP",
"T_CLOSURE",
"T_COLON",
"T_COMMA",
"T_DIVIDE",
"T_DOC_COMMENT_CLOSE_TAG",
"T_DOC_COMMENT_OPEN_TAG",
"T_DOC_COMMENT_STAR",
"T_DOC_COMMENT_STRING",
"T_DOC_COMMENT_TAG",
"T_DOC_COMMENT_WHITESPACE",
"T_DOLLAR",
"T_DOUBLE_QUOTED_STRING",
"T_END_NOWDOC",
"T_ENUM_CASE",
"T_EQUAL",
"T_FALSE",
"T_FN_ARROW",
"T_GOTO_LABEL",
"T_GREATER_THAN",
"T_HEREDOC",
"T_INLINE_ELSE",
"T_INLINE_THEN",
"T_LESS_THAN",
"T_MATCH_ARROW",
"T_MATCH_DEFAULT",
"T_MINUS",
"T_MODULUS",
"T_MULTIPLY",
"T_NONE",
"T_NOWDOC",
"T_NULL",
"T_NULLABLE",
"T_OBJECT",
"T_OPEN_CURLY_BRACKET",
"T_OPEN_PARENTHESIS",
"T_OPEN_SHORT_ARRAY",
"T_OPEN_SQUARE_BRACKET",
"T_OPEN_USE_GROUP",
"T_PARAM_NAME",
"T_PARENT",
"T_PHPCS_DISABLE",
"T_PHPCS_ENABLE",
"T_PHPCS_IGNORE_FILE",
"T_PHPCS_IGNORE",
"T_PHPCS_SET",
"T_PLUS",
"T_PROPERTY",
"T_PROTOTYPE",
"T_SELF",
"T_SEMICOLON",
"T_START_NOWDOC",
"T_STRING_CONCAT",
"T_THIS",
"T_TRUE",
"T_TYPE_INTERSECTION",
"T_TYPE_UNION",
"T_ZSR_EQUAL",
"true"
]
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.composer-require-checker.json export-ignore
.cspell.json export-ignore
.gitattributes export-ignore
.github/ export-ignore
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ jobs:
if: ${{ matrix.custom_ini == false && matrix.php == '7.4' }}
run: cs2pr ./phpcs-report.xml

- name: 'Composer: validate config'
if: ${{ matrix.custom_ini == false }}
run: composer validate --no-check-all --strict

- name: Download the PHPCS phar
uses: actions/download-artifact@v3
with:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,20 @@ jobs:
diff -B ./src/Standards/PSR12/ruleset.xml <(xmllint --format "./src/Standards/PSR12/ruleset.xml")
diff -B ./src/Standards/Squiz/ruleset.xml <(xmllint --format "./src/Standards/Squiz/ruleset.xml")
diff -B ./src/Standards/Zend/ruleset.xml <(xmllint --format "./src/Standards/Zend/ruleset.xml")

check-composer:
name: Check composer.json
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: 'Composer: validate config'
run: composer --no-interaction validate --no-check-all --strict

- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"

- name: 'Composer require checker'
run: vendor/bin/composer-require-checker check --config-file=.composer-require-checker.json
23 changes: 23 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,36 @@
},
"require": {
"php": ">=7.2.0",
"ext-dom": "*",
"ext-iconv": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
"ext-simplexml": "*"
},
"require-dev": {
"maglnet/composer-require-checker": "^3.0",
"phpunit/phpunit": "^8.0 || ^9.0"
},
"suggest": {
"ext-posix": "More reliable detection of STDIN being a terminal device",
"ext-pcntl": "Allow files to be processed in parallel"
},
"autoload": {
"psr-4": {
"PHP_CodeSniffer\\": "src/"
},
"files": [
"autoload.php",
"src/Util/Tokens.php"
]
},
"autoload-dev": {
"psr-4": {
"PHP_CodeSniffer\\Tests\\": "tests/"
}
},
"bin": [
"bin/phpcs",
"bin/phpcbf"
Expand Down