AliasItem.class.php 864 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Holds the PMA\DI\AliasItem class
  5. *
  6. * @package PMA
  7. */
  8. namespace PMA\DI;
  9. require_once 'libraries/di/Item.int.php';
  10. /**
  11. * Class AliasItem
  12. *
  13. * @package PMA\DI
  14. */
  15. class AliasItem implements Item
  16. {
  17. /** @var Container */
  18. protected $container;
  19. /** @var string */
  20. protected $target;
  21. /**
  22. * Constructor
  23. *
  24. * @param Container $container Container
  25. * @param string $target Target
  26. */
  27. public function __construct(Container $container, $target)
  28. {
  29. $this->container = $container;
  30. $this->target = $target;
  31. }
  32. /**
  33. * Get the target item
  34. *
  35. * @param array $params Parameters
  36. * @return mixed
  37. */
  38. public function get($params = array())
  39. {
  40. return $this->container->get($this->target, $params);
  41. }
  42. }