Parses properties.

@param array $jProp

@return \Sabre\VObject\Property
428672
public function parseProperty(array $jProp)
    {
        list(
            $propertyName,
            $parameters,
            $valueType
        ) = $jProp;

        $propertyName = strtoupper($propertyName);

        // This is the default class we would be using if we didn't know the
        // value type. We're using this value later in this function.
        $defaultPropertyClass = $this->root->getClassNameForPropertyName($propertyName);

        $parameters = (array) $parameters;

        $value = array_slice($jProp, 3);

        $valueType = strtoupper($valueType);

        if (isset($parameters['group'])) {
            $propertyName = $parameters['group'].'.'.$propertyName;
            unset($parameters['group']);
        }

        $prop = $this->root->createProperty($propertyName, null, $parameters, $valueType);
        $prop->setJsonValue($value);

        // We have to do something awkward here. FlatText as well as Text
        // represents TEXT values. We have to normalize these here. In the
        // future we can get rid of FlatText once we're allowed to break BC
        // again.
        if ('Sabre\VObject\Property\FlatText' === $defaultPropertyClass) {
            $defaultPropertyClass = 'Sabre\VObject\Property\Text';
        }

        // If the value type we received (e.g.: TEXT) was not the default value
        // type for the given property (e.g.: BDAY), we need to add a VALUE=
        // parameter.
        if ($defaultPropertyClass !== get_class($prop)) {
            $prop['VALUE'] = $valueType;
        }

        return $prop;
    }
1064716
def loadXmlProperty(self, xprop):
        
        if xprop.tag == 'property':
            value = self.dataInterface().fromXml(xprop[0])
            self._xmlData[xprop.get('name', '')] = value
1116768
private function parseProperties($class)
    {
        $ret = [];

        $defaults = $class->getDefaultProperties();

        foreach ($class->getProperties() as $property) {
            $tags = self::parseDocCommentTags($property->getDocComment());
            list($type, $description) = $this->tokenize($tags[self::T_VAR], 2);

            $p = [];
            if (strpos($type, '[]') > 0) {
                $type = str_replace('[]', '', $type);
                $p['type'] = 'array';
                $p['xml'] = ['name' => preg_replace('!s$!', '', $property->name), 'wrapped' => true];
                if ($this->isDefinedType($type)) {
                    $p['items'] = ['$ref' => $this->getDefinition($type)];
                } else {
                    $p['items'] = ['type' => $type];
                }
            } elseif ($this->isDefinedType($type)) {
                $p['$ref'] = $this->getDefinition($type);
            } else {
                $p['type'] = $type;
                $enums = isset($tags[self::T_ENUM]) ? $this->mixedToArray($tags[self::T_ENUM]) : [];
                foreach ($enums as $enum) {
                    $p['enum'] = $this->tokenize($enum);
                }
            }

            if (isset($tags[self::T_FORMAT])) {
                $p['format'] = $tags[self::T_FORMAT];
            }

            if (isset($tags[self::T_EXAMPLE])) {
                $p['example'] = $tags[self::T_EXAMPLE];
            }

            if (isset($tags[self::T_REQUIRED])) {
                $p['required'] = true;
            }

            if (!empty($description)) {
                $p['description'] = $description;
            }

            if (!is_null($defaults[$property->name])) {
                $p['default'] = $defaults[$property->name];
            }

            $ret[$property->name] = $p;
        }
        return $ret;
    }
422687
protected function processPropertiesParsing(\ReflectionClass $reflectedClass)
    {
        $metadata = array();

        $reflectedProperties = $reflectedClass->getProperties();

        foreach ($reflectedProperties as $reflectedProperty) {
            if ($this->isBoomgoProperty($reflectedProperty)) {
                $propertyMetadata = $this->parseMetadataProperty($reflectedProperty);
                $metadata['definitions'][$reflectedProperty->getName()] = $propertyMetadata;
            }
        }

        return $metadata;
    }
391349
public function parseComponent(array $jComp)
    {
        // We can remove $self from PHP 5.4 onward.
        $self = $this;

        $properties = array_map(
            function ($jProp) use ($self) {
                return $self->parseProperty($jProp);
            },
            $jComp[1]
        );

        if (isset($jComp[2])) {
            $components = array_map(
                function ($jComp) use ($self) {
                    return $self->parseComponent($jComp);
                },
                $jComp[2]
            );
        } else {
            $components = [];
        }

        return $this->root->createComponent(
            $jComp[0],
            array_merge($properties, $components),
            $defaults = false
        );
    }
299193
public function getString($prop) {

			// Get property
			$val = $this->get($prop);

			// Parse as a string
			if (is_string($val)) {
				return strval($val);
			} else {
				return null;
			}

		}
433784
protected function parseRPCResult($res)
    {
        $rpcRes = $res['data'];

        if (!empty($rpcRes['output'])) {
            echo $rpcRes['output'];
        }

        if (!empty($rpcRes['exception'])) {
            $exception = new \Exception($rpcRes['exception']['msg'], $rpcRes['exception']['code']);

            $file = new \ReflectionProperty($exception, 'file');
            $file->setAccessible(true);
            $file->setValue($exception, $rpcRes['exception']['file']);

            $line = new \ReflectionProperty($exception, 'line');
            $line->setAccessible(true);
            $line->setValue($exception, $rpcRes['exception']['line']);

            throw $exception;
        }

        if (isset($rpcRes['status']) && $rpcRes['status'] != 200) {
            return false;
        }

        return isset($rpcRes['return']) ? $rpcRes['return'] : null;
    }
392330
public function asObject($strProperty){
		$strProperty = $this->_formatPropertyName($strProperty);
		return $this->_arrData[$strProperty]->asObject();
	}
666412
private function parseProperties(array $propertyAnnotations, array $properties, string $className)
    {
        $propertyInjections = [];

        /* @var \ReflectionProperty $property */
        foreach ($properties as $property) {
            if ($property->isStatic()) {
                continue;
            }
            $propertyName = $property->getName();
            if (!isset($propertyAnnotations[$propertyName]) || !$this->isParseProperty($propertyAnnotations[$propertyName])) {
                continue;
            }

            $object = new $className();
            $property->setAccessible(true);
            $propertyValue = $property->getValue($object);

            list($injectProperty, $isRef) = $this->parsePropertyAnnotations($propertyAnnotations, $className, $propertyName, $propertyValue);
            if ($injectProperty == null) {
                continue;
            }

            $propertyInjection = new PropertyInjection($propertyName, $injectProperty, (bool)$isRef);
            $propertyInjections[$propertyName] = $propertyInjection;
        }

        return $propertyInjections;
    }
736139
private function parseValue($value, $types, \ReflectionProperty $property, $object)
    {
        foreach ($types as $type) {
            foreach ($this->context->getParsers() as $parser) {
                if ($parser instanceof ValueParserInterface) {
                    if (is_array($value) && strpos($type, '[]') !== false) {

                        //support for nesting children
                        //https://github.com/rafrsr/lib-array2object/issues/1
                        if (count($value) === 1 && is_array(current($value))) {
                            if (array_key_exists(0, current($value))) {
                                $value = current($value);
                            }
                        }

                        $tmpArray = [];
                        foreach ($value as $key => $arrayValue) {
                            $parsedValue = $parser->toObjectValue($arrayValue, str_replace('[]', null, $type), $property, $object);
                            //the annotation [] is used alone to ignore array keys
                            if (in_array('[]', $types, true)) {
                                $tmpArray[] = $parsedValue;
                            } else {
                                $tmpArray[$key] = $parsedValue;
                            }
                        }
                        $value = $tmpArray;
                    } else {
                        $value = $parser->toObjectValue($value, str_replace('[]', null, $type), $property, $object);
                    }
                } else {
                    throw new \InvalidArgumentException(sprintf('%s is not a valid parser.', get_class($parser)));
                }
            }
        }

        return $value;
    }
1355794
public function parse($filepath)
    {
        $metadata = array();

        $reflectedClass = $this->getReflection($filepath);
        $metadata['class'] = $reflectedClass->getName();

        $propertiesMetadata = $this->processPropertiesParsing($reflectedClass);
        $metadata = array_merge($metadata, $propertiesMetadata);

        return $metadata;
    }
1160041
public static function from_array($arr)
    {
        $obj = new rcube_message_header;
        foreach ($arr as $k => $v)
            $obj->set($k, $v);

        return $obj;
    }
900362
protected function parseProperties($propertiesDefinition, &$loadedDependencies = array()){
        $parseProperties= array();
        foreach ($propertiesDefinition as $key => $definition) {
            $property= NULL;
            if(isset($definition['ref'])){
                //Conseguimos la dependencia
                $property= $this->getDependency($definition['ref'], $loadedDependencies);
            }else{
                //Casteo el valor al tipo indicado
                $property= $definition['value'];
                if($definition['value'] != 'array'){
                    settype($property, $definition['type']);
                }
            }
            $parseProperties[$key]= $property;
        }
        return $parseProperties;
    }
734523
public function properties()
    {
        if ($this->properties === null || $this->parsedProperties === false) {
            $this->parsedProperties = true;

            $model = $this->proto();
            $properties = $model->metadata()->properties();

            $listProperties = null;
            if ($this->properties === null) {
                $collectionConfig = $this->collectionConfig();
                if (isset($collectionConfig['properties'])) {
                    $listProperties = array_flip($collectionConfig['properties']);
                }
            } else {
                $listProperties = array_flip($this->properties);
            }

            if ($listProperties) {
                // Replacing values of listProperties from index to actual property values
                $properties = array_replace($listProperties, $properties);
                // Get only the keys that are in listProperties from props
                $properties = array_intersect_key($properties, $listProperties);
            }

            $this->properties = $properties;
        }

        return $this->properties;
    }
1205204
public static function getValue($objectOrArray, $property)
    {
        $propertyValue = null;

        if (is_object($objectOrArray)) {

            $camelProp = str_replace(' ', '', ucwords(str_replace('_', ' ', $property)));
            $methods = array('get'.$camelProp, lcfirst($camelProp), 'is'.$camelProp, 'has'.$camelProp);

            foreach ($methods as $method) {
                if (method_exists($objectOrArray, $method)) {
                    $propertyValue = $objectOrArray->$method();
                    break;
                }
            }

            if (null === $propertyValue && property_exists($objectOrArray, $property)) {
                $propertyValue = $objectOrArray->$property;
            }
        } elseif (is_array($objectOrArray)) {
            if (isset($objectOrArray[$property])) {
                $propertyValue = $objectOrArray[$property];
            }
        }

        return $propertyValue;
    }
1237483
def read_dict_from_properties(desired_type: Type[dict], file_object: TextIOBase,
                              logger: Logger, conversion_finder: ConversionFinder, **kwargs) -> Dict[str, Any]:
    

    # right now jprops relies on a byte stream. So we convert back our nicely decoded Text stream to a unicode
    # byte stream ! (urgh)
    class Unicoder:
        def __init__(self, file_object):
            self.f = file_object

        def __iter__(self):
            return self

        def __next__(self):
            line = self.f.__next__()
            return line.encode(encoding='utf-8')

    res = jprops.load_properties(Unicoder(file_object))

    # first automatic conversion of strings > numbers
    res = {key: try_parse_num_and_booleans(val) for key, val in res.items()}

    # further convert if required
    return ConversionFinder.convert_collection_values_according_to_pep(res, desired_type, conversion_finder, logger, 
                                                                       **kwargs)
104222
protected function _getPropertyType(Zend_Reflection_Property $prop)
    {
        $docBlock = $prop->getDocComment();

        if (!$docBlock) {
            return 'Unknown';
        }

        if (!$docBlock->hasTag('var')) {
            return 'Unknown';
        }

        $tag = $docBlock->getTag('var');
        return trim($tag->getDescription());
    }