Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use fqcn as service ids #152

Merged
merged 1 commit into from
Mar 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions deptrac.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

require __DIR__.'/vendor/autoload.php';

use SensioLabs\Deptrac\Command\AnalyzeCommand;
use SensioLabs\Deptrac\Command\InitCommand;
use SensioLabs\Deptrac\Command\SelfUpdateCommand;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand All @@ -17,8 +20,8 @@
$container->compile();

$application = new Application();
$application->add($container->get('command_init'));
$application->add($container->get('command_analyze'));
$application->add($container->get('command_self_update'));
$application->add($container->get(InitCommand::class));
$application->add($container->get(AnalyzeCommand::class));
$application->add($container->get(SelfUpdateCommand::class));
$application->setDefaultCommand('analyze');
$application->run();
58 changes: 30 additions & 28 deletions services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,72 +4,74 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<services>
<defaults public="false"/>

<service id="dispatcher" class="Symfony\Component\EventDispatcher\EventDispatcher"/>
<service id="Symfony\Component\EventDispatcher\EventDispatcher"/>

<service id="astrunner" class="SensioLabs\AstRunner\AstRunner"/>
<service id="SensioLabs\AstRunner\AstRunner"/>

<service id="output_formatter_factory" class="SensioLabs\Deptrac\OutputFormatterFactory">
<service id="SensioLabs\Deptrac\OutputFormatterFactory">
<argument type="tagged" tag="output_formatter"/>
</service>

<service id="output_formatter_graphviz" class="SensioLabs\Deptrac\OutputFormatter\GraphVizOutputFormatter">
<service id="SensioLabs\Deptrac\OutputFormatter\GraphVizOutputFormatter">
<tag name="output_formatter"/>
</service>

<service id="output_formatter_console" class="SensioLabs\Deptrac\OutputFormatter\ConsoleOutputFormatter">
<service id="SensioLabs\Deptrac\OutputFormatter\ConsoleOutputFormatter">
<tag name="output_formatter"/>
</service>

<service id="command_init" class="SensioLabs\Deptrac\Command\InitCommand"/>
<service id="SensioLabs\Deptrac\RulesetEngine"/>

<service id="ruleset_engine" class="SensioLabs\Deptrac\RulesetEngine"/>

<service id="collector_factory" class="SensioLabs\Deptrac\CollectorFactory">
<service id="SensioLabs\Deptrac\CollectorFactory">
<argument type="tagged" tag="collector"/>
</service>

<service id="collector_className" class="SensioLabs\Deptrac\Collector\ClassNameCollector">
<service id="SensioLabs\Deptrac\Collector\ClassNameCollector">
<tag name="collector"/>
</service>

<service id="collector_method" class="SensioLabs\Deptrac\Collector\MethodCollector">
<service id="SensioLabs\Deptrac\Collector\MethodCollector">
<tag name="collector"/>
</service>

<service id="collector_bool" class="SensioLabs\Deptrac\Collector\BoolCollector">
<service id="SensioLabs\Deptrac\Collector\BoolCollector">
<tag name="collector"/>
</service>

<service id="collector_inheritance_level" class="SensioLabs\Deptrac\Collector\InheritanceLevelCollector">
<tag name="collector" />
</service>

<service id="collector_directory" class="SensioLabs\Deptrac\Collector\DirectoryCollector">
<service id="SensioLabs\Deptrac\Collector\InheritanceLevelCollector">
<tag name="collector"/>
</service>

<service id="command_analyze" class="SensioLabs\Deptrac\Command\AnalyzeCommand">
<argument type="service" id="dispatcher"/>
<argument type="service" id="astrunner"/>
<argument type="service" id="output_formatter_factory"/>
<argument type="service" id="ruleset_engine"/>
<argument type="service" id="collector_factory"/>
<service id="SensioLabs\Deptrac\Collector\DirectoryCollector">
<tag name="collector"/>
</service>

<service id="updater_strategy" class="SensioLabs\Deptrac\Updater\DeptracStrategy" />
<service id="SensioLabs\Deptrac\Updater\DeptracStrategy"/>

<service id="updater" class="Humbug\SelfUpdate\Updater">
<service id="Humbug\SelfUpdate\Updater">
<argument>null</argument>
<!-- disable signed releases, otherwise will search for a .pubkey file for the PHAR -->
<argument>false</argument>
<call method="setStrategyObject">
<argument type="service" id="updater_strategy"/>
<argument type="service" id="SensioLabs\Deptrac\Updater\DeptracStrategy"/>
</call>
</service>

<service id="command_self_update" class="SensioLabs\Deptrac\Command\SelfUpdateCommand">
<argument type="service" id="updater"/>
<!-- COMMANDS -->
<service id="SensioLabs\Deptrac\Command\InitCommand" public="true"/>

<service id="SensioLabs\Deptrac\Command\AnalyzeCommand" public="true">
<argument type="service" id="Symfony\Component\EventDispatcher\EventDispatcher"/>
<argument type="service" id="SensioLabs\AstRunner\AstRunner"/>
<argument type="service" id="SensioLabs\Deptrac\OutputFormatterFactory"/>
<argument type="service" id="SensioLabs\Deptrac\RulesetEngine"/>
<argument type="service" id="SensioLabs\Deptrac\CollectorFactory"/>
</service>

<service id="SensioLabs\Deptrac\Command\SelfUpdateCommand" public="true">
<argument type="service" id="Humbug\SelfUpdate\Updater"/>
</service>
</services>
</container>