Skip to content

Commit 3f75050

Browse files
committed
v3
1 parent 721a6dd commit 3f75050

Some content is hidden

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

45 files changed

+686
-79
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ indent_size = 4
1111
trim_trailing_whitespace = true
1212
insert_final_newline = true
1313

14-
[*{.json,.yml}]
14+
[*{.json,.xml,.xml.dist,.neon,.yml}]
1515
indent_size = 2

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "sunrise/http-router",
33
"homepage": "https://github.com/sunrise-php/http-router",
4-
"description": "A flexible HTTP router for PHP 8.1+ based on PSR-7 and PSR-15 with built-in Swagger support.",
4+
"description": "A powerful solution as the foundation of your project.",
55
"license": "MIT",
66
"keywords": [
77
"fenric",
@@ -31,8 +31,8 @@
3131
"psr/http-server-middleware": "^1.0",
3232
"psr/log": "^1.0 || ^2.0 || ^3.0",
3333
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0",
34-
"sunrise/coder": "^1.0",
35-
"sunrise/hydrator": "^3.15",
34+
"sunrise/coder": "^1.1",
35+
"sunrise/hydrator": "^3.16",
3636
"sunrise/translator": "^1.0"
3737
},
3838
"require-dev": {

phpcs.xml.dist

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0"?>
22
<ruleset name="Sunrise Coding Standard">
3-
<rule ref="PSR12" />
4-
<rule ref="Generic.PHP.RequireStrictTypes" />
3+
<rule ref="PSR12" />
4+
<rule ref="Generic.PHP.RequireStrictTypes" />
55

6-
<rule ref="Generic.Files.LineLength">
7-
<exclude-pattern>resources/*</exclude-pattern>
8-
<exclude-pattern>tests/*</exclude-pattern>
9-
</rule>
6+
<rule ref="Generic.Files.LineLength">
7+
<exclude-pattern>resources/*</exclude-pattern>
8+
<exclude-pattern>tests/*</exclude-pattern>
9+
</rule>
1010

11-
<file>src</file>
12-
<file>tests</file>
11+
<file>src</file>
12+
<file>tests</file>
1313
</ruleset>

phpstan.neon

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
parameters:
2-
ignoreErrors:
3-
- '#Cannot access an offset on mixed#'
4-
- '#Cannot access offset .* on mixed#'
5-
- '#Class .* has an uninitialized readonly property#'
6-
- '#Parameter &\$matches @param\-out type of method Sunrise\\Http\\Router\\Helper\\RouteMatcher\:\:matchRoute\(\) expects array\<string, string\>, array\<string\|null\> given\.#'
7-
- '#Readonly property .* is assigned outside of the constructor#'
2+
ignoreErrors:
3+
- '#Cannot access an offset on mixed#'
4+
- '#Cannot access offset .* on mixed#'
5+
- '#Class .* has an uninitialized readonly property#'
6+
- '#Parameter &\$matches @param\-out type of method Sunrise\\Http\\Router\\Helper\\RouteMatcher\:\:matchRoute\(\) expects array\<string, string\>, array\<string\|null\> given\.#'
7+
- '#Readonly property .* is assigned outside of the constructor#'

phpstan.php-gte-84.neon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
parameters:
2-
ignoreErrors:
3-
- '#Parameter \#1 \$classOrMethod of static method Sunrise\\Http\\Router\\Loader\\DescriptorLoader\:\:getClassOrMethodDescriptor\(\) expects ReflectionClass\<object\>\|ReflectionMethod, ReflectionClass\<Psr\\Http\\Server\\RequestHandlerInterface\> given\.#'
2+
ignoreErrors:
3+
- '#Parameter \#1 \$classOrMethod of static method Sunrise\\Http\\Router\\Loader\\DescriptorLoader\:\:getClassOrMethodDescriptor\(\) expects ReflectionClass\<object\>\|ReflectionMethod, ReflectionClass\<Psr\\Http\\Server\\RequestHandlerInterface\> given\.#'

phpstan.php-lt-83.neon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
parameters:
2-
ignoreErrors:
3-
- '#Call to an undefined static method ReflectionMethod::createFromMethodName\(\)#'
2+
ignoreErrors:
3+
- '#Call to an undefined static method ReflectionMethod::createFromMethodName\(\)#'

phpunit.xml.dist

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd">
3-
<testsuites>
4-
<testsuite name="sunrise/http-router">
5-
<directory>./tests/</directory>
6-
</testsuite>
7-
</testsuites>
8-
<source>
9-
<include>
10-
<directory>./src</directory>
11-
</include>
12-
</source>
3+
<testsuites>
4+
<testsuite name="sunrise/http-router">
5+
<directory>./tests/</directory>
6+
</testsuite>
7+
</testsuites>
8+
<source>
9+
<include>
10+
<directory>./src</directory>
11+
</include>
12+
</source>
1313
</phpunit>

psalm.xml.dist

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
<?xml version="1.0"?>
22
<psalm
3-
errorLevel="1"
4-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xmlns="https://getpsalm.org/schema/config"
6-
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
7-
phpVersion="8.1"
3+
errorLevel="1"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xmlns="https://getpsalm.org/schema/config"
6+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
7+
phpVersion="8.1"
88
>
9-
<projectFiles>
10-
<directory name="src" />
11-
<ignoreFiles>
12-
<directory name="vendor" />
13-
</ignoreFiles>
14-
</projectFiles>
9+
<projectFiles>
10+
<directory name="src" />
11+
<ignoreFiles>
12+
<directory name="vendor" />
13+
</ignoreFiles>
14+
</projectFiles>
1515

16-
<issueHandlers>
17-
<ClassMustBeFinal errorLevel="suppress" />
18-
<InaccessibleProperty errorLevel="suppress" />
19-
<MissingConstructor errorLevel="suppress" />
20-
<MixedArrayAssignment errorLevel="suppress" />
21-
<MixedAssignment errorLevel="suppress" />
22-
<PossiblyUnusedMethod errorLevel="suppress" />
23-
<PossiblyUnusedProperty errorLevel="suppress" />
24-
<UnnecessaryVarAnnotation errorLevel="suppress" />
25-
<UnresolvableInclude errorLevel="suppress" />
26-
<UnusedClass errorLevel="suppress" />
27-
<UnusedParam errorLevel="suppress" />
28-
</issueHandlers>
16+
<issueHandlers>
17+
<ClassMustBeFinal errorLevel="suppress" />
18+
<InaccessibleProperty errorLevel="suppress" />
19+
<MissingConstructor errorLevel="suppress" />
20+
<MixedArrayAssignment errorLevel="suppress" />
21+
<MixedAssignment errorLevel="suppress" />
22+
<PossiblyUnusedMethod errorLevel="suppress" />
23+
<PossiblyUnusedProperty errorLevel="suppress" />
24+
<UnnecessaryVarAnnotation errorLevel="suppress" />
25+
<UnresolvableInclude errorLevel="suppress" />
26+
<UnusedClass errorLevel="suppress" />
27+
<UnusedParam errorLevel="suppress" />
28+
</issueHandlers>
2929
</psalm>

resources/translations/ar.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Sunrise\Http\Router\Dictionary\ErrorMessage;
6+
7+
return [
8+
ErrorMessage::MALFORMED_URI => 'معرّف الموارد المطلوب غير صحيح ولا يمكن قبوله من الخادم.',
9+
ErrorMessage::RESOURCE_NOT_FOUND => 'المورد المطلوب غير موجود لهذا المعرّف.',
10+
ErrorMessage::METHOD_NOT_ALLOWED => 'الطريقة المطلوبة غير مسموح بها لهذا المورد.',
11+
ErrorMessage::INVALID_VARIABLE => 'قيمة المتغير {{{ variable_name }}} في معرّف الموارد "{{ route_uri }}" غير صحيحة.',
12+
ErrorMessage::INVALID_QUERY => 'معلمات الطلب غير صحيحة.',
13+
ErrorMessage::MISSING_HEADER => 'رأس الطلب "{{ header_name }}" مفقود.',
14+
ErrorMessage::INVALID_HEADER => 'رأس الطلب "{{ header_name }}" غير صحيح.',
15+
ErrorMessage::MISSING_COOKIE => 'ملف تعريف الارتباط "{{ cookie_name }}" مفقود.',
16+
ErrorMessage::INVALID_COOKIE => 'ملف تعريف الارتباط "{{ cookie_name }}" غير صالح.',
17+
ErrorMessage::INVALID_BODY => 'محتوى الطلب غير صالح.',
18+
ErrorMessage::INTERNAL_SERVER_ERROR => 'حدث خطأ ما.',
19+
];

resources/translations/bg.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Sunrise\Http\Router\Dictionary\ErrorMessage;
6+
7+
return [
8+
ErrorMessage::MALFORMED_URI => 'URI на заявката е невалиден и не може да бъде приет от сървъра.',
9+
ErrorMessage::RESOURCE_NOT_FOUND => 'Заявеното ресурс не е намерено за този URI.',
10+
ErrorMessage::METHOD_NOT_ALLOWED => 'Заявен метод не е разрешен за този ресурс.',
11+
ErrorMessage::INVALID_VARIABLE => 'Стойността на променливата {{{ variable_name }}} в URI на заявката "{{ route_uri }}" е невалидна.',
12+
ErrorMessage::INVALID_QUERY => 'Параметрите на заявката са невалидни.',
13+
ErrorMessage::MISSING_HEADER => 'Липсва хедър в заявката: "{{ header_name }}".',
14+
ErrorMessage::INVALID_HEADER => 'Хедърът "{{ header_name }}" е невалиден.',
15+
ErrorMessage::MISSING_COOKIE => 'Липсва бисквитка "{{ cookie_name }}".',
16+
ErrorMessage::INVALID_COOKIE => 'Бисквитката "{{ cookie_name }}" е невалидна.',
17+
ErrorMessage::INVALID_BODY => 'Тялото на заявката е невалидно.',
18+
ErrorMessage::INTERNAL_SERVER_ERROR => 'Възникна грешка.',
19+
];

0 commit comments

Comments
 (0)