mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 16:27:23 +01:00
Migrates to Pint
This commit is contained in:
@ -35,13 +35,12 @@ final class Container
|
||||
/**
|
||||
* Gets a dependency from the container.
|
||||
*
|
||||
* @param class-string $id
|
||||
*
|
||||
* @param class-string $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function get(string $id)
|
||||
{
|
||||
if (!array_key_exists($id, $this->instances)) {
|
||||
if (! array_key_exists($id, $this->instances)) {
|
||||
$this->instances[$id] = $this->build($id);
|
||||
}
|
||||
|
||||
@ -51,7 +50,7 @@ final class Container
|
||||
/**
|
||||
* Adds the given instance to the container.
|
||||
*
|
||||
* @param mixed $instance
|
||||
* @param mixed $instance
|
||||
*/
|
||||
public function add(string $id, $instance): void
|
||||
{
|
||||
@ -61,7 +60,7 @@ final class Container
|
||||
/**
|
||||
* Tries to build the given instance.
|
||||
*
|
||||
* @param class-string $id
|
||||
* @param class-string $id
|
||||
*/
|
||||
private function build(string $id): object
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user