Skip to content

Commit

Permalink
Fixes #29: Strong type-hints (#33)
Browse files Browse the repository at this point in the history
* Fixes #29: Strong type-hints

* Modern PHP

* Add php81 executor

* Add very useful @var dec

* Bump squizlabs, ignore missing var decs

* Bump squizlabs for lowest

* Kill more var docs

Co-authored-by: Lee Rowlands <[email protected]>
  • Loading branch information
acbramley and larowlan authored Jul 12, 2022
1 parent e873271 commit 8cf75ad
Show file tree
Hide file tree
Showing 13 changed files with 294 additions and 159 deletions.
9 changes: 5 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
version: 2.1

executors:
php74:
docker:
- image: skpr/php-cli:7.4-1.x
php80:
docker:
- image: skpr/php-cli:8.0-1.x
php81:
docker:
- image: skpr/php-cli:8.0-1.x

workflows:
build:
jobs:
- build:
matrix:
parameters:
php: ["php74", "php80"]
php: ["php80", "php81"]
composer-opts: ["", "--prefer-lowest"]

jobs:
Expand All @@ -30,6 +30,7 @@ jobs:
- checkout
- run: composer2 update --prefer-dist --no-progress --no-suggest --no-interaction --optimize-autoloader << parameters.composer-opts >>
- run: ./bin/phpcs --colors --report=full --runtime-set testVersion 8.0-
- run: php -d memory_limit=-1 ./bin/phpstan analyze --no-progress
- run: mkdir -p build/phpunit
- run: ./bin/phpunit --log-junit build/phpunit/results.xml
- store_test_results:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/vendor/
*.sqlite
.phpunit.result.cache
.idea
13 changes: 10 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^7.3 || ^8.0",
"php": ">=8.0",
"doctrine/dbal": "^2.12.1"
},
"require-dev": {
Expand All @@ -21,8 +21,11 @@
"drupal/coder": "^8.3.12",
"pear/console_table": "^1.3",
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpunit/phpunit": "^8.5 || ^9.3",
"squizlabs/php_codesniffer": "^3.5.8"
"squizlabs/php_codesniffer": "^3.7.1"
},
"autoload": {
"psr-4": {
Expand All @@ -39,6 +42,10 @@
"preferred-install": {
"*": "dist"
},
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
}
}
}
170 changes: 162 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@
<arg value="sp"/>
<rule ref="Drupal"/>
<rule ref="PHPCompatibility"/>
<!-- kill @var for properties since php now has typed props -->
<rule ref="Drupal.Commenting.VariableComment.Missing">
<severity>0</severity>
</rule>
</ruleset>
8 changes: 8 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
parameters:
level: 6
checkMissingIterableValueType: false
paths:
- src
customRulesetUsed: true
reportUnmatchedIgnoredErrors: false
ignoreErrors: { }
Loading

0 comments on commit 8cf75ad

Please sign in to comment.