+
+ /**
+ * Gets bindings.
+ *
+ * @return array
+ */
+ public function getBindings()
+ {
+ return $this->bindings;
+ }
+
+ /**
+ * Sets bindings.
+ *
+ * Bindings map $named or FQCN arguments to values that should be
+ * injected in the matching parameters (of the constructor, of methods
+ * called and of controller actions).
+ *
+ * @param array $bindings
+ *
+ * @return $this
+ */
+ public function setBindings(array $bindings)
+ {
+ foreach ($bindings as $key => $binding) {
+ if (!$binding instanceof BoundArgument) {
+ $bindings[$key] = new BoundArgument($binding);
+ }
+ }
+
+ $this->bindings = $bindings;
+
+ return $this;
+ }
+
+ /**
+ * Add an error that occurred when building this Definition.
+ *
+ * @param string $error
+ */
+ public function addError($error)
+ {
+ $this->errors[] = $error;
+ }
+
+ /**
+ * Returns any errors that occurred while building this Definition.
+ *
+ * @return array
+ */
+ public function getErrors()
+ {
+ return $this->errors;
+ }