Skip to content

Commit

Permalink
make instantiate method private
Browse files Browse the repository at this point in the history
  • Loading branch information
miladrahimi committed Nov 30, 2023
1 parent 6f00cd0 commit bce759a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function delete($id): void
*
* @throws ContainerException
*/
public function instantiate(string $class)
private function instantiate(string $class)
{
try {
$reflection = new ReflectionClass($class);
Expand Down
9 changes: 0 additions & 9 deletions tests/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,6 @@ public function test_deleting_a_binding()
$this->container->get('temp');
}

public function test_instantiating()
{
/** @var E $e */
$e = $this->container->instantiate(E::class);

$this->assertInstanceOf(A::class, $e->a);
$this->assertEquals('something', $e->value);
}

public function test_calling_a_method()
{
$g = new G();
Expand Down

0 comments on commit bce759a

Please sign in to comment.