Skip to content

Commit

Permalink
rename register
Browse files Browse the repository at this point in the history
  • Loading branch information
ytake committed Nov 23, 2014
1 parent 7fe9742 commit 5c6f9ac
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion demo/autowired.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
);
/** @var Iono\Container\Container $compilerContainer */
$compilerContainer = new \Iono\Container\Container($compiler);
$class = $compilerContainer->setContainer()->make("Iono\_TestContainer\Resolve\AutowiredDemo");
$class = $compilerContainer->register()->make("Iono\_TestContainer\Resolve\AutowiredDemo");

$class->getter();
/**
Expand Down
2 changes: 1 addition & 1 deletion demo/performance.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
);
$compiler->setForceCompile(false);
$compilerContainer = new \Iono\Container\Container($compiler);
$container = $compilerContainer->setContainer();
$container = $compilerContainer->register();
$start = microtime(true);
for($i = 0; $i < 10; $i++) {
$container->make("Iono\_TestContainer\Resolve\AutowiredDemo");
Expand Down
2 changes: 1 addition & 1 deletion src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct(CompilerInterface $compiler = null)
* @return $this
* @throws \Exception
*/
public function setContainer()
public function register()
{
if(!file_exists($this->compiler->getCompiledFile())) {
throw new \Exception("annotation scanned file ot found");
Expand Down
4 changes: 2 additions & 2 deletions tests/AnnotationContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testInstance()
public function testClassResolver()
{
/** @var $class */
$class = $this->container->setContainer()->make("Iono\_TestContainer\Resolve\TestingClass");
$class = $this->container->register()->make("Iono\_TestContainer\Resolve\TestingClass");

$reflectionClass = new \ReflectionClass($class);
$this->assertInstanceOf("Iono\_TestContainer\Resolve\TestingClass", $class);
Expand All @@ -51,7 +51,7 @@ public function testClassResolver()
*/
public function testAutowired()
{
$wired = $this->container->setContainer()->make("Iono\_TestContainer\Resolve\AutowiredDemo");
$wired = $this->container->register()->make("Iono\_TestContainer\Resolve\AutowiredDemo");
$reflectionClass = new \ReflectionClass($wired);
$reflectionProperty = $reflectionClass->getProperty("noInject");
$reflectionProperty->setAccessible(true);
Expand Down
2 changes: 1 addition & 1 deletion tests/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testInstance()
public function testSetUpContainer()
{
$this->scanner();
$this->container->setContainer();
$this->container->register();
$autowired = $this->container->make('Iono\_TestContainer\Resolve\AutowiredDemo');
$this->assertInstanceOf("Iono_TestContainerResolveAutowiredDemo", $autowired);
}
Expand Down

0 comments on commit 5c6f9ac

Please sign in to comment.