type = $type; $this->value = $value; } public function getType(): int { return $this->type; } /** * @return mixed */ public function getValue() { return $this->value; } public static function createFromImplementationClassName(string $implementationClassName): self { if (!$implementationClassName) { throw new LogicException("Bad binding."); } return new self(self::IMPLEMENTATION_CLASS_NAME, $implementationClassName); } public static function createFromServiceName(string $serviceName): self { if (!$serviceName) { throw new LogicException("Bad binding."); } return new self(self::CONTAINER_SERVICE, $serviceName); } /** * @param mixed $value */ public static function createFromValue($value): self { return new self(self::VALUE, $value); } public static function createFromCallback(callable $callback): self { return new self(self::CALLBACK, $callback); } public static function createFromFactoryClassName(string $factoryClassName): self { if (!$factoryClassName) { throw new LogicException("Bad binding."); } return new self(self::FACTORY_CLASS_NAME, $factoryClassName); } }