Skip to content

Commit 525ecad

Browse files
committed
test: run quality tests
1 parent 78fe757 commit 525ecad

12 files changed

Lines changed: 275 additions & 149 deletions

File tree

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040
"phpgt/session": "^1.2",
4141
"phpgt/sync": "^1.3",
4242
"phpgt/ulid": "^1.0",
43-
44-
"psr/http-server-middleware": "^1.0",
4543
"willdurand/negotiation": "^3.0"
4644
},
4745

@@ -55,7 +53,10 @@
5553
"autoload": {
5654
"psr-4": {
5755
"GT\\WebEngine\\": "./src/"
58-
}
56+
},
57+
"files": [
58+
"./gt-namespace-compatibility.php"
59+
]
5960
},
6061
"autoload-dev": {
6162
"psr-4": {

composer.lock

Lines changed: 1 addition & 114 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gt-namespace-compatibility.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Namespace compatibility layer for Gt -> GT transition.
4+
* To mark the rebranding of PHP.GT and the release of WebEngine v5, wherever
5+
* "GT" is mentioned, it will be used uppercase.
6+
* This allows code to use GT\* namespaces while packages still define Gt\*
7+
*/
8+
9+
spl_autoload_register(function(string $class):void {
10+
if(str_starts_with($class, 'GT\\')) {
11+
$legacyClass = 'Gt' . substr($class, 2);
12+
13+
if(class_exists($legacyClass)
14+
|| interface_exists($legacyClass)
15+
|| trait_exists($legacyClass)
16+
|| enum_exists($legacyClass)
17+
) {
18+
class_alias($legacyClass, $class);
19+
}
20+
}
21+
}, true, true);

phpcs.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@
2121
<rule ref="Generic.Files.EndFileNewline" />
2222
<rule ref="Generic.Files.InlineHTML" />
2323
<rule ref="Generic.Files.LineEndings" />
24-
<rule ref="Generic.Files.LineLength">
25-
<properties>
26-
<property name="lineLimit" value="120" />
27-
<property name="absoluteLineLimit" value="0" />
28-
<property name="ignoreComments" value="true" />
29-
</properties>
30-
</rule>
3124
<rule ref="Generic.Files.OneClassPerFile" />
3225
<rule ref="Generic.Files.OneInterfacePerFile" />
3326
<rule ref="Generic.Files.OneObjectStructurePerFile" />

phpstan.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ parameters:
66
- src/Logic
77
- src/Middleware
88
- src/View
9+
reportUnmatchedIgnoredErrors: false
10+
ignoreErrors:
11+
- '#^Class Gt\\[a-zA-Z\\]+ referenced with incorrect case: GT\\[a-zA-Z\\]+\.$#'
12+
- '#^Class GT\\[a-zA-Z\\]+ referenced with incorrect case: Gt\\[a-zA-Z\\]+\.$#'

0 commit comments

Comments
 (0)