@param string $type
@param array  $classes

@return array
490546
private function checkFormClass($type, $classes)
    {
        return array_filter($classes, function ($subclass) use ($type) {
            return is_a($type, $subclass, true);
        });
    }
1251918
public function toggleClasses( array $classes, $toggle = null ) {
		if ( $toggle === null ) {
			$this->classes = array_diff(
				array_merge( $this->classes, $classes ),
				array_intersect( $this->classes, $classes )
			);
		} elseif ( $toggle ) {
			$this->classes = array_merge( $this->classes, $classes );
		} else {
			$this->classes = array_diff( $this->classes, $classes );
		}
		return $this;
	}
947798
public function addClasses(string ...$classes): self
    {
        $this->classes = array_unique(array_merge($this->classes, $classes));

        return $this;
    }
67709
public function postClass($classes = [])
    {
        $classes = !is_array($classes) ? explode(' ', $classes) : $classes;
        $classes[] = 'content-node';

        $classes = apply_filters('novusopress_view_post_classes', get_post_class($classes));
        $output = sprintf('class="%s"', implode(' ', $classes));

        return apply_filters('novusopress_view_post_class_output', $output);
    }
883401
protected function bootstrap(array $classes): array
    {
        foreach ($classes as $index => $class) {
            $classes[$index] = $this->app->make($class)->bootstrap();
        }

        return $classes;
    }
100205
private static function getClassByType($type)
    {
        if (!isset(self::$types[$type])) {
            throw new UnknownMessageException(
                'Unable to parse message because type ('.$type.')'
                .' is not mapped.'
            );
        }

        return self::$types[$type];
    }
927342
public function getClassName(string $type): string
    {
        assert(isset($this->classes[$type]));
        return $this->classes[$type];
    }
697227
private function createConstructor(array $types)
    {
        $classmap = [];

        foreach ($types as $name => $type) {
            if ($type instanceof GeneratorInterface) {
                $classmap[] = sprintf("        '%s' => '%s',", $name, $type->getPhpIdentifier());
            }
        }

        $classmap = implode("\n", $classmap);

        $generator = new MethodGenerator('__construct');
        $generator->setDocBlock('Constructor.');
        $generator->setBody(
            <<<CODE
        parent::__construct(\$user->resolveWsdl(self::ENDPOINT), \$dispatcher, \$user, [
    'classmap' => [
{$classmap}
    ]
]);
CODE
        );
        $generator->setParameter($this->createParameter('dispatcher', 'EventDispatcherInterface'));
        $generator->setParameter($this->createParameter('user', 'User'));

        $this->addTag($generator, $this->createParamTag('dispatcher', 'EventDispatcherInterface'));
        $this->addTag($generator, $this->createParamTag('user', 'User'));

        return $generator;
    }
847546
public function dropSchema(array $classes)
    {
        $dropSchemaSql = $this->getDropSchemaSQL($classes);
        $conn          = $this->em->getConnection();

        foreach ($dropSchemaSql as $sql) {
            try {
                $conn->executeQuery($sql);
            } catch (Throwable $e) {
                // ignored
            }
        }
    }
841989
public static function getTypeMap(...$types): array
    {
        $map = [];
        foreach ($types as $type) {
            $map[$type] = self::getTypeDescription($type);
        }

        return $map;
    }
1313583
public function createFromArray(array $types)
    {
        foreach ($types as $type) {
            $this->collection->add(Type::fromString($type));
        }

        return $this->collection;
    }
977447
protected function findClassNameForType($type)
    {
        $className = (isset($this->typeToValueObjectClassName[$type]))
            ? $this->typeToValueObjectClassName[$type]
            : false;

        return $className;
    }
1334456
protected function discoverAnnotations(array $classes) : array {
    AnnotationRegistry::reset();
    AnnotationRegistry::registerLoader('class_exists');

    $reader = $this->createReader();

    $annotations = [];
    foreach ($classes as $class) {
      $reflection = new \ReflectionClass($class);
      if (!$reflection->isSubclassOf($this->serviceInterface)) {
        continue;
      }

      /** @var \dpi\ak\Annotation\AvatarService $annotation */
      $annotation = $reader->getClassAnnotation($reflection, $this->annotationClass);
      if ($annotation) {
        $annotations[$class] = $annotation;
      }
    }

    AnnotationRegistry::reset();

    return $annotations;
  }
1357575
public static function hydrate($class, $results, $type = self::TYPE_COLLECTION , $exists = false)
    {

        if (!class_exists($class)) {
            throw new \Exception("class {$class} not exists!");
        } elseif ($type == self::TYPE_COLLECTION) {
            $models = array();
            foreach ($results as $result) {
                $model = self::pack($class, $result , $exists);
                $models[] = $model;
            }

            return Collection::make($models);
        } else {
            $model = self::pack($class, $results , $exists);
            return $model;
        }

    }
887140
protected function putIntoCache($class, $path, XType $type)
    {
        if (!isset($this->pathCache[$class])) {
            $this->pathCache[$class] = [];
        }

        $this->pathCache[$class][$path] = $type;

        return $type;
    }
423086
protected function filterTypes($types, $navClasses)
    {
        switch ($navClasses) {
            case 'app':
                $types = array_filter($types, function ($val) {
                    return strncmp($val->name, 'yii\\', 4) !== 0;
                });
                break;
            case 'yii':
                $self = $this;
                $types = array_filter($types, function ($val) use ($self) {
                    if ($val->name == 'Yii' || $val->name == 'YiiRequirementChecker') {
                        return true;
                    }
                    if (strlen($val->name) < 5) {
                        return false;
                    }
                    $subName = substr($val->name, 4, strpos($val->name, '\\', 5) - 4);

                    return strncmp($val->name, 'yii\\', 4) === 0 && !in_array($subName, $self->extensions);
                });
                break;
            default:
                $types = array_filter($types, function ($val) use ($navClasses) {
                    return strncmp($val->name, "yii\\$navClasses\\", strlen("yii\\$navClasses\\")) === 0;
                });
        }

        return $types;
    }
813235
private function getClassMatcherFactory($type)
    {
        if (isset($this->classMatcherFactories[$type])) {
            return $this->classMatcherFactories[$type];
        }

        throw new \InvalidArgumentException("Specified ClassMatcher factory '{$type}' is not available.");
    }