Skip to content

Commit eab0f5a

Browse files
authored
Add v5
1 parent f29badd commit eab0f5a

File tree

232 files changed

+11189
-13684
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+11189
-13684
lines changed

.cs.php

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?php
2+
3+
use PhpCsFixer\Config;
4+
5+
return (new Config())
6+
->setUsingCache(false)
7+
->setRiskyAllowed(true)
8+
->setRules(
9+
[
10+
'@PSR1' => true,
11+
'@PSR2' => true,
12+
'@Symfony' => true,
13+
'psr_autoloading' => true,
14+
// custom rules
15+
'align_multiline_comment' => ['comment_type' => 'phpdocs_only'], // psr-5
16+
'phpdoc_to_comment' => false,
17+
'no_superfluous_phpdoc_tags' => false,
18+
'array_indentation' => true,
19+
'array_syntax' => ['syntax' => 'short'],
20+
'cast_spaces' => ['space' => 'none'],
21+
'concat_space' => ['spacing' => 'one'],
22+
'compact_nullable_type_declaration' => true,
23+
'declare_equal_normalize' => ['space' => 'single'],
24+
'general_phpdoc_annotation_remove' => [
25+
'annotations' => [
26+
'author',
27+
'package',
28+
],
29+
],
30+
'increment_style' => ['style' => 'post'],
31+
'list_syntax' => ['syntax' => 'short'],
32+
'echo_tag_syntax' => ['format' => 'long'],
33+
'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
34+
'phpdoc_align' => false,
35+
'phpdoc_no_empty_return' => false,
36+
'phpdoc_order' => true, // psr-5
37+
'phpdoc_no_useless_inheritdoc' => false,
38+
'protected_to_private' => false,
39+
'yoda_style' => false,
40+
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
41+
'ordered_imports' => [
42+
'sort_algorithm' => 'alpha',
43+
'imports_order' => ['class', 'function', 'const'],
44+
],
45+
'single_line_throw' => false,
46+
'declare_strict_types' => false,
47+
'blank_line_between_import_groups' => true,
48+
'fully_qualified_strict_types' => true,
49+
'no_null_property_initialization' => false,
50+
'nullable_type_declaration_for_default_null_value' => 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+
],
60+
'class_definition' => [
61+
'space_before_parenthesis' => true,
62+
],
63+
'declare_equal_normalize' => false,
64+
'phpdoc_summary' => false,
65+
'phpdoc_add_missing_param_annotation' => false,
66+
'no_useless_concat_operator' => false,
67+
'fully_qualified_strict_types' => false,
68+
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
69+
]
70+
)
71+
->setFinder(
72+
PhpCsFixer\Finder::create()
73+
->in(__DIR__ . '/Slim')
74+
->in(__DIR__ . '/tests')
75+
->name('*.php')
76+
->ignoreDotFiles(true)
77+
->ignoreVCS(true)
78+
);

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,11 @@ trim_trailing_whitespace = false
1313

1414
[*.{yml,yaml}]
1515
indent_size = 2
16+
17+
[*.neon]
18+
indent_style = tab
19+
indent_size = 4
20+
21+
[composer.json]
22+
indent_style = space
23+
indent_size = 4

.github/workflows/tests.yml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1-
name: Tests
1+
name: tests
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- '4.x'
7+
- '5.x'
8+
pull_request:
9+
branches:
10+
- '*'
411

512
jobs:
613
tests:
714
name: Tests PHP ${{ matrix.php }}
815
runs-on: ubuntu-latest
9-
continue-on-error: ${{ matrix.experimental }}
1016
strategy:
1117
fail-fast: false
1218
matrix:
13-
php: [7.4, 8.0, 8.1, 8.2, 8.3]
14-
experimental: [false]
19+
php: [ 8.2, 8.3, 8.4 ]
1520
include:
1621
- php: 8.2
1722
analysis: true
@@ -26,24 +31,30 @@ jobs:
2631
php-version: ${{ matrix.php }}
2732
coverage: xdebug
2833

29-
- name: Install dependencies with Composer
30-
uses: ramsey/composer-install@v3
34+
- name: Install dependencies
35+
run: composer install --prefer-dist --no-progress --no-suggest
3136

3237
- name: Coding standards
33-
if: matrix.analysis
34-
run: vendor/bin/phpcs
38+
run: composer cs:check
39+
40+
- name: Code sniffer
41+
run: composer sniffer:check
3542

3643
- name: Static analysis
37-
if: matrix.analysis
38-
run: vendor/bin/phpstan
44+
run: composer stan
3945

4046
- name: Tests
41-
run: vendor/bin/phpunit --coverage-clover clover.xml
47+
if: ${{ !matrix.analysis }}
48+
run: composer test
49+
50+
- name: Tests with coverage
51+
if: matrix.analysis
52+
run: composer test:coverage
4253

4354
- name: Upload coverage results to Coveralls
4455
if: matrix.analysis
4556
env:
4657
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4758
run: |
48-
composer require php-coveralls/php-coveralls -n -W
49-
vendor/bin/php-coveralls --coverage_clover=clover.xml -v
59+
composer global require php-coveralls/php-coveralls
60+
php-coveralls --coverage_clover=build/coverage/clover.xml -v

.gitignore

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
.DS_Store
2-
.idea
3-
.phpunit.result.cache
1+
# Composer
42
composer.lock
5-
phpunit.xml
3+
/vendor
4+
5+
# PHPUnit
6+
/.phpunit.cache
7+
.phpunit.result.cache
8+
9+
# IDEs
10+
/.fleet
11+
/.idea
12+
/.vscode
13+
14+
# Build artifacts and temporary files
15+
.DS_Store
616
clover.xml
7-
vendor
8-
coverage
17+
/build
18+
/coverage

.phpstorm.meta.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
namespace PHPSTORM_META;
4+
5+
override(\Psr\Container\ContainerInterface::get(0), map(['' => '@']));

0 commit comments

Comments
 (0)