Skip to content

Commit

Permalink
Better top level namespace (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal authored Jan 10, 2024
1 parent 7a3aa54 commit d1ad169
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 37 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ If you want to run it elsewhere, you can use `--composer-json=path/to/composer.j
Currently, it only supports those autoload sections: `psr-4`, `psr-0`, `files`.

## Configuration:
You can provide custom path to config file by `--config=path/to/config.php` where the config file is PHP file returning `ShipMonk\Composer\Config\Configuration` object.
You can provide custom path to config file by `--config=path/to/config.php` where the config file is PHP file returning `ShipMonk\ComposerDependencyAnalyser\Config\Configuration` object.
Here is example of what you can do:

```php
<?php

use ShipMonk\Composer\Config\Configuration;
use ShipMonk\Composer\Config\ErrorType;
use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;

$config = new Configuration();

Expand Down
12 changes: 6 additions & 6 deletions bin/composer-dependency-analyser
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<?php declare(strict_types=1);

use Composer\Autoload\ClassLoader;
use ShipMonk\Composer\ComposerDependencyAnalyser;
use ShipMonk\Composer\ComposerJson;
use ShipMonk\Composer\Config\Configuration;
use ShipMonk\Composer\Config\ErrorType;
use ShipMonk\Composer\Printer;
use ShipMonk\ComposerDependencyAnalyser\ComposerDependencyAnalyser;
use ShipMonk\ComposerDependencyAnalyser\ComposerJson;
use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;
use ShipMonk\ComposerDependencyAnalyser\Printer;

$usage = <<<EOD
Expand All @@ -19,7 +19,7 @@ Options:
--ignore-unknown-classes Ignore when class is not found in classmap
--composer-json <path> Provide custom path to composer.json
--config <path> Provide path to php configuration file
(must return ShipMonk\Composer\Config\Configuration instance)
(must return ShipMonk\ComposerDependencyAnalyser\Config\Configuration instance)
EOD;

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
},
"autoload": {
"psr-4": {
"ShipMonk\\Composer\\": "src/"
"ShipMonk\\ComposerDependencyAnalyser\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"ShipMonk\\Composer\\": "tests/"
"ShipMonk\\ComposerDependencyAnalyser\\": "tests/"
},
"classmap": [
"tests/vendor/",
Expand Down
10 changes: 5 additions & 5 deletions src/ComposerDependencyAnalyser.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php declare(strict_types = 1);

namespace ShipMonk\Composer;
namespace ShipMonk\ComposerDependencyAnalyser;

use DirectoryIterator;
use Generator;
use LogicException;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use ReflectionClass;
use ShipMonk\Composer\Config\Configuration;
use ShipMonk\Composer\Config\ErrorType;
use ShipMonk\Composer\Result\AnalysisResult;
use ShipMonk\Composer\Result\SymbolUsage;
use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;
use ShipMonk\ComposerDependencyAnalyser\Result\AnalysisResult;
use ShipMonk\ComposerDependencyAnalyser\Result\SymbolUsage;
use UnexpectedValueException;
use function array_diff;
use function array_filter;
Expand Down
2 changes: 1 addition & 1 deletion src/ComposerJson.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types = 1);

namespace ShipMonk\Composer;
namespace ShipMonk\ComposerDependencyAnalyser;

use function array_fill_keys;
use function array_filter;
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Configuration.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types = 1);

namespace ShipMonk\Composer\Config;
namespace ShipMonk\ComposerDependencyAnalyser\Config;

use LogicException;
use function array_flip;
Expand Down
2 changes: 1 addition & 1 deletion src/Config/ErrorType.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types = 1);

namespace ShipMonk\Composer\Config;
namespace ShipMonk\ComposerDependencyAnalyser\Config;

final class ErrorType
{
Expand Down
2 changes: 1 addition & 1 deletion src/Config/PathToScan.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types = 1);

namespace ShipMonk\Composer\Config;
namespace ShipMonk\ComposerDependencyAnalyser\Config;

class PathToScan
{
Expand Down
6 changes: 3 additions & 3 deletions src/Printer.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php declare(strict_types = 1);

namespace ShipMonk\Composer;
namespace ShipMonk\ComposerDependencyAnalyser;

use ShipMonk\Composer\Result\AnalysisResult;
use ShipMonk\Composer\Result\SymbolUsage;
use ShipMonk\ComposerDependencyAnalyser\Result\AnalysisResult;
use ShipMonk\ComposerDependencyAnalyser\Result\SymbolUsage;
use function array_fill_keys;
use function array_keys;
use function array_reduce;
Expand Down
2 changes: 1 addition & 1 deletion src/Result/AnalysisResult.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types = 1);

namespace ShipMonk\Composer\Result;
namespace ShipMonk\ComposerDependencyAnalyser\Result;

class AnalysisResult
{
Expand Down
2 changes: 1 addition & 1 deletion src/Result/SymbolUsage.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types = 1);

namespace ShipMonk\Composer\Result;
namespace ShipMonk\ComposerDependencyAnalyser\Result;

class SymbolUsage
{
Expand Down
2 changes: 1 addition & 1 deletion src/UsedSymbolExtractor.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types = 1);

namespace ShipMonk\Composer;
namespace ShipMonk\ComposerDependencyAnalyser;

use function array_merge;
use function count;
Expand Down
2 changes: 1 addition & 1 deletion tests/BinTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types = 1);

namespace ShipMonk\Composer;
namespace ShipMonk\ComposerDependencyAnalyser;

use PHPUnit\Framework\TestCase;
use function fclose;
Expand Down
10 changes: 5 additions & 5 deletions tests/ComposerDependencyAnalyserTest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php declare(strict_types = 1);

namespace ShipMonk\Composer;
namespace ShipMonk\ComposerDependencyAnalyser;

use LogicException;
use PHPUnit\Framework\TestCase;
use ShipMonk\Composer\Config\Configuration;
use ShipMonk\Composer\Config\ErrorType;
use ShipMonk\Composer\Result\AnalysisResult;
use ShipMonk\Composer\Result\SymbolUsage;
use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;
use ShipMonk\ComposerDependencyAnalyser\Result\AnalysisResult;
use ShipMonk\ComposerDependencyAnalyser\Result\SymbolUsage;
use function array_filter;
use function dirname;
use function realpath;
Expand Down
2 changes: 1 addition & 1 deletion tests/ComposerJsonTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types = 1);

namespace ShipMonk\Composer;
namespace ShipMonk\ComposerDependencyAnalyser;

use PHPUnit\Framework\TestCase;

Expand Down
6 changes: 3 additions & 3 deletions tests/PrinterTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php declare(strict_types = 1);

namespace ShipMonk\Composer;
namespace ShipMonk\ComposerDependencyAnalyser;

use Closure;
use PHPUnit\Framework\TestCase;
use ShipMonk\Composer\Result\AnalysisResult;
use ShipMonk\Composer\Result\SymbolUsage;
use ShipMonk\ComposerDependencyAnalyser\Result\AnalysisResult;
use ShipMonk\ComposerDependencyAnalyser\Result\SymbolUsage;
use function ob_get_clean;
use function ob_start;
use function preg_replace;
Expand Down
2 changes: 1 addition & 1 deletion tests/UsedSymbolExtractorTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types = 1);

namespace ShipMonk\Composer;
namespace ShipMonk\ComposerDependencyAnalyser;

use PHPUnit\Framework\TestCase;
use function file_get_contents;
Expand Down

0 comments on commit d1ad169

Please sign in to comment.