@param string $id
@param mixed  $default

@return mixed

@throws ContainerExceptionInterface
169358
public function getOrDefault(string $id, $default = null)
    {
        $this->freeze();

        if (!$this->has($id)) {
            return $default;
        }

        return $this->get($id);
    }
1297623
public function get($id, Cargo\Container $container = null) {
        if ($this->container->has($id) || !class_exists($id)) {
            return $this->container->get($id, $container ?: $this);
        }

        $this->add($id, null);
        return $this->get($id, $container);
    }
77686
public function get($identifier, $default = null)
    {
        $value = $this->internalGet($this->configsContainer, $identifier);

        if (is_null($value)) {
            return $default;
        }

        return $value;
    }
305432
public function resolve(ContainerInterface $container, $id, $definition)
    {
        if (is_null($definition)) {
            $definition = $id;
        }

        $reflection = new ReflectionClass($definition);
        if (!$reflection->isInstantiable()) {
            return false;
        }

        $constructor = $reflection->getConstructor();
        if (is_null($constructor)) {
            return $reflection->newInstance();
        }

        $dependencies = [];
        foreach ($constructor->getParameters() as $parameter) {
            $class = $parameter->getClass();
            if (is_null($class)) {
                return false;
            }
            $dependencies[] = $container->get($class->getName());
        };

        return $reflection->newInstanceArgs($dependencies);
    }
1183150
public function getService($id) {
            if (!isset($this->services[$id])) {
                // TODO: execption
                return null;
            }
            if (is_string($this->services[$id])) {
                $this->services[$id] = $this->container->get($this->services[$id]);
            }

            return $this->services[$id];
        }
1360061
final protected function getCategory($id, $default = null)
    {
        if ($id instanceof CategoryInterface) {
            return $id;
        }

        if (is_numeric($id)) {
            return $this->categoryManager->find($id);
        }

        if ($default instanceof CategoryInterface) {
            return $default;
        }

        return null;
    }
104190
public function update(?string $id)
    {
        $url = self::$base_url.'/'.($id ?? $this->container_id).'/update';

        $request = json_encode($request = $this->hostConfig);

        return self::$curl->post($url, $request, self::$header);
    }
955148
public function findByPrimaryId($id) {
		$primary = $this->getPrimaryName();
		
		if ($primary === false) {
			throw new Exceptions\OperationError('Unable to determine the primary identity');
		}
		
		// Many
		if (is_array($id)) {
			if ($primary === self::DEFAULT_PRIMARY) {
				$id = array_map([$this, 'normalizeId'], $id);
			}
			
			return $this->find([$primary => [
				'$in' => $id
			]]);
		}
		
		// One
		if ($primary === self::DEFAULT_PRIMARY) {
			$id = $this->normalizeId($id);
		}
		
		return $this->findFirst([$primary => $id]);
	}
520857
public function getItem($key, $default = null)
    {
        if (isset($this->container[$key])) {
            return $this->container[$key];
        }

        return $default;
    }
173052
public function read( $id ) {

		$id = $this->getKey( $id );

		// If possible use the raw data from the internal cache
		// without unserialization
		if ( $this->internalCache->contains( $id ) ) {
			$data = $this->internalCache->fetch( $id );
		} elseif ( $this->cache->contains( $id ) ) {
			$data = unserialize( $this->cache->fetch( $id ) );
			$this->internalCache->save( $id, $data );
		} else {
			$data = array();
		}

		$container = new Container( $id, (array)$data );
		$container->setExpiryInSeconds( $this->expiry );

		return $container;
	}
36502
private function getParameterValue(string $id, ReflectionParameter $parameter, ContainerInterface $container)
    {
        if (! ($class = $parameter->getClass())) {
            if ($parameter->isDefaultValueAvailable()) {
                // a default value is available so use that
                return $parameter->getDefaultValue();
            }

            // no default, eek
            throw new FatalNotFoundException("Cannot resolve '" . $parameter->getName() . "' for class '" . $id . "'");
        }

        try {
            // attempt to resolve the value
            return $container->get($class->getName());
        } catch (NotFoundException $e) {
            if ($parameter->isDefaultValueAvailable()) {
                // a default value is available so use that
                return $parameter->getDefaultValue();
            }
            throw $e;
        }
    }
1352506
public function findById($id)
    {
        /** @var PluginInstance $pluginInstance */
        $pluginInstance = $this->pluginInstanceRepository->find($id);

        if (empty($pluginInstance)) {
            return null;
        }

        $configFromDb = $pluginInstance->getInstanceConfig();

        $blockConfig = $this->blockConfigRepository->findById($pluginInstance->getPlugin());

        if (empty($blockConfig)) {
            throw new \Exception(
                'Block Config not found for: ' . $pluginInstance->getPlugin()
            );
        }

        $defaultConfig = $blockConfig->getDefaultConfig();
        $mergedConfig = $this->instanceConfigMerger->__invoke($defaultConfig, $configFromDb);

        $blockInstance = $this->getNew(
            $id,
            $pluginInstance->getPlugin(),
            $mergedConfig,
            []
        );

        return $blockInstance;
    }
411331
private function find($id)
    {
        if (! isset($this->registry[$id])) {
            throw new NotFoundException("Entry id '" . $id . "' not found in container");
        }

        return $this->registry[$id];
    }
119107
public function getParameter($name, $default = null)
    {
        if (!$this->getContainer()->hasParameter($name)) {
            return $default;
        }

        return $this->getContainer()->getParameter($name);
    }
461080
public static function get( $key, $default = null ) {
        if ( ! self::has($key) ) {
            if ( $default instanceof FrameworkException ) throw $default;
            return $default;
        }
        
        $key_array = preg_split('/\./', $key );
        $return = self::$data;

        foreach($key_array as $k)
            $return = $return[$k];

        return $return;
    }
249944
protected function mapDefaultContainerParams(ContainerInterface $container): ContainerInterface
    {
        /** @var \SprykerEco\Zed\Payone\Business\Api\Request\Container\AbstractRequestContainer $container */
        $container->setMid($this->standardParameters->getMid());
        $container->setAid($this->standardParameters->getAid());
        $container->setPortalid($this->standardParameters->getPortalId());
        $container->setKey(md5($this->standardParameters->getKey()));
        $container->setMode($this->modeDetector->getMode());
        $container->setIntegratorName(PayoneApiConstants::INTEGRATOR_NAME_SPRYKER);
        $container->setIntegratorVersion(PayoneApiConstants::INTEGRATOR_VERSION_3_0_0);
        $container->setSolutionName(PayoneApiConstants::SOLUTION_NAME_SPRYKER);
        $container->setSolutionVersion(PayoneApiConstants::SOLUTION_VERSION_3_0_0);

        return $container;
    }
1294167
private function getAttribute($id, array $tag, $attributeName, $default = null)
    {
        if (isset($tag[$attributeName])) {
            return $tag[$attributeName];
        }

        if (func_num_args() > 2) {
            return $default;
        }

        throw new \InvalidArgumentException(sprintf(
            'Service "%s" must define the "%s" attribute on "%s" tags.',
            $id, $attributeName, $this->tagName
        ));
    }