Skip to content

Commit

Permalink
Use ::class
Browse files Browse the repository at this point in the history
  • Loading branch information
enumag committed Jan 23, 2017
1 parent 0271a30 commit 20b8c08
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/DI/ServiceCollectionsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

namespace Arachne\ServiceCollections\DI;

use Arachne\ServiceCollections\GeneratorFactory;
use Arachne\ServiceCollections\GeneratorResolverFactory;
use Arachne\ServiceCollections\ResolverFactory;
use Nette\DI\CompilerExtension;
use Nette\Utils\AssertionException;

Expand Down Expand Up @@ -100,13 +103,13 @@ public function loadConfiguration(): void
$builder = $this->getContainerBuilder();

$builder->addDefinition($this->prefix('resolverFactory'))
->setClass('Arachne\ServiceCollections\ResolverFactory');
->setClass(ResolverFactory::class);

$builder->addDefinition($this->prefix('generatorFactory'))
->setClass('Arachne\ServiceCollections\GeneratorFactory');
->setClass(GeneratorFactory::class);

$builder->addDefinition($this->prefix('generatorResolverFactory'))
->setClass('Arachne\ServiceCollections\GeneratorResolverFactory');
->setClass(GeneratorResolverFactory::class);
}

public function beforeCompile(): void
Expand All @@ -116,8 +119,8 @@ public function beforeCompile(): void

$this->addService(
self::TYPE_RESOLVER.'.'.$tag,
'Closure',
'Arachne\ServiceCollections\ResolverFactory',
\Closure::class,
ResolverFactory::class,
$this->processResolverServices($tag)
);
}
Expand All @@ -127,8 +130,8 @@ public function beforeCompile(): void

$this->addService(
self::TYPE_GENERATOR.'.'.$tag,
'Generator',
'Arachne\ServiceCollections\GeneratorFactory',
\Generator::class,
GeneratorFactory::class,
$this->processGeneratorServices($tag)
);
}
Expand All @@ -138,8 +141,8 @@ public function beforeCompile(): void

$this->addService(
self::TYPE_GENERATOR_RESOLVER.'.'.$tag,
'Closure',
'Arachne\ServiceCollections\GeneratorResolverFactory',
\Closure::class,
GeneratorResolverFactory::class,
$this->processGeneratorResolverServices($tag)
);
}
Expand Down

0 comments on commit 20b8c08

Please sign in to comment.