Skip to content

Commit

Permalink
Update build
Browse files Browse the repository at this point in the history
  • Loading branch information
odan committed Sep 6, 2023
1 parent 7fd4bd0 commit c32bd20
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 21 deletions.
26 changes: 24 additions & 2 deletions .cs.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

return (new PhpCsFixer\Config())
use PhpCsFixer\Config;

return (new Config())
->setUsingCache(false)
->setRiskyAllowed(true)
->setRules(
Expand All @@ -19,6 +21,12 @@
'concat_space' => ['spacing' => 'one'],
'compact_nullable_typehint' => true,
'declare_equal_normalize' => ['space' => 'single'],
'general_phpdoc_annotation_remove' => [
'annotations' => [
'author',
'package',
],
],
'increment_style' => ['style' => 'post'],
'list_syntax' => ['syntax' => 'short'],
'echo_tag_syntax' => ['format' => 'long'],
Expand All @@ -32,9 +40,23 @@
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
'ordered_imports' => [
'sort_algorithm' => 'alpha',
'imports_order' => ['class', 'const', 'function']
'imports_order' => ['class', 'const', 'function'],
],
'single_line_throw' => false,
'declare_strict_types' => false,
'blank_line_between_import_groups' => true,
'fully_qualified_strict_types' => true,
'global_namespace_import' => false,
'no_null_property_initialization' => false,
'operator_linebreak' => [
'only_booleans' => true,
'position' => 'beginning',
],
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => null,
'import_functions' => null
]
]
)
->setFinder(
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php-versions: [ '7.2', '7.3', '7.4', '8.0' ]
php-versions: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}

steps:
Expand Down Expand Up @@ -43,6 +43,6 @@ jobs:
run: composer update --prefer-dist --no-progress --ignore-platform-req=php

- name: Run test suite
run: composer check
run: composer test:all
env:
PHP_CS_FIXER_IGNORE_ENV: 1
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020 odan
Copyright (c) 2023 odan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
37 changes: 21 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "selective/config",
"type": "library",
"description": "Config component, strictly typed",
"license": "MIT",
"type": "library",
"keywords": [
"config",
"configuration",
Expand All @@ -11,7 +12,6 @@
"strict"
],
"homepage": "https://github.com/selective-php/config",
"license": "MIT",
"require": {
"php": "^7.2 || ^8.0",
"cakephp/chronos": "^1.2 || ^2.0"
Expand All @@ -33,24 +33,29 @@
"Selective\\Config\\Test\\": "tests/"
}
},
"config": {
"sort-packages": true
},
"scripts": {
"check": [
"@lint",
"@cs:check",
"@sniffer:check",
"@phpstan",
"@test:coverage"
"cs:check": [
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
"php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi"
],
"cs:fix": [
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
"php-cs-fixer fix --config=.cs.php --ansi --verbose"
],
"cs:check": "php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php",
"cs:fix": "php-cs-fixer fix --config=.cs.php",
"lint": "phplint ./ --exclude=vendor --no-interaction --no-cache",
"phpstan": "phpstan analyse src tests --level=max -c phpstan.neon --no-progress --ansi",
"sniffer:check": "phpcs --standard=phpcs.xml",
"sniffer:fix": "phpcbf --standard=phpcs.xml",
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
"start": "php -S localhost:8080 -t public/",
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always",
"test:coverage": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always --coverage-clover build/logs/clover.xml --coverage-html build/coverage"
},
"config": {
"sort-packages": true
"test:all": [
"@cs:check",
"@sniffer:check",
"@stan",
"@test"
],
"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"
}
}
4 changes: 4 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
parameters:
level: 8
reportUnmatchedIgnoredErrors: false
paths:
- src
- tests
ignoreErrors:
- '#Cannot cast mixed to int.#'
- '#Cannot cast mixed to string.#'
Expand Down

0 comments on commit c32bd20

Please sign in to comment.