ContainerInterface.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. *
  4. * Cube Framework $Id$ 61bYrWQKC9MIAVMpwFFkqgIVkR6QjMcn/MQBYZRQ0VU=
  5. *
  6. * @link http://codecu.be/framework
  7. * @copyright Copyright (c) 2015 CodeCube SRL
  8. * @license http://codecu.be/framework/license Commercial License
  9. *
  10. * @version 1.4
  11. */
  12. /**
  13. * dependency injection container interface
  14. */
  15. namespace Cube\Di;
  16. /**
  17. * Interface ContainerInterface
  18. *
  19. * @package Cube\Di
  20. */
  21. interface ContainerInterface
  22. {
  23. /**
  24. *
  25. * add a new service to the container
  26. *
  27. * @param string $name the name of the service to be saved in the container
  28. * @param mixed $service the service that will be saved
  29. */
  30. public function set($name, $service);
  31. /**
  32. *
  33. * get a service from the container
  34. *
  35. * @param string $name the name of the service that is saved in the container
  36. * @param array $params run the service with these params
  37. */
  38. public function get($name, array $params = array());
  39. /**
  40. *
  41. * check if a service has been saved in the container
  42. *
  43. * @param string $name
  44. */
  45. public function has($name);
  46. /**
  47. *
  48. * remove a service from the container
  49. *
  50. * @param string $name
  51. */
  52. public function remove($name);
  53. /**
  54. *
  55. * clear the container
  56. */
  57. public function clear();
  58. }