Vous êtes connecté en tant que anonymous Se Deconnecter
Browse code

Application modulaire fonctionnelle !

Emmanuel ROY authored on 12/08/2019 15:10:25
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,70 +0,0 @@
1
-<?php
2
-
3
-namespace Illuminate\Container;
4
-
5
-use Illuminate\Support\Arr;
6
-use Illuminate\Contracts\Container\Container;
7
-use Illuminate\Contracts\Container\ContextualBindingBuilder as ContextualBindingBuilderContract;
8
-
9
-class ContextualBindingBuilder implements ContextualBindingBuilderContract
10
-{
11
-    /**
12
-     * The underlying container instance.
13
-     *
14
-     * @var \Illuminate\Contracts\Container\Container
15
-     */
16
-    protected $container;
17
-
18
-    /**
19
-     * The concrete instance.
20
-     *
21
-     * @var string|array
22
-     */
23
-    protected $concrete;
24
-
25
-    /**
26
-     * The abstract target.
27
-     *
28
-     * @var string
29
-     */
30
-    protected $needs;
31
-
32
-    /**
33
-     * Create a new contextual binding builder.
34
-     *
35
-     * @param  \Illuminate\Contracts\Container\Container  $container
36
-     * @param  string|array  $concrete
37
-     * @return void
38
-     */
39
-    public function __construct(Container $container, $concrete)
40
-    {
41
-        $this->concrete = $concrete;
42
-        $this->container = $container;
43
-    }
44
-
45
-    /**
46
-     * Define the abstract target that depends on the context.
47
-     *
48
-     * @param  string  $abstract
49
-     * @return $this
50
-     */
51
-    public function needs($abstract)
52
-    {
53
-        $this->needs = $abstract;
54
-
55
-        return $this;
56
-    }
57
-
58
-    /**
59
-     * Define the implementation for the contextual binding.
60
-     *
61
-     * @param  \Closure|string  $implementation
62
-     * @return void
63
-     */
64
-    public function give($implementation)
65
-    {
66
-        foreach (Arr::wrap($this->concrete) as $concrete) {
67
-            $this->container->addContextualBinding($concrete, $this->needs, $implementation);
68
-        }
69
-    }
70
-}
Browse code

initial commit

Emmanuel ROY authored on 09/08/2019 08:39:02
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,70 @@
1
+<?php
2
+
3
+namespace Illuminate\Container;
4
+
5
+use Illuminate\Support\Arr;
6
+use Illuminate\Contracts\Container\Container;
7
+use Illuminate\Contracts\Container\ContextualBindingBuilder as ContextualBindingBuilderContract;
8
+
9
+class ContextualBindingBuilder implements ContextualBindingBuilderContract
10
+{
11
+    /**
12
+     * The underlying container instance.
13
+     *
14
+     * @var \Illuminate\Contracts\Container\Container
15
+     */
16
+    protected $container;
17
+
18
+    /**
19
+     * The concrete instance.
20
+     *
21
+     * @var string|array
22
+     */
23
+    protected $concrete;
24
+
25
+    /**
26
+     * The abstract target.
27
+     *
28
+     * @var string
29
+     */
30
+    protected $needs;
31
+
32
+    /**
33
+     * Create a new contextual binding builder.
34
+     *
35
+     * @param  \Illuminate\Contracts\Container\Container  $container
36
+     * @param  string|array  $concrete
37
+     * @return void
38
+     */
39
+    public function __construct(Container $container, $concrete)
40
+    {
41
+        $this->concrete = $concrete;
42
+        $this->container = $container;
43
+    }
44
+
45
+    /**
46
+     * Define the abstract target that depends on the context.
47
+     *
48
+     * @param  string  $abstract
49
+     * @return $this
50
+     */
51
+    public function needs($abstract)
52
+    {
53
+        $this->needs = $abstract;
54
+
55
+        return $this;
56
+    }
57
+
58
+    /**
59
+     * Define the implementation for the contextual binding.
60
+     *
61
+     * @param  \Closure|string  $implementation
62
+     * @return void
63
+     */
64
+    public function give($implementation)
65
+    {
66
+        foreach (Arr::wrap($this->concrete) as $concrete) {
67
+            $this->container->addContextualBinding($concrete, $this->needs, $implementation);
68
+        }
69
+    }
70
+}