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 #3754

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
100 changes: 100 additions & 0 deletions .composer-require-checker.json
@@ -0,0 +1,100 @@
{
"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_OBJECT",
"T_CLOSE_PARENTHESIS",
"T_CLOSE_SHORT_ARRAY",
"T_CLOSE_SQUARE_BRACKET",
"T_CLOSE_USE_GROUP",
"T_CLOSURE",
"T_COLON",
"T_COLOUR",
"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_EMBEDDED_PHP",
"T_END_NOWDOC",
"T_ENUM_CASE",
"T_EQUAL",
"T_FALSE",
"T_FN_ARROW",
"T_GOTO_LABEL",
"T_GREATER_THAN",
"T_HASH",
"T_HEREDOC",
"T_INLINE_ELSE",
"T_INLINE_THEN",
"T_LABEL",
"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",
"T_PHPCS_IGNORE_FILE",
"T_PHPCS_SET",
"T_PLUS",
"T_PROPERTY",
"T_PROTOTYPE",
"T_REGULAR_EXPRESSION",
"T_SELF",
"T_SEMICOLON",
"T_START_NOWDOC",
"T_STRING_CONCAT",
"T_STYLE",
"T_THIS",
"T_TRUE",
"T_TYPE_INTERSECTION",
"T_TYPE_UNION",
"T_TYPEOF",
"T_URL",
"T_ZSR_EQUAL",
"T_ZSR",
"true"
]
}
1 change: 1 addition & 0 deletions .gitattributes
@@ -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
Expand Up @@ -154,10 +154,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
Expand Up @@ -78,3 +78,20 @@ jobs:

- name: Validate the PEAR package
run: pear package-validate package.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
24 changes: 24 additions & 0 deletions composer.json
Expand Up @@ -27,13 +27,37 @@
},
"require": {
"php": ">=5.4.0",
"ext-ctype": "*",
"ext-dom": "*",
"ext-iconv": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
"ext-simplexml": "*"
},
"require-dev": {
"maglnet/composer-require-checker": "^3.0",
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.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