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

+8-1
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

+1
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

+2-2
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

+2-2
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

+3-3
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.

src/GeoJson/Feature/FeatureCollection.php renamed to src/Feature/FeatureCollection.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
use IteratorAggregate;
1414
use Traversable;
1515

16+
use function array_map;
17+
use function array_merge;
1618
use function array_values;
1719
use function count;
18-
use function array_merge;
19-
use function array_map;
2020

2121
/**
2222
* Collection of Feature objects.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
use GeoJson\Exception\UnserializationException;
1010
use JsonSerializable;
1111

12+
use function array_map;
1213
use function is_array;
1314
use function is_object;
14-
use function array_map;
1515
use function sprintf;
1616
use function strncmp;
1717

File renamed without changes.

src/GeoJson/Geometry/GeometryCollection.php renamed to src/Geometry/GeometryCollection.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
use IteratorAggregate;
1313
use Traversable;
1414

15+
use function array_map;
16+
use function array_merge;
1517
use function array_values;
1618
use function count;
17-
use function array_merge;
18-
use function array_map;
1919

2020
/**
2121
* Collection of Geometry objects.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/GeoJson/Geometry/Point.php renamed to src/Geometry/Point.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
use InvalidArgumentException;
1010

1111
use function count;
12-
use function is_int;
1312
use function is_float;
13+
use function is_int;
1414

1515
/**
1616
* Point geometry object.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/GeoJson/Tests/GeoJsonTest.php renamed to tests/GeoJsonTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
use JsonSerializable;
1414
use PHPUnit\Framework\TestCase;
1515

16-
use function json_decode;
17-
use function is_object;
1816
use function get_class;
1917
use function gettype;
18+
use function is_object;
19+
use function json_decode;
2020

2121
class GeoJsonTest extends TestCase
2222
{

tests/GeoJson/Tests/Geometry/PointTest.php renamed to tests/Geometry/PointTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
use InvalidArgumentException;
1212
use stdClass;
1313

14-
use function is_subclass_of;
1514
use function func_get_args;
15+
use function is_subclass_of;
1616
use function json_decode;
1717

1818
class PointTest extends BaseGeoJsonTest

tests/bootstrap.php

Whitespace-only changes.

0 commit comments

Comments
 (0)