Gets a binding for an interface

@param string $interface The interface whose binding we want
@return IBinding|null The binding if one exists, otherwise null
423428
protected function getBinding(string $interface)
    {
        // If there's a targeted binding, use it
        if ($this->currentTarget !== self::$emptyTarget && isset($this->bindings[$this->currentTarget][$interface])) {
            return $this->bindings[$this->currentTarget][$interface];
        }

        // If there's a universal binding, use it
        if (isset($this->bindings[self::$emptyTarget][$interface])) {
            return $this->bindings[self::$emptyTarget][$interface];
        }

        return null;
    }
1345119
public function get_group(event_interface $event) {
        if (is_null($this->groups)) {
            $this->load_groups();
        }

        if ($group = $event->get_group()) {
            $groupid = $group->get('id');
            return isset($this->groups[$groupid]) ? $this->groups[$groupid] : null;
        } else {
            return null;
        }
    }
1200647
public static function getInterface($type)
    {
        if (array_key_exists($type, self::$interfaces)) {
            return self::$interfaces[$type];
        }

        return false;
    }
37718
public function bind($bind, $domain = null)
    {
        $domain = is_null($domain) ? $this->domain : $domain;

        $this->bind[$domain] = $bind;

        return $this;
    }
612168
public function hasInterface($interface): bool {
		if ($interface instanceof PhpInterface) {
			return $this->interfaces->contains($interface->getName())
				|| $this->interfaces->contains($interface->getQualifiedName());
		}

		return $this->interfaces->contains($interface) || $this->hasInterface(new PhpInterface($interface));
	}
390375
public function binding($binding = '')
    {
        // Return value
        if (empty($binding)) {
            return $this->binding;
        }

        // Set value
        $this->binding = $binding;

        return $this;
    }
620698
public function getImplementorMap($interface, $baseClass = null)
    {
        // Create Map Array:
        
        $map = [];
        
        // Define Base Class (if none given):
        
        if (!$baseClass) {
            $baseClass = SiteTree::class;
        }
        
        // Obtain Implementors:
        
        if ($implementors = ClassInfo::implementorsOf($interface)) {
            
            // Filter Implementors:
            
            $records = $baseClass::get()->filter([
                'ClassName' => $implementors
            ])->sort('ClassName');
            
            // Define Map Array:
            
            foreach ($records as $record) {
                $map[$record->ID] = sprintf(
                    '%s (%s)',
                    $record->hasMethod('NestedTitle') ? $record->NestedTitle(5, ' > ') : $record->Title,
                    $record->i18n_singular_name()
                );
            }
            
        }
        
        // Answer Map Array:
        
        return $map;
    }
1146896
public function getSubService($id, $interface = null)
    {
        if (! isset($this->subServices[$id])) {
            if ($this->hasOption($id)) {
                $service = $this->buildService($this->getOption($id), $interface);
                if ($service) {
                    $this->subServices[$id] = $service;
                } else {
                    throw new ServiceNotFoundException($id);
                }
            } else {
                throw new ServiceNotFoundException($id);
            }
        }
        return $this->subServices[$id];
    }
1345044
public function addInterface($interface) {
		if ($interface instanceof PhpInterface) {
			$name = $interface->getName();
			$qname = $interface->getQualifiedName();
			$namespace = $interface->getNamespace();

			if ($namespace != $this->getNamespace()) {
				$this->addUseStatement($qname);
			}
		} else {
			$name = $interface;
		}

		$this->interfaces->add($name);

		return $this;
	}
1034348
public function getInterface(string $name)
    {
        if ($this->hasInterface($name)) {
            return $this->interfaces[$name];
        }
        return null;
    }
1057746
public function getSpi(BindingSessionInterface $session)
    {
        $spi = $session->get(self::SPI_OBJECT);

        if ($spi !== null) {
            return $spi;
        }

        $spiClass = $session->get(SessionParameter::BINDING_CLASS);
        if (empty($spiClass) || !class_exists($spiClass)) {
            throw new CmisRuntimeException(
                sprintf('The given binding class "%s" is not valid!', $spiClass)
            );
        }

        if (!is_a($spiClass, CmisInterface::class, true)) {
            throw new CmisRuntimeException(
                sprintf('The given binding class "%s" does not implement required CmisInterface!', $spiClass)
            );
        }

        try {
            $spi = new $spiClass($session);
        } catch (\Exception $exception) {
            throw new CmisRuntimeException(
                sprintf('Could not create object of type "%s"!', $spiClass),
                null,
                $exception
            );
        }

        $session->put(self::SPI_OBJECT, $spi);

        return $spi;
    }
1125919
public function getValue($type = null)
    {
        $siblings   = $this->getValues($type);
        $resolver   = $this->resolverFactory->getResolver($type);
        $riakObject = $resolver->resolve($siblings);

        return $riakObject;
    }
339873
public function resolve($binding)
    {
        $rawObject = $this->getRaw($binding);

        // If the abstract is not registered, do it now for easy resolution.
        if (is_null($rawObject)) {
            // Pass $binding to both so it doesn't need to check if null again.
            $this->bind($binding, $binding);

			$rawObject = $this->getRaw($binding);
        }

        return $rawObject($this);
    }
772116
public function get(KeyInterface $key)
    {
        $value = $this->connection->get($key->getKeyName());

        return $value === false ? null : $value;
    }
1350503
private function getProvider($identifier)
    {
        if (isset($this->interfaceProviders[$identifier])) {
            $this->assertSingleInterfaceProvider($identifier);
            return reset($this->interfaceProviders[$identifier]);
        } elseif (isset($this->classProviders[$identifier])) {
            $this->assertSingleClassProvider($identifier);
            return reset($this->classProviders[$identifier]);
        } else {
            return false;
        }
    }
886906
private function getIO(InputInterface $input, OutputInterface $output)
    {
        if ($this->io instanceof OutputStyle === false) {
            $this->io = new SymfonyStyle($input, $output);
        }

        return $this->io;
    }
90631
public function implement($interface)
    {
        $message = ['Class %s {{does not implement|implements}} interface %s', $this->value, $interface];
        $this->assert((in_array($interface, class_implements($this->value))), $message);

        return $this;
    }