blob: 1fc7fc15932fa4b5cb8872ba1219a187a8a863d8 [file] [log] [blame]
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +02001<?php
2
3namespace Illuminate\Contracts\Container;
4
5interface ContextualBindingBuilder
6{
7 /**
8 * Define the abstract target that depends on the context.
9 *
10 * @param string $abstract
11 * @return $this
12 */
13 public function needs($abstract);
14
15 /**
16 * Define the implementation for the contextual binding.
17 *
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010018 * @param \Closure|string|array $implementation
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020019 * @return void
20 */
21 public function give($implementation);
22
23 /**
24 * Define tagged services to be used as the implementation for the contextual binding.
25 *
26 * @param string $tag
27 * @return void
28 */
29 public function giveTagged($tag);
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +010030
31 /**
32 * Specify the configuration item to bind as a primitive.
33 *
34 * @param string $key
35 * @param ?string $default
36 * @return void
37 */
38 public function giveConfig($key, $default = null);
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020039}