Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Commit

Permalink
Remmove collection package
Browse files Browse the repository at this point in the history
  • Loading branch information
holyshared committed Apr 17, 2016
1 parent 2380d34 commit f5f3e44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions composer.json
Expand Up @@ -13,8 +13,7 @@
"symfony/css-selector": "~3.0",
"zendframework/zend-config": "~2.5",
"zendframework/zend-console": "~2.5",
"eloquent/pathogen": "~0.6",
"easyframework/collections": "~4.1"
"eloquent/pathogen": "~0.6"
},
"require-dev": {
"phpspec/prophecy": "~1.5",
Expand Down
13 changes: 6 additions & 7 deletions src/ObjectRegistry.php
Expand Up @@ -10,7 +10,6 @@
*/
namespace coverallskit;

use Collections\Dictionary;
use coverallskit\exception\RegistryNotFoundException;
use ReflectionClass;

Expand All @@ -20,13 +19,13 @@
class ObjectRegistry
{
/**
* @var \Collections\Dictionary
* @var array
*/
private $reflections;
private $reflections = [];

public function __construct()
{
$this->reflections = new Dictionary;
$this->reflections = [];
}

/**
Expand All @@ -39,11 +38,11 @@ public function __construct()
*/
public function get($name, array $arguments = [])
{
if ($this->reflections->containsKey($name) === false) {
if (array_key_exists($name, $this->reflections) === false) {
throw new RegistryNotFoundException("$name not found registry");
}

$reflection = $this->reflections->get($name);
$reflection = $this->reflections[$name];

return $reflection->newInstanceArgs($arguments);
}
Expand All @@ -55,6 +54,6 @@ public function get($name, array $arguments = [])
public function register($name, $class)
{
$reflection = new ReflectionClass($class);
$this->reflections->add($name, $reflection);
$this->reflections[$name] = $reflection;
}
}

0 comments on commit f5f3e44

Please sign in to comment.