diff --git a/src/Container.php b/src/Container.php index 9bc8c048..8fb5dd95 100644 --- a/src/Container.php +++ b/src/Container.php @@ -85,7 +85,6 @@ public function has($id): bool */ public function get($id) { - $id = $this->getId($id); if (!isset($this->instances[$id])) { $this->instances[$id] = $this->build($id); } @@ -191,11 +190,6 @@ private function validateDefinition($definition): void throw new InvalidConfigException('Invalid definition:' . var_export($definition, true)); } - private function getId($id): string - { - return is_string($id) ? $id : $id->getId(); - } - /** * @param string $id * diff --git a/tests/Unit/ContainerTest.php b/tests/Unit/ContainerTest.php index b2083228..3591f22a 100644 --- a/tests/Unit/ContainerTest.php +++ b/tests/Unit/ContainerTest.php @@ -288,19 +288,6 @@ public function testReference(): void $this->assertInstanceOf(ColorPink::class, $object->color); } - public function testGetByReference(): void - { - $container = new Container([ - 'engine' => EngineMarkOne::class, - 'e1' => Reference::to('engine'), - ]); - $one = $container->get(Reference::to('engine')); - $two = $container->get(Reference::to('e1')); - $this->assertInstanceOf(EngineMarkOne::class, $one); - $this->assertInstanceOf(EngineMarkOne::class, $two); - $this->assertSame($one, $two); - } - public function testSameInstance(): void { $container = new Container([