Validates the given plugin class name.

@param string $pluginClass The fully qualified name of a plugin class.
15621
private function validatePluginClass($pluginClass)
    {
        if (!class_exists($pluginClass)) {
            throw new InvalidConfigException(sprintf(
                'The plugin class %s does not exist.',
                $pluginClass
            ));
        }

        if (!in_array('Puli\Manager\Api\PuliPlugin', class_implements($pluginClass))) {
            throw new InvalidConfigException(sprintf(
                'The plugin class %s must implement PuliPlugin.',
                $pluginClass
            ));
        }
    }
1161803
private function completeMappingTypeValidation($className, ClassMetadataInfo $class)
    {
        foreach ($class->fieldMappings as $fieldName => $mapping) {
            if (Type::hasType($mapping['type'])) {
                continue;
            }

            // Support type as a mapped class?
            if (!$this->hasMetadataFor($mapping['type']) && !$this->getMetadataFor($mapping['type'])) {
                throw MappingException::fieldTypeNotFound($className, $fieldName, $mapping['type']);
            }

            // Mapped classes must have binding node type XML_ELEMENT
            if ($mapping['node'] !== ClassMetadataInfo::XML_ELEMENT) {
                throw MappingException::customTypeWithoutNodeElement($className, $fieldName);
            }
        }
    }
66233
protected function validatePlugins(): void
    {
        $plugins = array_filter($this->getActivePlugins(), function ($plugin) {
            return file_exists(WPMU_PLUGIN_DIR.'/'.$plugin);
        });

        if (array_diff($plugins, $this->getActivePlugins())) {
            $this->setActivePlugins($plugins);
        }
    }
989431
public function getPlugin($class)
		{
		static $index = null;
		if (is_null($index))
			{
			$index = array();
			for ($i = 0, $l = count($this->plugins); $i < $l; $i++)
				{
				$index[get_class($this->plugins[$i])] = $i;
				}
			}
		return isset($index[$class]) ? $this->plugins[$index[$class]] : false;
		}
276745
public function validatePlugin($plugin)
    {
        if ($plugin instanceof DomainServiceInterface) {
            return; // we're okay
        }

        throw new \InvalidArgumentException(sprintf(
            'Can\'t create domain service for %s; '
                . 'Domain service must implement %s',
            (is_object($plugin) ? get_class($plugin) : gettype($plugin)),
            DomainServiceInterface::class
        ));
    }
1351729
function validateService($pluginInstance)
    {
        if (!is_object($pluginInstance))
            throw new \Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));

        if (!$pluginInstance instanceof iGuard)
            throw new exContainerInvalidServiceType('Invalid Plugin Of Content Object Provided.');

    }
928379
public function validate($plugin)
    {
        if (! $plugin instanceof $this->instanceOf) {
            throw new InvalidServiceException(sprintf(
                '%s expects only to create instances of %s; %s is invalid',
                get_class($this),
                $this->instanceOf,
                (is_object($plugin) ? get_class($plugin) : gettype($plugin))
            ));
        }
    }
859478
protected function validateRuntimeMetadata($class, $parent)
    {
        if ( ! $class->reflClass ) {
            // only validate if there is a reflection class instance
            return;
        }

        $class->validateIdentifier();
        $class->validateAssociations();
        $class->validateLifecycleCallbacks($this->getReflectionService());

        // verify inheritance
        if ( ! $class->isMappedSuperclass && !$class->isInheritanceTypeNone()) {
            if ( ! $parent) {
                if (count($class->discriminatorMap) == 0) {
                    throw MappingException::missingDiscriminatorMap($class->name);
                }
                if ( ! $class->discriminatorColumn) {
                    throw MappingException::missingDiscriminatorColumn($class->name);
                }
            }
        } else if ($class->isMappedSuperclass && $class->name == $class->rootEntityName && (count($class->discriminatorMap) || $class->discriminatorColumn)) {
            // second condition is necessary for mapped superclasses in the middle of an inheritance hierarchy
            throw MappingException::noInheritanceOnMappedSuperClass($class->name);
        }
    }
1250233
public function assertValidChildClass(self $class)
    {
        if ($this->isLeaf()) {
            throw new OutOfBoundsException(sprintf(
                'Document "%s" has been mapped as a leaf. It cannot have children',
                $this->name
            ));
        }

        $childClasses = $this->getChildClasses();

        if (0 === count($childClasses)) {
            return;
        }

        foreach ($childClasses as $childClass) {
            if ($class->name === $childClass || $class->reflClass->isSubclassOf($childClass)) {
                return;
            }
        }

        throw new OutOfBoundsException(sprintf(
            'Document "%s" does not allow children of type "%s". Allowed child classes "%s"',
            $this->name,
            $class->name,
            implode('", "', $childClasses)
        ));
    }
179102
public static function isSubclassOf($class, $parent)
    {
        if (! is_subclass_of($class, $parent)) {
            if (is_object($class)) {
                $class = get_class($class);
            }
            self::isString($class);
            if ($class === $parent) {
                return;
            }
            if (! class_exists($class)) {
                throw new InvalidArgumentException('Class not found: ' . $class);
            }
            throw new InvalidArgumentException('Class ' . $class . ' should extend ' . $parent);
        }
    }
179160
private function validateChildClass(NodeInterface $parentNode, ClassMetadata $class)
    {
        $parentClass = $this->documentClassMapper->getClassName($this->dm, $parentNode);

        if (null === $parentClass) {
            return;
        }

        $metadata = $this->dm->getClassMetadata($parentClass);
        $metadata->assertValidChildClass($class);
    }
1215719
function validatePlugins (plugins) {
  var type = typeOf(plugins);

  if (type.hasValue) {
    if (type.isArray) {
      // Make sure all the items in the array are valid plugins
      plugins.forEach(validatePlugin);
    }
    else {
      throw ono('Invalid arguments. Expected an array of plugins.');
    }
  }
}
93733
public function validatePlugin($plugin)
    {
        if ($plugin instanceof ObjectManagerInterface) {
            return;
        }

        throw new Exception\RuntimeException(sprintf(
            'Plugin of type %s is invalid; must implement %s',
            (is_object($plugin) ? get_class($plugin) : gettype($plugin)),
            DoctrineObjectManager::class
        ));
    }
398594
public function validatePlugin($plugin)
    {
        if (!$plugin instanceof ModelInterface) {
            throw new Exception\InvalidPluginException(sprintf(
                'Model of type %s is invalid; must implement "%s"',
                (is_object($plugin) ? get_class($plugin) : gettype($plugin)),
                ModelInterface::class
            ));
        }
    }
889742
public void setPropertiesClass(Class<?> propertiesClass) {
        Validate.notNull(propertiesClass);
        setProperty(SOABaseProperty.PROPERTIES_CLASS, propertiesClass.getName());
    }
1318579
public static function is_valid_plugin_name($plugintype, $pluginname) {
        if ($plugintype === 'mod') {
            // Modules must not have the same name as core subsystems.
            if (!isset(self::$subsystems)) {
                // Watch out, this is called from init!
                self::init();
            }
            if (isset(self::$subsystems[$pluginname])) {
                return false;
            }
            // Modules MUST NOT have any underscores,
            // component normalisation would break very badly otherwise!
            return (bool)preg_match('/^[a-z][a-z0-9]*$/', $pluginname);

        } else {
            return (bool)preg_match('/^[a-z](?:[a-z0-9_](?!__))*[a-z0-9]+$/', $pluginname);
        }
    }
224777
private static boolean checkModifiers(Class<? extends AbstractPlugin> pluginClass) {
        int modifiers = pluginClass.getModifiers();
        return !Modifier.isAbstract(modifiers) &&
                !Modifier.isInterface(modifiers) &&
                !Modifier.isPrivate(modifiers);
    }