Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / league / container / src / Definition / AbstractDefinition.php
diff --git a/vendor/league/container/src/Definition/AbstractDefinition.php b/vendor/league/container/src/Definition/AbstractDefinition.php
new file mode 100644 (file)
index 0000000..ff47813
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+
+namespace League\Container\Definition;
+
+use League\Container\Argument\ArgumentResolverInterface;
+use League\Container\Argument\ArgumentResolverTrait;
+use League\Container\ImmutableContainerAwareTrait;
+
+abstract class AbstractDefinition implements ArgumentResolverInterface, DefinitionInterface
+{
+    use ArgumentResolverTrait;
+    use ImmutableContainerAwareTrait;
+
+    /**
+     * @var string
+     */
+    protected $alias;
+
+    /**
+     * @var mixed
+     */
+    protected $concrete;
+
+    /**
+     * @var array
+     */
+    protected $arguments = [];
+
+    /**
+     * Constructor.
+     *
+     * @param string $alias
+     * @param mixed  $concrete
+     */
+    public function __construct($alias, $concrete)
+    {
+        $this->alias     = $alias;
+        $this->concrete  = $concrete;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function withArgument($arg)
+    {
+        $this->arguments[] = $arg;
+
+        return $this;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function withArguments(array $args)
+    {
+        foreach ($args as $arg) {
+            $this->withArgument($arg);
+        }
+
+        return $this;
+    }
+}