Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add v5 #3360

Open
wants to merge 186 commits into
base: 5.x
Choose a base branch
from
Open

Add v5 #3360

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
186 commits
Select commit Hold shift + click to select a range
62d3edc
Add neon and composer.json config to .editorconfig
odan Jul 21, 2024
8f772c6
Fix code styles
odan Jul 21, 2024
fe5a88e
Update GitHub action settings
odan Jul 21, 2024
a6341c2
Update PHPUnit 11 settings
odan Jul 21, 2024
b1e5f74
Update gitignore
odan Jul 21, 2024
06dac72
Update year
odan Jul 21, 2024
9c34dec
Require PHP 8.2 or 8.3
odan Jul 21, 2024
7cb8f8d
Remove psalm
odan Jul 21, 2024
78502aa
Update phpstan settings filename
odan Jul 21, 2024
6a5f0ca
Rename phpcs settings file
odan Jul 21, 2024
ecc5f9c
Remove old tests for PHP 7
odan Jul 21, 2024
7cc4959
Fix ResponseEmitter tests
odan Jul 21, 2024
1458f57
Fix Route cache file test
odan Jul 21, 2024
26de665
Remove test override definitions
odan Jul 21, 2024
f62ba06
Change phpunit data providers to static
odan Jul 21, 2024
e9bfa0e
Rename non phpunit test classes
odan Jul 21, 2024
810caa4
Allow only PHP 8.2 and 8.3
odan Jul 21, 2024
47f0f3e
Rename non test classes
odan Jul 21, 2024
934f727
Fix cs
odan Jul 21, 2024
780e1df
Fix cs
odan Jul 21, 2024
4c7ea73
Fix cs
odan Jul 21, 2024
637ee08
Update Changelog
odan Jul 21, 2024
143d56f
Update coveralls command
odan Jul 21, 2024
1b25c0e
Update coveralls command
odan Jul 21, 2024
8f742a9
Add PHPUnit attributes
odan Jul 21, 2024
58122de
Add PHPUnit 11
odan Jul 21, 2024
4b26f54
Fix tests
odan Jul 21, 2024
0cf055d
Add PHP-DI as dev dependency
odan Jul 29, 2024
d826be0
Add php-cs-fixer
odan Jul 29, 2024
c2a0419
Add php-storm meta file
odan Jul 29, 2024
891dfb8
Fix cs
odan Jul 30, 2024
0f568a1
Fix cs
odan Jul 30, 2024
2f7f2e7
Update readme for v5
odan Aug 8, 2024
ad0fec5
Update cs rules
odan Aug 8, 2024
64a78c3
Add php-di/invoker as dependency
odan Aug 8, 2024
9db190f
Add psr container settings
odan Aug 8, 2024
3311649
Update readme
odan Aug 8, 2024
f2d6d2e
Include 4.x and 5.x branches
odan Aug 8, 2024
09d8ee5
Update changelog
odan Aug 8, 2024
7dd60d6
Refactoring to v5
odan Aug 11, 2024
16dfb7a
Do not thow exception if routing result is invalid
odan Aug 11, 2024
6ef447d
Add RoutingMiddleware tests
odan Aug 11, 2024
8b5c4f6
Fix cs
odan Aug 11, 2024
0f8871c
Update changelog
odan Aug 11, 2024
c6f85d3
Update AppTest
odan Aug 11, 2024
a3fa666
Update MethodOverrideMiddleware tests
odan Aug 11, 2024
07f3088
Update ContentLengthMiddleware test
odan Aug 11, 2024
b0bac91
Update OutputBufferingMiddleware tests
odan Aug 11, 2024
ed8f520
Change properties to private
odan Aug 11, 2024
e4dfe54
Add ExceptionHandlingMiddleware test
odan Aug 11, 2024
efb3804
Add content negotiator
odan Aug 12, 2024
b3d137f
Fix cs
odan Aug 12, 2024
a34c87f
Fix cs
odan Aug 12, 2024
f8621ac
Skip tests
odan Aug 12, 2024
065c497
Add phpunit autoloader
odan Aug 12, 2024
633ad30
Fix tests
odan Aug 13, 2024
df96060
Disable test
odan Aug 13, 2024
fb92d85
Update tests
odan Aug 14, 2024
4ffc177
Add tests
odan Aug 14, 2024
5f8b8f6
Add tests
odan Aug 14, 2024
c44d173
Update exception messages
odan Aug 14, 2024
d084eab
Add tests
odan Aug 14, 2024
98d7487
Fix namespace in Router
odan Aug 14, 2024
6c222ff
Fix invalid array entry
odan Aug 14, 2024
f349298
Fix cs
odan Aug 14, 2024
0cae1dd
Add base path middleware
odan Aug 16, 2024
4e8500c
Add EndpointMiddleware test
odan Aug 17, 2024
3996788
Add ErrorHandlingMiddleware test
odan Aug 17, 2024
687d74e
Remove setMiddlewareOrder method in MiddlewareResolver
odan Aug 17, 2024
b9b288f
Add ExceptionLoggingMiddleware tests
odan Aug 17, 2024
0819661
Optimize TestLogger
odan Aug 17, 2024
fe9d1f7
Add HeadMethodMiddleware tests
odan Aug 17, 2024
3dba797
Add ResponseFactoryMiddleware tests
odan Aug 17, 2024
9ea20b1
Remove UrlGeneratorMiddleware
odan Aug 17, 2024
11830f6
Add tests
odan Aug 17, 2024
4f776dd
Remove disableXmlEntityLoader method in BodyParsingMiddleware
odan Aug 17, 2024
324e1bf
Add tests
odan Aug 17, 2024
d67f768
Add tests
odan Aug 18, 2024
d4664c3
Update comment
odan Aug 18, 2024
1bf568d
Add tests
odan Aug 18, 2024
a23e8be
Add tests
odan Aug 18, 2024
4661679
Fix cs
odan Aug 18, 2024
b00933b
Add StdLogger
odan Aug 18, 2024
34b3dad
Change default error title for security reasons
odan Aug 18, 2024
a479b95
Fix html output
odan Aug 18, 2024
154ba36
Add tests
odan Aug 18, 2024
6a05f7b
Add tests
odan Aug 18, 2024
e7af319
Add tests
odan Aug 18, 2024
f394f14
Remove setJsonOptions method
odan Aug 18, 2024
70dae9b
Throw JsonException if an error occurs
odan Aug 18, 2024
da9ea8f
Rename to clearHandlers
odan Aug 18, 2024
8254114
Add tests
odan Aug 18, 2024
cd7fc79
Fix empty values
odan Aug 18, 2024
619bd24
Add tests
odan Aug 18, 2024
077743c
Add tests
odan Aug 18, 2024
349aa6b
Fix cs
odan Aug 18, 2024
f504722
Add tests
odan Aug 18, 2024
cb025bd
Optimize
odan Aug 18, 2024
d39c9b6
Add tests
odan Aug 18, 2024
a7ebb2b
Add container definitions
odan Aug 22, 2024
afbfd5e
Remove final
odan Aug 23, 2024
383a3a3
Optimize error handling
odan Aug 23, 2024
7ddf316
Optimize error handling
odan Aug 23, 2024
df3ebcf
Add AppFactory compatibility layer
odan Aug 23, 2024
93cbded
Fix cs
odan Aug 23, 2024
406182c
Fix cs
odan Aug 23, 2024
8aca1a0
Fix cs
odan Aug 23, 2024
9180930
Add LaminasDiactorosDefinitions
odan Aug 24, 2024
583f16d
Remove ErrorHandlerTest
odan Aug 24, 2024
52f6c60
Add tests
odan Aug 24, 2024
709c30c
Add tests
odan Aug 24, 2024
d7fa888
Add tests
odan Aug 24, 2024
5004f2f
Add tests
odan Aug 24, 2024
6ed739d
Fix Slim notation resolver
odan Aug 24, 2024
1f85be5
Fix HeaderStack
odan Aug 24, 2024
5f0bc45
Update RouteCollectionInterface
odan Aug 24, 2024
75163d8
Remove php notation
odan Aug 24, 2024
ddecf74
Remove php notation
odan Aug 24, 2024
d5cf165
Update changelog
odan Aug 24, 2024
926a6c4
Remove ContentNegotiationResult
odan Aug 25, 2024
3439bd2
Add docblocks
odan Aug 25, 2024
dd62d72
Use http links
odan Aug 25, 2024
35de16d
Add doc blocks
odan Aug 25, 2024
30123fd
Fix cs
odan Aug 25, 2024
00b0af3
Fix grammar
odan Aug 25, 2024
86745cf
Add ext-dom and ext-libxml
odan Aug 25, 2024
3a46b5b
Add version 5
odan Aug 25, 2024
ab9d637
Add MediaType
odan Aug 25, 2024
2e09625
Fix cs
odan Aug 25, 2024
8049ff2
Update MiddlewareCollectionInterface
odan Aug 25, 2024
6d63b66
Rename variable
odan Aug 25, 2024
51d8aa7
Fix unexpected behavior
odan Aug 25, 2024
1dcaeb8
Optimize error handling
odan Aug 27, 2024
e532d05
Remove AppFactory
odan Aug 27, 2024
5722458
Add author
odan Aug 27, 2024
7d8ef13
Fix return type
odan Aug 27, 2024
b3c679e
Add Config class and ConfigInterface
odan Aug 31, 2024
e108132
Move Strategies to Routing
odan Aug 31, 2024
c4d3594
Optimize configuration
odan Sep 1, 2024
f3f3202
Optimize namespaces
odan Sep 1, 2024
dcb8799
Optimize error handling
odan Sep 1, 2024
a0d5103
Optimize
odan Sep 2, 2024
58f11b6
Use PSR NullLogger as default logger
odan Sep 24, 2024
d7da01c
Update test
odan Sep 24, 2024
1303ee4
Add new AppFactory
odan Sep 24, 2024
15ec357
Allow loading of definitions from a file
odan Sep 24, 2024
48cad6e
Update tests
odan Sep 24, 2024
2c7b793
Add basePath to UrlGenerator
odan Sep 24, 2024
0b2e5b6
Remove LIFO middleware order support
odan Sep 24, 2024
3bd30cb
Add TestLogger
odan Sep 24, 2024
453e94d
Add basePath to UrlGenerator
odan Sep 24, 2024
5bc416a
Fix cs
odan Sep 24, 2024
61c6e63
Fix cs
odan Sep 24, 2024
d7cadc0
Fix cs
odan Sep 24, 2024
9f2df40
Fix cs
odan Sep 24, 2024
dfb3729
Add method getRouteArgument
odan Sep 24, 2024
1c20a07
Add methods getRoute, getArguments, getArgument to RouteContext
odan Sep 24, 2024
de0ec82
Add method getRouteGroup
odan Sep 24, 2024
6899386
Fix test
odan Sep 24, 2024
5bbac05
Add method withExceptionHandler
odan Sep 24, 2024
e3c53ac
Fix cs
odan Sep 24, 2024
d26318f
Use local variable in ErrorHandlingMiddleware
odan Oct 13, 2024
6d8570b
Fix cs
odan Oct 13, 2024
31a7670
Fix cs
odan Oct 13, 2024
9972e14
Fix cs
odan Oct 13, 2024
749da56
Add router tests
odan Oct 24, 2024
369fb95
Update exception message
odan Oct 24, 2024
8130052
Add CorsMiddleware for handling CORS requests
odan Oct 26, 2024
1f9cad9
Update changelog
odan Oct 26, 2024
21c8cb3
Remove AppFactory
odan Oct 29, 2024
4f163bd
Update App constructor
odan Oct 29, 2024
8e9159f
Optimize test build
odan Oct 29, 2024
2a48734
Optimize test build
odan Oct 29, 2024
37f933e
Add test without handler for ExceptionHandlingMiddleware
odan Nov 9, 2024
be12ada
Add tests for RouteContext
odan Nov 9, 2024
2aaddf4
Optimize routing with basePath
odan Nov 9, 2024
97da968
Replace getData (deprecated) with processedRoutes
odan Nov 14, 2024
103d12c
Revert
odan Nov 14, 2024
cb557a8
Add support for PHP 8.4
odan Dec 1, 2024
355713b
Upgrade to phpstan 2
odan Dec 1, 2024
5911ba9
Change php-cs-fixer settings for PHP 8.4
odan Dec 1, 2024
92267ed
Fix MediaTypeDetector null handling
odan Dec 1, 2024
eed5575
Optimize ContainerResolver array handling
odan Dec 1, 2024
00dad50
Fix PHP 8.4 issues
odan Dec 1, 2024
fda8032
Fix PHP 8.4 issues
odan Dec 1, 2024
a14f88f
Remove ext-xdebug as dev dependency
odan Dec 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .cs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?php

use PhpCsFixer\Config;

return (new Config())
->setUsingCache(false)
->setRiskyAllowed(true)
->setRules(
[
'@PSR1' => true,
'@PSR2' => true,
'@Symfony' => true,
'psr_autoloading' => true,
// custom rules
'align_multiline_comment' => ['comment_type' => 'phpdocs_only'], // psr-5
'phpdoc_to_comment' => false,
'no_superfluous_phpdoc_tags' => false,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'cast_spaces' => ['space' => 'none'],
'concat_space' => ['spacing' => 'one'],
'compact_nullable_type_declaration' => 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'],
'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
'phpdoc_align' => false,
'phpdoc_no_empty_return' => false,
'phpdoc_order' => true, // psr-5
'phpdoc_no_useless_inheritdoc' => false,
'protected_to_private' => false,
'yoda_style' => false,
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
'ordered_imports' => [
'sort_algorithm' => 'alpha',
'imports_order' => ['class', 'function', 'const'],
],
'single_line_throw' => false,
'declare_strict_types' => false,
'blank_line_between_import_groups' => true,
'fully_qualified_strict_types' => true,
'no_null_property_initialization' => false,
'nullable_type_declaration_for_default_null_value' => false,
'operator_linebreak' => [
'only_booleans' => true,
'position' => 'beginning',
],
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => null,
'import_functions' => null
],
'class_definition' => [
'space_before_parenthesis' => true,
],
'declare_equal_normalize' => false,
'phpdoc_summary' => false,
'phpdoc_add_missing_param_annotation' => false,
'no_useless_concat_operator' => false,
'fully_qualified_strict_types' => false,
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
]
)
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__ . '/Slim')
->in(__DIR__ . '/tests')
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true)
);
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

[*.neon]
indent_style = tab
indent_size = 4

[composer.json]
indent_style = space
indent_size = 4
39 changes: 25 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
name: Tests
name: tests

on: [push, pull_request]
on:
push:
branches:
- '4.x'
- '5.x'
pull_request:
branches:
- '*'

jobs:
tests:
name: Tests PHP ${{ matrix.php }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php: [7.4, 8.0, 8.1, 8.2, 8.3]
experimental: [false]
php: [ 8.2, 8.3, 8.4 ]
include:
- php: 8.2
analysis: true
Expand All @@ -26,24 +31,30 @@ jobs:
php-version: ${{ matrix.php }}
coverage: xdebug

- name: Install dependencies with Composer
uses: ramsey/composer-install@v3
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Coding standards
if: matrix.analysis
run: vendor/bin/phpcs
run: composer cs:check

- name: Code sniffer
run: composer sniffer:check

- name: Static analysis
if: matrix.analysis
run: vendor/bin/phpstan
run: composer stan

- name: Tests
run: vendor/bin/phpunit --coverage-clover clover.xml
if: ${{ !matrix.analysis }}
run: composer test

- name: Tests with coverage
if: matrix.analysis
run: composer test:coverage

- name: Upload coverage results to Coveralls
if: matrix.analysis
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer require php-coveralls/php-coveralls -n -W
vendor/bin/php-coveralls --coverage_clover=clover.xml -v
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/coverage/clover.xml -v
22 changes: 16 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
.DS_Store
.idea
.phpunit.result.cache
# Composer
composer.lock
phpunit.xml
/vendor

# PHPUnit
/.phpunit.cache
.phpunit.result.cache

# IDEs
/.fleet
/.idea
/.vscode

# Build artifacts and temporary files
.DS_Store
clover.xml
vendor
coverage
/build
/coverage
5 changes: 5 additions & 0 deletions .phpstorm.meta.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

namespace PHPSTORM_META;

override(\Psr\Container\ContainerInterface::get(0), map(['' => '@']));
Loading