Skip to content

Commit

Permalink
Merge pull request #944 from iansltx/php82
Browse files Browse the repository at this point in the history
PHP 8.2 compatibility + phpstan fixes
  • Loading branch information
iansltx authored Apr 23, 2024
2 parents e355328 + e23f643 commit 41d2331
Show file tree
Hide file tree
Showing 127 changed files with 4,608 additions and 6,418 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
php-version:
- 7.4
- 8.2

steps:
- name: "Checkout"
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
strategy:
matrix:
php-version:
- 7.4
- 8.2

steps:
- name: "Checkout"
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
strategy:
matrix:
php-version:
- 7.4
- 8.2

steps:
- name: "Checkout"
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
# strategy:
# matrix:
# php-version:
# - 7.3
# - 8.2
#
# steps:
# - name: "Checkout"
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
build/
.DS_Store
.vagrant
src/config.php
src/database.php
vendor/.git
.idea
node_modules
vendor
diff.txt
.php_cs.cache
.php-cs-fixer.cache
24 changes: 10 additions & 14 deletions .php_cs → .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
'build',
'db',
])
->name('.php_cs');
->name('.php-cs-fixer');

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setFinder($finder)
->setRules([
'@PSR2' => true,
Expand All @@ -30,7 +30,6 @@
'continue',
'declare',
'default',
'die',
'do',
'exit',
'for',
Expand All @@ -52,7 +51,8 @@
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
'method',
'method' => 'one',
'trait_import' => 'one'
],
],
'combine_consecutive_issets' => true,
Expand All @@ -62,10 +62,12 @@
'spacing' => 'one',
],
'declare_equal_normalize' => true,
'final_static_access' => true,
'self_static_accessor' => true,
'fully_qualified_strict_types' => true,
'function_typehint_space' => true,
'hash_to_slash_comment' => true,
'single_line_comment_style' => [
'comment_types' => ['hash']
],
'include' => true,
'increment_style' => [
'style' => 'post',
Expand All @@ -76,11 +78,9 @@
'magic_constant_casing' => true,
'magic_method_casing' => true,
'method_argument_space' => [
'ensure_fully_multiline' => true,
'keep_multiple_spaces_after_comma' => false,
],
'method_chaining_indentation' => true,
'method_separation' => false,
'multiline_whitespace_before_semicolons' => [
'strategy' => 'no_multi_line',
],
Expand All @@ -105,7 +105,6 @@
'switch',
'throw',
'use',
'use_trait',
],
],
'no_leading_import_slash' => true,
Expand All @@ -114,17 +113,14 @@
'use' => 'echo',
],
'no_multiline_whitespace_around_double_arrow' => true,
'no_multiline_whitespace_before_semicolons' => false,
'no_php4_constructor' => false,
'no_short_bool_cast' => true,
'no_short_echo_tag' => true,
'echo_tag_syntax' => ['format' => 'long'],
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_superfluous_elseif' => true,
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_trailing_comma_in_singleline' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_final_method' => true,
'no_unset_cast' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
Expand Down
44 changes: 22 additions & 22 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,38 @@
"homepage": "https://api.joind.in",
"license": "BSD-3-Clause",
"require": {
"php": "^7.3",
"php": "^8.2",
"ext-curl": "*",
"ext-filter": "*",
"ext-gd": "*",
"ext-intl": "*",
"ext-json": "*",
"ext-openssl": "*",
"ext-pdo": "*",
"guzzlehttp/guzzle": "^6.5",
"guzzlehttp/oauth-subscriber": "^0.3.0",
"michelf/php-markdown": "^1.8",
"guzzlehttp/guzzle": "^7.7",
"guzzlehttp/oauth-subscriber": "^0.6",
"michelf/php-markdown": "^2",
"pimple/pimple": "^3.5",
"psr/container": "^1.0.0",
"swiftmailer/swiftmailer": "^6.0",
"teapot/status-code": "^1.1.1"
"psr/container": "^2.0.2",
"swiftmailer/swiftmailer": "^6.3",
"teapot/status-code": "^2.1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16.0",
"infection/infection": "^0.18",
"jangregor/phpstan-prophecy": "~0.6.1",
"maglnet/composer-require-checker": "^2.0.0",
"php-mock/php-mock-phpunit": "^2.7",
"phpstan/extension-installer": "^1.0.3",
"phpstan/phpstan": "~0.12.50",
"phpstan/phpstan-phpunit": "~0.12.22",
"phpunit/phpunit": "^9.4.2",
"roave/security-advisories": "dev-master"
"friendsofphp/php-cs-fixer": "^3.17",
"infection/infection": "^0.27",
"jangregor/phpstan-prophecy": "^1",
"maglnet/composer-require-checker": "^4.6",
"php-mock/php-mock-phpunit": "^2.7.1",
"phpspec/prophecy": "^1.17",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.10.15",
"phpstan/phpstan-phpunit": "1.3.12",
"phpunit/phpunit": "^9.6.8",
"roave/security-advisories": "dev-latest"
},
"config": {
"optimize-autoloader": true,
"platform": {
"php": "7.3.11"
},
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
Expand Down Expand Up @@ -75,7 +74,7 @@
"sed -i 's/XDEBUG_PATH_WHITELIST/XDEBUG_PATH_INCLUDE/g' build/xdebug-filter.php",
"phpunit --coverage-clover=build/logs/clover.xml --coverage-text --prepend=build/xdebug-filter.php"
],
"cs": "php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --verbose",
"cs": "php-cs-fixer fix --diff --verbose",
"infection": "infection --ignore-msi-with-no-mutations --min-covered-msi=71 --min-msi=19",
"require-checker": "composer-require-checker --config-file=composer-require-checker.json",
"security": "security-checker security:check composer.lock",
Expand All @@ -90,5 +89,6 @@
"issues": "/~https://github.com/joindin/joindin-api/issues",
"irc": "irc://freenet/#joindin",
"source": "/~https://github.com/joindin/joindin-api"
}
},
"type": "project"
}
Loading

0 comments on commit 41d2331

Please sign in to comment.