Skip to content

Commit 8a0c5a8

Browse files
authored
Use psr-4 autoloading and sort imports alphabetically (#38)
1 parent 4b10235 commit 8a0c5a8

40 files changed

+25
-17
lines changed

composer.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@
2020
"slevomat/coding-standard": "^7.0"
2121
},
2222
"autoload": {
23-
"psr-0": { "GeoJson\\": "src/" }
23+
"psr-4": {
24+
"GeoJson\\": "src"
25+
}
26+
},
27+
"autoload-dev": {
28+
"psr-4": {
29+
"GeoJson\\Tests\\": "tests"
30+
}
2431
},
2532
"extra": {
2633
"branch-alias": {

phpcs.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
<property name="searchAnnotations" value="true"/>
8989
</properties>
9090
</rule>
91+
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
9192

9293
<!-- **************************************************************************** -->
9394
<!-- Exclude BC breaking type hints for parameters, properties, and return values -->

phpunit.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
>
88
<testsuites>
99
<testsuite name="GeoJson Test Suite">
10-
<directory>./tests/GeoJson/</directory>
10+
<directory>./tests/</directory>
1111
</testsuite>
1212
</testsuites>
1313

1414
<coverage ignoreDeprecatedCodeUnits="true" processUncoveredFiles="true">
1515
<include>
16-
<directory suffix=".php">./src/GeoJson</directory>
16+
<directory suffix=".php">./src/</directory>
1717
</include>
1818
</coverage>
1919
</phpunit>

src/GeoJson/BoundingBox.php renamed to src/BoundingBox.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
use JsonSerializable;
1010

1111
use function count;
12-
use function is_int;
13-
use function is_float;
1412
use function is_array;
13+
use function is_float;
14+
use function is_int;
1515

1616
/**
1717
* BoundingBox object.
File renamed without changes.

src/GeoJson/Exception/UnserializationException.php renamed to src/Exception/UnserializationException.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
use RuntimeException;
88

9-
use function sprintf;
10-
use function is_object;
119
use function get_class;
12-
use function gettype;
1310
use function get_debug_type;
11+
use function gettype;
12+
use function is_object;
13+
use function sprintf;
1414

1515
class UnserializationException extends RuntimeException implements Exception
1616
{
File renamed without changes.

0 commit comments

Comments
 (0)