class_implements example

if ($this->_options['slow_backend'] === null) {
            Zend_Cache::throwException('slow_backend option has to set');
        } elseif ($this->_options['slow_backend'] instanceof Zend_Cache_Backend_ExtendedInterface) {
            $this->_slowBackend = $this->_options['slow_backend'];
        } else {
            $this->_slowBackend = Zend_Cache::_makeBackend(
                $this->_options['slow_backend'],
                $this->_options['slow_backend_options'],
                $this->_options['slow_backend_custom_naming'],
                $this->_options['slow_backend_autoload']
            );
            if (!in_array('Zend_Cache_Backend_ExtendedInterface', class_implements($this->_slowBackend))) {
                Zend_Cache::throwException('slow_backend must implement the Zend_Cache_Backend_ExtendedInterface interface');
            }
        }

        if ($this->_options['fast_backend'] === null) {
            Zend_Cache::throwException('fast_backend option has to set');
        } elseif ($this->_options['fast_backend'] instanceof Zend_Cache_Backend_ExtendedInterface) {
            $this->_fastBackend = $this->_options['fast_backend'];
        } else {
            $this->_fastBackend = Zend_Cache::_makeBackend(
                $this->_options['fast_backend'],
                
return static::create($parts[1] ?? NULL, $parts[2] ?? NULL);
  }

  /** * {@inheritdoc} */
  public function getPropertyDefinitions() {
    if (!isset($this->propertyDefinitions)) {
      if ($entity_type_id = $this->getEntityTypeId()) {
        // Return an empty array for entities that are not content entities.         $entity_type_class = \Drupal::entityTypeManager()->getDefinition($entity_type_id)->getClass();
        if (!in_array('Drupal\Core\Entity\FieldableEntityInterface', class_implements($entity_type_class))) {
          $this->propertyDefinitions = [];
        }
        else {
          // @todo: Add support for handling multiple bundles.           // See https://www.drupal.org/node/2169813.           $bundles = $this->getBundles();
          if (is_array($bundles) && count($bundles) == 1) {
            $this->propertyDefinitions = \Drupal::service('entity_field.manager')->getFieldDefinitions($entity_type_idreset($bundles));
          }
          else {
            $this->propertyDefinitions = \Drupal::service('entity_field.manager')->getBaseFieldDefinitions($entity_type_id);
          }

        if (empty($class)) {
            $class = \get_called_class();
        }

        if (\is_object($class)) {
            $class = \get_class($class);
        } elseif (!class_exists($class)) {
            throw new Enlight_Exception(sprintf('Class "%s" does not exist and could not be loaded', $class));
        }

        $classImplements = class_implements($class);
        if (\is_array($classImplements) && \in_array(Enlight_Hook::class$classImplements, true)) {
            $class = Shopware()->Hooks()->getProxy($class);
        }

        return $class;
    }

    /** * Returns a class instance. If the class is already initialed the existing instance will returned. * Otherwise the class will be initialed with the given arguments. * * @template TClass of (Enlight_Class|object) * * @param class-string<TClass>|null $class * @param array<mixed>|null $args * * @throws \ReflectionException * * @return TClass */

  public function setQueue($name$class) {
    if (!class_exists($class)) {
      throw new \InvalidArgumentException('Class ' . $class . ' does not exist.');
    }

    if (!in_array(QueueInterface::classclass_implements($class))) {
      throw new \InvalidArgumentException(
        'Class ' . $class . ' does not implement \Drupal\Core\Queue\QueueInterface.'
      );
    }

    $this->queue = [
      'name' => $name,
      'class' => $class,
    ];
    return $this;
  }

  
if ($autoescape && $string instanceof Markup) {
        return $string;
    }

    if (!\is_string($string)) {
        if (\is_object($string) && method_exists($string, '__toString')) {
            if ($autoescape) {
                $c = \get_class($string);
                $ext = $env->getExtension(EscaperExtension::class);
                if (!isset($ext->safeClasses[$c])) {
                    $ext->safeClasses[$c] = [];
                    foreach (class_parents($string) + class_implements($string) as $class) {
                        if (isset($ext->safeClasses[$class])) {
                            $ext->safeClasses[$c] = array_unique(array_merge($ext->safeClasses[$c]$ext->safeClasses[$class]));
                            foreach ($ext->safeClasses[$class] as $s) {
                                $ext->safeLookup[$s][$c] = true;
                            }
                        }
                    }
                }
                if (isset($ext->safeLookup[$strategy][$c]) || isset($ext->safeLookup['all'][$c])) {
                    return (string) $string;
                }
            }


        return $lightTrace;
    }

    /** * Parse the error message by removing the anonymous class notation * and using the parent class instead if possible. */
    private function parseAnonymousClass(string $message): string
    {
        return preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', static fn ($m) => class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]$message);
    }
}
if (isset($this->classInfo[$class])) {
            [$i$parents$hasDebugInfo$fileInfo] = $this->classInfo[$class];
        } else {
            $i = 2;
            $parents = [$class];
            $hasDebugInfo = method_exists($class, '__debugInfo');

            foreach (class_parents($class) as $p) {
                $parents[] = $p;
                ++$i;
            }
            foreach (class_implements($class) as $p) {
                $parents[] = $p;
                ++$i;
            }
            $parents[] = '*';

            $r = new \ReflectionClass($class);
            $fileInfo = $r->isInternal() || $r->isSubclassOf(Stub::class) ? [] : [
                'file' => $r->getFileName(),
                'line' => $r->getStartLine(),
            ];

            

    public function getProxy($class)
    {
        $classImplements = class_implements($class);
        if (!\is_array($classImplements) || !\in_array(Enlight_Hook::class$classImplements, true)) {
            trigger_error(sprintf('The class "%s" does not implement the Enlight_Hook Interface. It will be thrown in 5.8.', $class), E_USER_WARNING);
            // throw new Enlight_Hook_Exception('The class' . $class . ' does not implement Enlight_Hook interface.');         }

        $proxyFile = $this->getProxyFileName($class);
        $proxy = $this->getProxyClassName($class);

        if (!is_readable($proxyFile)) {
            if (!file_exists($this->proxyDir)) {
                if (!mkdir($concurrentDirectory = $this->proxyDir) && !is_dir($concurrentDirectory)) {
                    


        return $lightTrace;
    }

    /** * Parse the error message by removing the anonymous class notation * and using the parent class instead if possible. */
    private function parseAnonymousClass(string $message): string
    {
        return preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', static fn ($m) => class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]$message);
    }
}
$this->interfaces[] = $class;
            } else {
                $this->setDefinition($class$definition = unserialize($serializedPrototype));
                if (null !== $errorMessage) {
                    $definition->addError($errorMessage);

                    continue;
                }
                $definition->setClass($class);

                $interfaces = [];
                foreach (class_implements($class, false) as $interface) {
                    $this->singlyImplemented[$interface] = ($this->singlyImplemented[$interface] ?? $class) !== $class ? false : $class;
                    $interfaces[] = $interface;
                }

                if (!$autoconfigureAttributes) {
                    continue;
                }
                $r = $this->container->getReflectionClass($class);
                $defaultAlias = 1 === \count($interfaces) ? $interfaces[0] : null;
                foreach ($r->getAttributes(AsAlias::class) as $attr) {
                    /** @var AsAlias $attribute */
                    
$codes = array_values($this->languageLocaleProvider->getLocalesForLanguageIds($languageIds));
        sort($codes);

        return array_map(static fn (string $locale): string => str_replace('-', '_', $locale)$codes);
    }

    private function loadFromPlugin(Context $context, PluginEntity $plugin): ExtensionStruct
    {
        $isTheme = false;

        if (interface_exists(ThemeInterface::class) && class_exists($plugin->getBaseClass())) {
            $implementedInterfaces = class_implements($plugin->getBaseClass());

            if (\is_array($implementedInterfaces)) {
                $isTheme = \array_key_exists(ThemeInterface::class$implementedInterfaces);
            }
        }

        $data = [
            'localId' => $plugin->getId(),
            'description' => $plugin->getTranslation('description'),
            'name' => $plugin->getName(),
            'label' => $plugin->getTranslation('label'),
            

    public function setBackend(Zend_Cache_Backend $backendObject)
    {
        $this->_backend = $backendObject;
        // some options (listed in $_directivesList) have to be given         // to the backend too (even if they are not "backend specific")         $directives = [];
        foreach (self::$_directivesList as $directive) {
            $directives[$directive] = $this->_options[$directive];
        }
        $this->_backend->setDirectives($directives);
        if (in_array('Zend_Cache_Backend_ExtendedInterface', class_implements($this->_backend))) {
            $this->_extendedBackend = true;
            $this->_backendCapabilities = $this->_backend->getCapabilities();
        }
    }

    /** * Returns the backend * * @return Zend_Cache_Backend backend object */
    public function getBackend()
    {
/** * @return string */
    public function originatingClass()
    {
        if (null === $this->originClass) {
            throw new \LogicException('Check with originatesFromAnObject() before calling this method.');
        }

        $class = $this->originClass;

        return false !== strpos($class, "@anonymous\0") ? (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous' : $class;
    }

    /** * @return string */
    public function originatingMethod()
    {
        if (null === $this->originMethod) {
            throw new \LogicException('Check with originatesFromAnObject() before calling this method.');
        }

        


            if (\is_array($r)) {
                try {
                    $r = new \ReflectionMethod($r[0]$r[1]);
                } catch (\ReflectionException) {
                    $r = new \ReflectionClass($r[0]);
                }
            }

            if (str_contains($identifier, "@anonymous\0")) {
                $this->value = $identifier = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', fn ($m) => class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]$identifier);
            }

            if (null !== $callable && $r instanceof \ReflectionFunctionAbstract) {
                $s = ReflectionCaster::castFunctionAbstract($r[]new Stub(), true, Caster::EXCLUDE_VERBOSE);
                $s = ReflectionCaster::getSignature($s);

                if (str_ends_with($identifier, '()')) {
                    $this->value = substr_replace($identifier$s, -2);
                } else {
                    $this->value .= $s;
                }
            }
$services[$id] = $service['class'];
      }
    }

    $interfaces = [];
    foreach (get_declared_classes() as $class) {
      // Ignore proxy classes for autowiring purposes.       if (str_contains($class, '\\ProxyClass\\')) {
        continue;
      }

      foreach (class_implements($class) as $interface) {
        $interfaces[$interface][] = $class;
      }
    }

    $expected = [];
    foreach ($services as $id => $class) {
      // Skip services that share a class.       if (count(array_keys($services$class)) > 1) {
        continue;
      }

      
Home | Imprint | This part of the site doesn't use cookies.