Validate a property name

@param \stdClass $property Property

@return string Property name
507433
protected function valPropName($property)
    {
        $propertyName = trim($property->name);

        // If the property name is empty
        if (!strlen($propertyName)) {
            throw new InvalidArgumentException(
                InvalidArgumentException::EMPTY_PROPERTY_NAME_STR,
                InvalidArgumentException::EMPTY_PROPERTY_NAME
            );
        }

        return $propertyName;
    }
1042506
public function getPropertyName($property = self::LOGIN_PROPERTY, $strict = false)
    {
        if ($this->checkProperty($property, $strict)) {
            if (is_string($this->properties[$property])) {
                return $this->properties[$property];
            }
            if (isset($this->lazyPropertyNameCache[$property])) {
                return $this->lazyPropertyNameCache[$property];
            }

            return $this->lazyPropertyNameCache[$property] = $this->properties[$property]->getName();
        }
    }
720308
public function setValidationProperty(array $properties)
    {
        if (Helpers::isKeyExists($properties, 'validation')) {
            $this->validationRules = is_array($properties['validation']) ? $properties['validation'] : Helpers::removeEmptyItems(explode('|', $properties['validation']));
        }

        if (Helpers::isNewerThanOrEqualTo('5.2') && $this->isNullable() && !in_array('nullable', $this->validationRules)) {
            $this->validationRules[] = 'nullable';
        }

        if ($this->isBoolean() && !in_array('boolean', $this->validationRules)) {
            $this->validationRules[] = 'boolean';
        }

        if ($this->isFile() && !in_array('file', $this->validationRules)) {
            $this->validationRules[] = 'file';
        }
        if ($this->isMultipleAnswers() && !in_array('array', $this->validationRules)) {
            $this->validationRules[] = 'array';
        }

        if (in_array($this->getEloquentDataMethod(), ['char', 'string']) && in_array($this->htmlType, ['text', 'textarea'])) {
            if (!in_array('string', $this->validationRules)) {
                $this->validationRules[] = 'string';
            }

            if (!Helpers::inArraySearch($this->validationRules, 'min')) {
                $this->validationRules[] = sprintf('min:%s', $this->getMinLength());
            }

            if (!Helpers::inArraySearch($this->validationRules, 'max') && !is_null($this->getMaxLength())) {
                $this->validationRules[] = sprintf('max:%s', $this->getMaxLength());
            }
        }

        $params = [];

        if (Helpers::isKeyExists($properties, 'data-type-params')) {
            $params = $this->getDataTypeParams((array) $properties['data-type-params']);
        }

        if ($this->htmlType == 'number' || (in_array($this->getEloquentDataMethod(), ['decimal', 'double', 'float'])
            && isset($params[0]) && ($length = intval($params[0])) > 0
            && isset($params[1]) && ($decimal = intval($params[1])) > 0)) {
            if (!in_array('numeric', $this->validationRules)) {
                $this->validationRules[] = 'numeric';
            }

            if (!Helpers::inArraySearch($this->validationRules, 'min') && !is_null($minValue = $this->getMinValue())) {
                $this->validationRules[] = sprintf('min:%s', $minValue);
            }

            if (!Helpers::inArraySearch($this->validationRules, 'max') && !is_null($maxValue = $this->getMaxValue())) {
                $this->validationRules[] = sprintf('max:%s', $maxValue);
            }
        }

        return $this;
    }
520085
public function getProperty($property){        
        //Primero Busco por get
        $getMethod= 'get' . strtoupper($property[0]) . substr($property, 1);                     
        if($this->reflection->hasMethod($getMethod)){
            $reflectionMethod= $this->reflection->getMethod($getMethod);
            //Si existe el metodo set y es public lo seteo
            if($reflectionMethod->isPublic()){
                return $this->object->$getMethod();
            }            
        }else if($this->reflection->hasProperty($property)){
            //Si existe la propiedad y es public la seteo
            $reflectionProperty= $this->reflection->getProperty($property);
            if($reflectionProperty->isPublic()){
                return $this->object->$property;
            }
        }
        return NULL;
    }
1352222
public function enum(string $property): EnumPropertyColumnDefiner
    {
        $this->verifyProperty(__METHOD__, $property);
        $type       = $this->class->getPropertyType($property);
        $isNullable = $type->isNullable();
        $enumType   = $type->nonNullable();

        if (!($enumType instanceof ObjectType)) {
            throw InvalidArgumentException::format(
                'Invalid enum property \'%s\': must map to an object type, %s given',
                $property, $type->asTypeString()
            );
        }

        $class = $enumType->getClass();

        return $this->relation($property)->asEmbedded()->enum($class, $isNullable);
    }
719144
public function get($property)
    {
        $value = null;

        if ($this->_convert) {
            $property = str_replace( "_", "-", $property );
        } else {
            $property = str_replace( "-", "_", $property );
        }

        if (array_key_exists($property, $this->_values)) {
            return $this->_values[$property];
        } else {
            return null;
        }

    }
1033249
public function validateProperties(array $properties)
    {
        $definedProperties = $this->defineProperties() ?: [];

        /*
         * Determine and implement default values
         */
        $defaultProperties = [];

        foreach ($definedProperties as $name => $information) {
            if (array_key_exists('default', $information)) {
                $defaultProperties[$name] = $information['default'];
            }
        }

        $properties = array_merge($defaultProperties, $properties);

        return $properties;
    }
1011805
protected function validateValue($property, $value)
    {
        $this->isPropertyValid($property);

        $regEx = '/^' . self::CONFIRMATION_PROPERTIES[$property] . '$/';

        if (preg_match($regEx, $value) != 1) {
            throw new InvalidArgumentException("The value " . $value . " for the property " . $property . ", is invalid");
        }

        return $value;
    }
873816
public function getValidationMessages($property = null) {
		if ($this->_validatorsMessages === null) {
			return;
		}
		
		if ($property === null) {
			return $this->_validatorsMessages;
		}
		
		if (isset($this->_validatorsMessages[$property])) {
			return $this->_validatorsMessages[$property];
		}
	}
776644
public function getPropertyAnnotations($property)
    {
        if (!$this->hasProperty($property)) {
            $name = $this->_getReflection()->getName();
            throw new Exception\InvalidArgumentException(
                "The class {$name} doesn't have a property called {$property}"
            );
        }

        if (empty($this->_annotations['properties'][$property])) {
            $comment = $this->_getReflection()
                ->getProperty($property)
                ->getDocComment();
            $data = AnnotationParser::getAnnotations($comment);
            $propertyAnnotations = new AnnotationsList();
            foreach ($data as $property => $parsedData) {
                $propertyAnnotations->append(
                    $this->_createAnnotation($property, $parsedData)
                );
            }
            $this->_annotations['properties'][$property] = $propertyAnnotations;
        }
        return $this->_annotations['properties'][$property];
    }
1358307
public function getValidations($property)
    {
        if (is_string($property)) {
            $property = $this->_description->getProperty($property);
        }

        $name = $property->getName();

        if (!$this->_validations->$name) {
            $this->_validations->$name = new AnConfig();
        }

        return $this->_validations->$name;
    }
953223
public function getPropertyValidators($propertyName = null)
    {
        if ($propertyName !== null) {
            return $this->propertyValidators[$propertyName] ?? [];
        }
        return $this->propertyValidators;
    }
772147
public function validate($value)
    {
        return ($value instanceof \stdClass && count((array) $value) <= $this->size)
            || parent::validate($value);
    }
1007473
public function validatePropertyClass($input)
    {
        list($bundle, $document) = $this->parseShortcutNotation($input);

        try {
            $bundlePath = $this->getContainer()->get('kernel')->getBundle($bundle)->getPath();
        } catch (\Exception $e) {
            throw $this->getException('Bundle "%s" does not exist.', [$bundle]);
        }

        if (!file_exists($bundlePath . '/Document/' . str_replace('\\', '/', $document) . '.php')) {
            throw $this->getException('Document "%s:%s" does not exist.', [$bundle, $document]);
        }

        return $input;
    }
349732
public function get_configdata_property(string $property) {
        $configdata = $this->field->get('configdata');
        if (!isset($configdata[$property])) {
            return null;
        }
        return $configdata[$property];
    }
360700
public function checkProperty(&$property)
    {
        if (is_string($property)) {
            $property = Placeholder::replaceStringsAndComments($property);
            $property = Placeholder::removeCommentPlaceholders($property, true);
            $property = Placeholder::replaceStringPlaceholders($property, true);

            return true;
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($property). "' for argument 'property' given."
            );
        }
    }
829521
protected function validateRequired(array $properties)
    {
        $valid = true;
        foreach ($properties as $property) {
            $value = $this->getPropertyValue($property);
            if (empty($value)) {
                $this->addError($property, sprintf('Property "%s" must not be empty.', $property));
                $valid = false;
            }
        }
        return $valid;
    }