Returns types of a given class

@param TypeDoc[] $types
@param string $navClasses
@return array
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;
    }
1209253
public function getClasses($type)
    {
        if (!is_string($type) || !isset($this->algos[$type])) {
            throw new \InvalidArgumentException();
        }
        return $this->algos[$type];
    }
48210
public function defaultTypes(array $types = null)
    {
        deprecationWarning(
            'TypeMapTrait::defaultTypes() is deprecated. ' .
            'Use TypeMapTrait::setDefaultTypes()/getDefaultTypes() instead.'
        );
        if ($types !== null) {
            return $this->setDefaultTypes($types);
        }

        return $this->getDefaultTypes();
    }
969741
protected function getAdminExtensionReferenceByTypes(array $types)
    {
        $references = [];
        foreach ($types as $type) {
            $references[$type] = new Reference('sonata_translation.admin.extension.'.$type.'_translatable');
        }

        return $references;
    }
1232652
private function doClear(array $types)
    {
        $cleared = [];
        $this->mf->enableCache(false);

        foreach ($types as $type) {
            $metadata = $this->mf->getMetadataForType($type);
            $this->mf->getCache()->evictMetadataFromCache($metadata);
            $cleared[] = $type;
        }

        $this->mf->enableCache(true);
        $this->mf->clearMemory();
        return $cleared;
    }
15059
protected function removeImpossibleArraySubtypes(array $types): array
    {
        $subTypes = $this->getSubTypes();

        if (count($subTypes) === 0) {
            return $types;
        }

        $subHandler = $this->setTypes($subTypes);

        foreach ($this->value as $item) {
            $subHandler = $subHandler->setTypes($subHandler->getPossibleTypes($item));
        }

        $possibleSubTypes = $subHandler->types;

        return count($possibleSubTypes) === count($subTypes)
            ? $types
            : array_filter($types, function($type) use ($possibleSubTypes) {
                return substr($type, -2) !== '[]' || in_array(substr($type, 0, -2), $possibleSubTypes);
            });
    }
948579
protected function _getBtnClasses(array $attrs = array())
    {
        if (Arr::key('button', $attrs)) {
            $classes = array($this->_btm);
            foreach ((array) $attrs['button'] as $btn) {
                $classes[] = $this->_btm . '-' . $btn;
            }

            $attrs = $this->_mergeAttr($attrs, implode(' ', $classes));
            unset($attrs['button']);
        }

        return $attrs;
    }
347568
public function getNodeTypes($includeAbstractNodeTypes = true)
    {
        if ($this->cachedNodeTypes === []) {
            $this->loadNodeTypes();
        }
        if ($includeAbstractNodeTypes) {
            return $this->cachedNodeTypes;
        }

        $nonAbstractNodeTypes = array_filter($this->cachedNodeTypes, function ($nodeType) {
            return !$nodeType->isAbstract();
        });

        return $nonAbstractNodeTypes;
    }
292118
public function getTypes() {
		$types = $this->find()
			->select(['type'])
			->distinct('type')
			->order('type ASC')
			->disableHydration()
			->toArray();

		return Hash::combine($types, '{n}.type', '{n}.type');
	}
700277
public function get_type( $type ) {
		$tokens = [];

		foreach ( $this->text as $index => $token ) {
			if ( $token->type === $type ) {
				$tokens[ $index ] = $token;
			}
		}

		return $tokens;
	}
1282123
public function getImports($types = 0x000000) {
    $imports = clone $this->ownImports;
    
    // props
    foreach ($this->getProperties() as $property) {
      if ($property->getType() instanceof ObjectType && $property->getType()->hasClass()) {
        $imports->add(new GClass($property->getType()->getClassFQN())); // translate back to GClass (because this can be a simple ClassInterface - class)
      }
    }
    
    // methods
    foreach ($this->getMethods() as $method) {
      foreach ($method->getParameters() as $parameter) {
        if ($parameter->getType() instanceof ObjectType && $parameter->getType()->hasClass()) {
          $imports->add(new GClass($parameter->getType()->getClassFQN())); // translate back
        }
      }
    }
    
    if ($types & self::WITH_EXTENDS && $this->parentClass != NULL) {
      $imports->add($this->parentClass);
    }
    
    // interfaces
    if ($types & self::WITH_INTERFACE) {
      foreach ($this->getInterfaces() as $interface) {
        $imports->add($interface);
      }
    }
    
    return $imports;
  }
1215461
public static <T> Class<?>[] getClasses(Type[] types) {
        if (types == null)
            return null;
        if (types.length == 0)
            return new Class<?>[0];

        Class<?>[] classes = new Class[types.length];
        // Resolve types by chasing down type variables.
        for (int i = 0; i < types.length; i++) {
            classes[i] = getClass(types[i]);
        }
        return classes;
    }
433633
public List<Class<?>> getRawTypes(List<DomainObjectType> types) {
		List<Class<?>> resultList = new ArrayList<Class<?>>();
		for (DomainObjectType type : types) {
			resultList.add(type.getType());
		}
		return resultList;
	}
304677
private function resolveTypes($type)
    {
        $sortTypes = [];

        do {
            $sortTypes[] = $sortType = $this->sortRegistry[$type];
        } while (($type = $sortType->getParent()) !== null);

        return $sortTypes;
    }
1070711
private function getTypeClassInstance(string $type)
    {
        $classname = isset($this->classesMap[$type]) ? $this->classesMap[$type]['class'] : false;

        return $classname ? new $classname() : false;
    }
404348
public function getItemsByTypes(array $types): array
    {
        return array_filter(
            $this->getItems(),
            function (Item $item) use ($types) {
                return in_array(
                    $item->getType(),
                    $types
                );
            }
        );
    }
16125
protected function checkClass($value, array $types): ?string
    {
        if (!is_object($value)) {
            return null;
        }

        foreach ($types as $type) {
            if (class_exists($type) && is_a($value, $type)) {
                return $type;
            }
        }

        return null;
    }