Skip to content

Commit 8aab283

Browse files
committed
Restructure directories, upgrade PHPUnit and dev dependencies
Move source files from library/Respect/Config/ to src/ with proper PSR-4 autoloading (Respect\Config\ -> src/). Flatten test directory structure to match. Upgrade PHPUnit from ^10.0 to ^12.5, add PHPCS, PHPStan, and Respect coding standard as dev dependencies. Replace deprecated phpunit.xml.dist format with modern schema. Add composer scripts for phpcs, phpstan, phpunit, coverage, and qa. Align .gitignore with other Respect projects.
1 parent a79563e commit 8aab283

12 files changed

Lines changed: 50 additions & 19 deletions

.gitignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
.couscous
2-
*.lock
1+
.couscous/
2+
.phpcs.cache
3+
.phpunit.cache/
4+
.phpunit.result.cache
5+
composer.lock
36
Makefile
7+
phpcs.xml
8+
phpstan.neon
49
phpunit.xml
5-
vendor
10+
vendor/

composer.json

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "respect/config",
3+
"description": "A powerful, small, deadly simple configurator and dependency injection container made to be easy.",
34
"type": "library",
45
"homepage": "https://github.com/Respect/Config",
5-
"description": "A powerful, small, deadly simple configurator and dependency injection container made to be easy.",
66
"keywords": ["respect", "config", "dic", "dependency injection"],
77
"license": "BSD-3-Clause",
88
"authors": [
@@ -11,18 +11,43 @@
1111
"homepage": "https://github.com/Respect/Config/graphs/contributors"
1212
}
1313
],
14-
"autoload": {
15-
"psr-4": {
16-
"Respect\\": "library/Respect"
14+
"config": {
15+
"sort-packages": true,
16+
"allow-plugins": {
17+
"dealerdirect/phpcodesniffer-composer-installer": true
1718
}
1819
},
1920
"require": {
20-
"php": ">=8.5.0",
21+
"php": ">=8.5",
2122
"psr/container": "^2.0"
2223
},
2324
"require-dev": {
24-
"phpunit/phpunit": "^10.0",
25-
"mikey179/vfsstream": "^1.6"
25+
"mikey179/vfsstream": "^1.6",
26+
"phpstan/phpstan": "^2.0",
27+
"phpunit/phpunit": "^12.5",
28+
"respect/coding-standard": "^5.0",
29+
"squizlabs/php_codesniffer": "^4.0"
30+
},
31+
"autoload": {
32+
"psr-4": {
33+
"Respect\\Config\\": "src/"
34+
}
35+
},
36+
"autoload-dev": {
37+
"psr-4": {
38+
"Respect\\Config\\": "tests/"
39+
}
40+
},
41+
"scripts": {
42+
"coverage": "vendor/bin/phpunit --coverage-text",
43+
"phpcs": "vendor/bin/phpcs",
44+
"phpstan": "vendor/bin/phpstan analyze",
45+
"phpunit": "vendor/bin/phpunit",
46+
"qa": [
47+
"@phpcs",
48+
"@phpstan",
49+
"@phpunit"
50+
]
2651
},
2752
"extra": {
2853
"branch-alias": {

phpunit.xml.dist

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
<phpunit backupGlobals="false"
2-
processIsolation="false"
3-
stopOnFailure="false">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php">
45
<testsuites>
5-
<testsuite name="Respect\Config">
6+
<testsuite name="unit">
67
<directory suffix="Test.php">tests</directory>
78
</testsuite>
89
</testsuites>
9-
<filter>
10-
<whitelist>
11-
<directory>library/</directory>
12-
</whitelist>
13-
</filter>
10+
<source>
11+
<include>
12+
<directory>src</directory>
13+
</include>
14+
</source>
1415
</phpunit>
File renamed without changes.

tests/library/Respect/Config/ContainerTest.php renamed to tests/ContainerTest.php

File renamed without changes.

tests/library/Respect/Config/Issues/EnviromentConfigurationTest.php renamed to tests/EnviromentConfigurationTest.php

File renamed without changes.

tests/library/Respect/Config/Issues/InstantiatorImplementsInvoke.php renamed to tests/InstantiatorImplementsInvoke.php

File renamed without changes.

tests/library/Respect/Config/InstantiatorTest.php renamed to tests/InstantiatorTest.php

File renamed without changes.

0 commit comments

Comments
 (0)