@param TypeInterface $type

@return array
492846
public function formatMessageForBroadcast (TypeInterface $type)
    {
        $json = ['msgtype' => $type->getType()];

        $method = 'format' . ucfirst($type->getType()) . 'ForBroadcast';
        if (method_exists($this, $method)) {
            $json[$type->getType()] = $this->$method($type);
        } elseif ($type instanceof Uploaded) {
            $json[$type->getType()] = ['media_id' => $type->getMediaID()];
        }

        return $json;
    }
442335
public function getTypePreferences($interfaceOrAbstract)
        {
            $key = ($this->hasAlias($interfaceOrAbstract)) ? 'alias:' . $interfaceOrAbstract : $interfaceOrAbstract;

            if (isset($this->typePreferences[$key])) {
                return $this->typePreferences[$key];
            }

            return [];
        }
839341
public function getCallbacksByType($type)
    {
        if (array_key_exists($type, $this->callbacks) && count($this->callbacks[$type]) > 0) {
            return $this->callbacks[$type];
        }

        return [];
    }
875917
public function getFlagsOfType($type)
    {
        if ($this->flags === null) {
            return [];
        }

        $matches = [];

        foreach ($this->flags as $flag) {
            if ($flag->type == $type) {
                $matches []= $flag;
            }
        }

        return $matches;
    }
19679
protected function getOptions(FieldTypeInterface $field)
    {
        $options = parent::getOptions($field);

        $options['items'] = array_map(function ($id) {
            return [
                'attributes' => wp_prepare_attachment_for_js($id),
                'id' => $id
            ];
        }, (array) $field->getValue());

        return $options;
    }
1230764
public static function getOperators($type)
    {
        if (!in_array($type, self::getTypes())) {
            return [];
        }

        $source = snake_case($type).'_operators';

        return self::$$source;
    }
551729
public function getTypeOperations( string $type ): array {
		return array_intersect_key(
			$this->getArrayCopy(),
			array_flip( $this->typePointers[$type] )
		);
	}
613127
private function getNormalizer(TypeInterface $type)
    {
        $type = (string) $type->getType();

        if (isset($this->normalizers[$type])) {
            return $this->normalizers[$type];
        }

        return null;
    }
740965
public function getType($type)
    {
        $type = ltrim($type, '\\');
        if (isset($this->classes[$type])) {
            return $this->classes[$type];
        } elseif (isset($this->interfaces[$type])) {
            return $this->interfaces[$type];
        } elseif (isset($this->traits[$type])) {
            return $this->traits[$type];
        }

        return null;
    }
1137531
public function get($type = null)
    {
        $result = [];

        foreach ($this->session[$this->prefix] as $offset => $message) {
            if ($type === null || $message['type'] === $type) {
                $result[] = $message;
                unset($this->session[$this->prefix][$offset]);
            }
        }

        return $result;
    }
329256
private function getTypeList($type)
    {
        $typeList = [];

        $counter = 1;
        while ($type !== 0) {
            if (($type & $counter) !== 0) {
                $typeList[] = $counter;
            }
            $type &= ~$counter;
            $counter <<= 1;
        }
        if (0 === count($typeList)) {
            $typeList[] = HolidayType::OTHER;
        }

        return $typeList;
    }
624032
protected function typeToJsonLd(Type\TypeInterface $type)
    {
        $typeName = (new \ReflectionClass($type))->getShortName();
        if (strlen($typeName) > 4 && substr($typeName, -4) === 'Type') {
            $typeName = substr($typeName, 0, -4);
        }

        $jsonLd = [
            '@type' => $typeName,
        ];

        if ($type->getId()) {
            $jsonLd['@id'] = $type->getId();
        }

        $publicMethods = (new \ReflectionClass($type))->getMethods(\ReflectionMethod::IS_PUBLIC);
        foreach ($publicMethods as $method) {
            $methodName = $method->getName();
            if (substr($methodName, 0, 3) !== 'get') {
                continue;
            }

            $key = lcfirst(substr($methodName, 3));
            if ($key == 'itemListElements') {
                $key = 'itemListElement';
            }

            $value = $type->$methodName();
            if (in_array($methodName, ['getId', 'getSchemaUrl']) || $value === null) {
                continue;
            } elseif (is_array($value)) {
                $jsonLd[$key] = [];
                foreach ($value as $item) {
                    $jsonLd[$key][] = $this->valueToJsonLd($item);
                }
            } else {
                $jsonLd[$key] = $this->valueToJsonLd($value);
            }
        }

        return $jsonLd;
    }
927116
public function get(string $type): array
    {
        if (isset($this->messages[$type])) {
            $messages = $this->messages[$type];

            // Clear messages
            $this->clear($type);

            return $messages;
        } else {
            return [];
        }
    }
602527
public function get_installed_plugins($type) {
        $this->load_installed_plugins();
        if (isset($this->installedplugins[$type])) {
            return $this->installedplugins[$type];
        }
        return array();
    }
1337541
public function getTypesBySpecification(SpecificationInterface $spec)
    {
        $types = [];

        foreach ($this as $type) {
            /** @var TypeInterface $type */
            if ($spec->isSatisfiedBy($type)) {
                $types[] = $type;
            }
        }

        return $types;
    }
1255123
public function transform(FieldTypeInterface $field)
    {
        return [
            'attributes' => $field->getAttributes(),
            'basename' => $field->getBaseName(),
            'component' => $field->getComponent(),
            'data_type' => $field->getOption('data_type', ''),
            'default' => $field->getOption('data', ''),
            'name' => $field->getName(),
            'options' => $this->getOptions($field),
            'label' => [
                'inner' => $field->getOption('label'),
                'attributes' => $field->getOption('label_attr', [])
            ],
            'theme' => $field->getTheme(),
            'type' => $field->getType(),
            'validation' => [
                'errors' => $field->getOption('errors', true),
                'messages' => $field->errors()->toArray(),
                'placeholder' => $field->getOption('placeholder'),
                'rules' => $field->getOption('rules', '')
            ],
            'value' => 'checkbox' === $field->getType() ? $field->getRawValue() : $field->getValue(''),
        ];
    }
1208378
public function isSatisfiedBy(ReturnType\TypeInterface $type)
    {
        return $type->isRealType() && Types::T_NULL == $type->getDataType();
    }