Process data-type

@param string    $definition
@param Attribute $attribute
321857
protected function processDataType(string $definition, Attribute $attribute)
    {
        if (! preg_match(self::DATATYPE_PATTERN, $definition, $matches)) {
            throw new \LogicException(sprintf('Data-type definition "%s" is invalid.', $definition));
        }

        $attribute->setType($matches['type']);

        if (! empty($matches['many'])) {
            $attribute->setMany();
        }

        if (empty($matches['params'])) {
            return;
        }

        $parameters = explode(',', $matches['params']);
        $parameters = array_map('trim', $parameters);

        $attribute->setTypeParameters($parameters);
    }
1343485
public function validateMimetypes($attribute, $value, $parameters)
    {
        if (! $this->isValidFileInstance($value)) {
            return false;
        }

        if ($this->shouldBlockPhpUpload($value, $parameters)) {
            return false;
        }

        return $value->getPath() !== '' &&
                (in_array($value->getMimeType(), $parameters) ||
                 in_array(explode('/', $value->getMimeType())[0].'/*', $parameters));
    }
225603
protected function takeAttributeFromDOM($attribute)
    {
        switch ($attribute->localName) {
        case 'state':
            $this->_state = $attribute->nodeValue;
            break;
        default:
            parent::takeAttributeFromDOM($attribute);
        }
    }
278207
protected function validateAttribute($object, $attribute)
    {
        $method = $this->method;
        $object->{$method}($attribute, $this->params);
    }
420254
protected function mergeAttributes(self $definition)
    {
        foreach ($definition->getAttributes() as $name => $attribute)
        {
            if (isset($this->attributes[$name])) {
                $this->attributes[$name]->merge($attribute);
                continue;
            }

            $this->attributes[$name] = $attribute;
        }
    }
981219
protected function checkAttributeNode(DOMAttr $attribute, Tag $tag)
	{
		// Parse the attribute value for XPath expressions and assess their safety
		foreach (AVTHelper::parse($attribute->value) as $token)
		{
			if ($token[0] === 'expression')
			{
				$this->checkExpression($attribute, $token[1], $tag);
			}
		}
	}
114709
public function fromResource(Attribute $definition, $value)
    {
        if (! $definition->hasType()) {
            return $this->processNotTypedFromResource($definition, $value);
        }

        $type = $definition->getType();

        if (isset($this->handlers[$type])) {
            return $this->processHandlerFromResource($definition, $value);
        }

        throw new UnknownDataTypeException($definition);
    }
1131687
protected function takeAttributeFromDOM($attribute)
    {
        switch ($attribute->localName) {
        case 'url':
            $this->_url = $attribute->nodeValue;
            break;
        case 'width':
            $this->_width = $attribute->nodeValue;
            break;
        case 'height':
            $this->_height = $attribute->nodeValue;
            break;
        case 'time':
            $this->_time = $attribute->nodeValue;
            break;
        default:
            parent::takeAttributeFromDOM($attribute);
        }
    }
1211771
public function delete_attribute( $type, $data ) {
		$type = $data['type'];
		unset( $data['type'] );
		return $this->post( 'attribute/' . $type, json_encode( $data ) );
	}
206657
def process_attribute(self, type_, attr, value, level):
        

        attr_props = self.get_attribute_properties(type_, attr)
        value = self.format_value(attr, attr_props, value)
        line = self.__format_line(self.whitespace(level, 1), attr.upper(), value)

        return line
385935
private function collectAttributeTypeMetadata(
        PropertyMetadataBuilder $metadata,
        Attribute $attribute
    ) : void {
        $type = $attribute->type;

        // handle the case if the property type is mixed
        if ('mixed' === $type) {
            return;
        }

        if ($attribute->required) {
            $metadata->withBeingRequired();
        }

        // Evaluate type

        // Checks if the property has array<type>
        if (false !== $pos = strpos($type, '<')) {
            $arrayType = substr($type, $pos + 1, -1);

            $metadata->withType(new ArrayType(new MixedType(), $this->createTypeFromName($arrayType)));

            return;
        }

        // Checks if the property has type[]
         if (false !== $pos = strrpos($type, '[')) {
            $arrayType = substr($type, 0, $pos);

            $metadata->withType(new ArrayType(new MixedType(), $this->createTypeFromName($arrayType)));

            return;
        }

        $metadata->withType($this->createTypeFromName($attribute->type));
    }
167021
private function parseAttribute(Input $definition, TypeCollection $types, array $attributes): AttributePath
    {
        $definition->expect("{");

        $name = $this->parseAttributeName($definition);
        $type = $this->parseAttributeType($definition) ?? "";

        $definition->expect("}");

        if (in_array($name, $attributes)) {
            throw InvalidRoute::ambiguousAttribute($definition, $name);
        }

        if (!$types->hasNamed($type)) {
            throw InvalidRoute::unknownAttributeType($definition, $name, $type);
        }

        $type = $types->getNamed($type);

        $attributes[] = $name;

        $next = $this->parseRoute($definition, $types, $attributes);

        return new AttributePath($name, $type, $next);
    }
473688
protected function takeAttributeFromDOM($attribute)
    {
        switch ($attribute->localName) {
        case 'familyName':
            $this->_familyName = $attribute->nodeValue;
            break;
        case 'givenName':
            $this->_givenName = $attribute->nodeValue;
            break;
        default:
            parent::takeAttributeFromDOM($attribute);
        }
    }
314992
public function setAttribute( $attr, $value ) {
        //data-* attribute or in valid attribute array
        if( strpos( $attr, 'data-' ) === 0 || in_array( $attr, $this->validAttributes ) ) {
            $this->attrs[$attr] = $value;
        } else {
            throw new Exception\InvalidAttributeException( $attr );
        }
    }
423622
protected function takeAttributeFromDOM($attribute)
    {
        switch ($attribute->localName) {
        case 'seconds':
            $this->_seconds = $attribute->nodeValue;
            break;
        default:
            parent::takeAttributeFromDOM($attribute);
        }
    }
823256
public function createAttributeValue(Attribute $attribute, $value, $locale)
    {
        $attributeValue = $this->attributeValueRepository->createNew();
        $attributeValue->setAttribute($attribute);
        $this->entityManager->persist($attributeValue);
        $attribute->addValue($attributeValue);
        $this->setOrCreateAttributeValueTranslation($attributeValue, $value, $locale);

        return $attributeValue;
    }
365719
public function setDefinition($definition)
	{
		if ($definition instanceof InputDefinition)
		{
			$this->definition = $definition;
		}
		else
		{
			$this->definition->setDefinition($definition);
		}

		$this->applicationDefinitionMerged = false;
	}