Skip to content

Commit c32bd20

Browse files
committed
Update build
1 parent 7fd4bd0 commit c32bd20

5 files changed

Lines changed: 52 additions & 21 deletions

File tree

.cs.php

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
return (new PhpCsFixer\Config())
3+
use PhpCsFixer\Config;
4+
5+
return (new Config())
46
->setUsingCache(false)
57
->setRiskyAllowed(true)
68
->setRules(
@@ -19,6 +21,12 @@
1921
'concat_space' => ['spacing' => 'one'],
2022
'compact_nullable_typehint' => true,
2123
'declare_equal_normalize' => ['space' => 'single'],
24+
'general_phpdoc_annotation_remove' => [
25+
'annotations' => [
26+
'author',
27+
'package',
28+
],
29+
],
2230
'increment_style' => ['style' => 'post'],
2331
'list_syntax' => ['syntax' => 'short'],
2432
'echo_tag_syntax' => ['format' => 'long'],
@@ -32,9 +40,23 @@
3240
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
3341
'ordered_imports' => [
3442
'sort_algorithm' => 'alpha',
35-
'imports_order' => ['class', 'const', 'function']
43+
'imports_order' => ['class', 'const', 'function'],
3644
],
3745
'single_line_throw' => false,
46+
'declare_strict_types' => false,
47+
'blank_line_between_import_groups' => true,
48+
'fully_qualified_strict_types' => true,
49+
'global_namespace_import' => false,
50+
'no_null_property_initialization' => false,
51+
'operator_linebreak' => [
52+
'only_booleans' => true,
53+
'position' => 'beginning',
54+
],
55+
'global_namespace_import' => [
56+
'import_classes' => true,
57+
'import_constants' => null,
58+
'import_functions' => null
59+
]
3860
]
3961
)
4062
->setFinder(

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
operating-system: [ ubuntu-latest ]
11-
php-versions: [ '7.2', '7.3', '7.4', '8.0' ]
11+
php-versions: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
1212
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
1313

1414
steps:
@@ -43,6 +43,6 @@ jobs:
4343
run: composer update --prefer-dist --no-progress --ignore-platform-req=php
4444

4545
- name: Run test suite
46-
run: composer check
46+
run: composer test:all
4747
env:
4848
PHP_CS_FIXER_IGNORE_ENV: 1

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2020 odan
3+
Copyright (c) 2023 odan
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

composer.json

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "selective/config",
3-
"type": "library",
43
"description": "Config component, strictly typed",
4+
"license": "MIT",
5+
"type": "library",
56
"keywords": [
67
"config",
78
"configuration",
@@ -11,7 +12,6 @@
1112
"strict"
1213
],
1314
"homepage": "https://github.com/selective-php/config",
14-
"license": "MIT",
1515
"require": {
1616
"php": "^7.2 || ^8.0",
1717
"cakephp/chronos": "^1.2 || ^2.0"
@@ -33,24 +33,29 @@
3333
"Selective\\Config\\Test\\": "tests/"
3434
}
3535
},
36+
"config": {
37+
"sort-packages": true
38+
},
3639
"scripts": {
37-
"check": [
38-
"@lint",
39-
"@cs:check",
40-
"@sniffer:check",
41-
"@phpstan",
42-
"@test:coverage"
40+
"cs:check": [
41+
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
42+
"php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi"
43+
],
44+
"cs:fix": [
45+
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
46+
"php-cs-fixer fix --config=.cs.php --ansi --verbose"
4347
],
44-
"cs:check": "php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php",
45-
"cs:fix": "php-cs-fixer fix --config=.cs.php",
46-
"lint": "phplint ./ --exclude=vendor --no-interaction --no-cache",
47-
"phpstan": "phpstan analyse src tests --level=max -c phpstan.neon --no-progress --ansi",
4848
"sniffer:check": "phpcs --standard=phpcs.xml",
4949
"sniffer:fix": "phpcbf --standard=phpcs.xml",
50+
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
51+
"start": "php -S localhost:8080 -t public/",
5052
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always",
51-
"test:coverage": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always --coverage-clover build/logs/clover.xml --coverage-html build/coverage"
52-
},
53-
"config": {
54-
"sort-packages": true
53+
"test:all": [
54+
"@cs:check",
55+
"@sniffer:check",
56+
"@stan",
57+
"@test"
58+
],
59+
"test:coverage": "php -d xdebug.mode=coverage -r \"require 'vendor/bin/phpunit';\" -- --configuration phpunit.xml --do-not-cache-result --colors=always --coverage-clover build/logs/clover.xml --coverage-html build/coverage"
5560
}
5661
}

phpstan.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
parameters:
2+
level: 8
23
reportUnmatchedIgnoredErrors: false
4+
paths:
5+
- src
6+
- tests
37
ignoreErrors:
48
- '#Cannot cast mixed to int.#'
59
- '#Cannot cast mixed to string.#'

0 commit comments

Comments
 (0)