ContextualBindingBuilder.php 890 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Illuminate\Contracts\Container;
  3. interface ContextualBindingBuilder
  4. {
  5. /**
  6. * Define the abstract target that depends on the context.
  7. *
  8. * @param string $abstract
  9. * @return $this
  10. */
  11. public function needs($abstract);
  12. /**
  13. * Define the implementation for the contextual binding.
  14. *
  15. * @param \Closure|string|array $implementation
  16. * @return void
  17. */
  18. public function give($implementation);
  19. /**
  20. * Define tagged services to be used as the implementation for the contextual binding.
  21. *
  22. * @param string $tag
  23. * @return void
  24. */
  25. public function giveTagged($tag);
  26. /**
  27. * Specify the configuration item to bind as a primitive.
  28. *
  29. * @param string $key
  30. * @param mixed $default
  31. * @return void
  32. */
  33. public function giveConfig($key, $default = null);
  34. }