|
|
@@ -45,7 +45,8 @@ abstract class ObjectRegistry implements Countable, IteratorAggregate
|
|
|
/**
|
|
|
* Map of loaded objects.
|
|
|
*
|
|
|
- * @var TObject[]
|
|
|
+ * @var object[]
|
|
|
+ * @psalm-var TObject[]
|
|
|
*/
|
|
|
protected $_loaded = [];
|
|
|
|
|
|
@@ -71,7 +72,8 @@ abstract class ObjectRegistry implements Countable, IteratorAggregate
|
|
|
*
|
|
|
* @param string $objectName The name/class of the object to load.
|
|
|
* @param array $config Additional settings to use when loading the object.
|
|
|
- * @return TObject
|
|
|
+ * @return mixed
|
|
|
+ * @psalm-return TObject
|
|
|
* @throws \Exception If the class cannot be found.
|
|
|
*/
|
|
|
public function load(string $objectName, array $config = [])
|
|
|
@@ -181,10 +183,12 @@ abstract class ObjectRegistry implements Countable, IteratorAggregate
|
|
|
* This method should construct and do any other initialization logic
|
|
|
* required.
|
|
|
*
|
|
|
- * @param string|TObject $class The class to build.
|
|
|
+ * @param string|object $class The class to build.
|
|
|
* @param string $alias The alias of the object.
|
|
|
* @param array $config The Configuration settings for construction
|
|
|
- * @return TObject
|
|
|
+ * @return object
|
|
|
+ * @psalm-param string|TObject $class
|
|
|
+ * @psalm-return TObject
|
|
|
*/
|
|
|
abstract protected function _create($class, string $alias, array $config);
|
|
|
|
|
|
@@ -213,8 +217,9 @@ abstract class ObjectRegistry implements Countable, IteratorAggregate
|
|
|
* Get loaded object instance.
|
|
|
*
|
|
|
* @param string $name Name of object.
|
|
|
- * @return TObject Object instance.
|
|
|
+ * @return object Object instance.
|
|
|
* @throws \RuntimeException If not loaded or found.
|
|
|
+ * @psalm-return TObject
|
|
|
*/
|
|
|
public function get(string $name)
|
|
|
{
|
|
|
@@ -229,7 +234,8 @@ abstract class ObjectRegistry implements Countable, IteratorAggregate
|
|
|
* Provide public read access to the loaded objects
|
|
|
*
|
|
|
* @param string $name Name of property to read
|
|
|
- * @return TObject|null
|
|
|
+ * @return object|null
|
|
|
+ * @psalm-return TObject|null
|
|
|
*/
|
|
|
public function __get(string $name)
|
|
|
{
|
|
|
@@ -251,7 +257,8 @@ abstract class ObjectRegistry implements Countable, IteratorAggregate
|
|
|
* Sets an object.
|
|
|
*
|
|
|
* @param string $name Name of a property to set.
|
|
|
- * @param TObject $object Object to set.
|
|
|
+ * @param object $object Object to set.
|
|
|
+ * @psalm-param TObject $object
|
|
|
* @return void
|
|
|
*/
|
|
|
public function __set(string $name, $object): void
|
|
|
@@ -320,7 +327,8 @@ abstract class ObjectRegistry implements Countable, IteratorAggregate
|
|
|
* be attached into the event manager
|
|
|
*
|
|
|
* @param string $objectName The name of the object to set in the registry.
|
|
|
- * @param TObject $object instance to store in the registry
|
|
|
+ * @param object $object instance to store in the registry
|
|
|
+ * @psalm-param TObject $object
|
|
|
* @return $this
|
|
|
*/
|
|
|
public function set(string $objectName, object $object)
|