Skip to content

Commit

Permalink
Use psr-4 autoloading and sort imports alphabetically (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonschaufi committed Apr 10, 2022
1 parent 4b10235 commit 8a0c5a8
Show file tree
Hide file tree
Showing 40 changed files with 25 additions and 17 deletions.
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@
"slevomat/coding-standard": "^7.0"
},
"autoload": {
"psr-0": { "GeoJson\\": "src/" }
"psr-4": {
"GeoJson\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"GeoJson\\Tests\\": "tests"
}
},
"extra": {
"branch-alias": {
Expand Down
1 change: 1 addition & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>

<!-- **************************************************************************** -->
<!-- Exclude BC breaking type hints for parameters, properties, and return values -->
Expand Down
4 changes: 2 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
>
<testsuites>
<testsuite name="GeoJson Test Suite">
<directory>./tests/GeoJson/</directory>
<directory>./tests/</directory>
</testsuite>
</testsuites>

<coverage ignoreDeprecatedCodeUnits="true" processUncoveredFiles="true">
<include>
<directory suffix=".php">./src/GeoJson</directory>
<directory suffix=".php">./src/</directory>
</include>
</coverage>
</phpunit>
4 changes: 2 additions & 2 deletions src/GeoJson/BoundingBox.php → src/BoundingBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
use JsonSerializable;

use function count;
use function is_int;
use function is_float;
use function is_array;
use function is_float;
use function is_int;

/**
* BoundingBox object.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

use RuntimeException;

use function sprintf;
use function is_object;
use function get_class;
use function gettype;
use function get_debug_type;
use function gettype;
use function is_object;
use function sprintf;

class UnserializationException extends RuntimeException implements Exception
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
use IteratorAggregate;
use Traversable;

use function array_map;
use function array_merge;
use function array_values;
use function count;
use function array_merge;
use function array_map;

/**
* Collection of Feature objects.
Expand Down
2 changes: 1 addition & 1 deletion src/GeoJson/GeoJson.php → src/GeoJson.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
use GeoJson\Exception\UnserializationException;
use JsonSerializable;

use function array_map;
use function is_array;
use function is_object;
use function array_map;
use function sprintf;
use function strncmp;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
use IteratorAggregate;
use Traversable;

use function array_map;
use function array_merge;
use function array_values;
use function count;
use function array_merge;
use function array_map;

/**
* Collection of Geometry objects.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/GeoJson/Geometry/Point.php → src/Geometry/Point.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
use InvalidArgumentException;

use function count;
use function is_int;
use function is_float;
use function is_int;

/**
* Point geometry object.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/GeoJson/Tests/GeoJsonTest.php → tests/GeoJsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
use JsonSerializable;
use PHPUnit\Framework\TestCase;

use function json_decode;
use function is_object;
use function get_class;
use function gettype;
use function is_object;
use function json_decode;

class GeoJsonTest extends TestCase
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
use InvalidArgumentException;
use stdClass;

use function is_subclass_of;
use function func_get_args;
use function is_subclass_of;
use function json_decode;

class PointTest extends BaseGeoJsonTest
Expand Down
File renamed without changes.
Empty file removed tests/bootstrap.php
Empty file.

0 comments on commit 8a0c5a8

Please sign in to comment.