0 follower

Final Class Yiisoft\FormModel\ParsedProperty

InheritanceYiisoft\FormModel\ParsedProperty

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Yiisoft\FormModel\ParsedProperty

Property Details

Hide inherited properties

$name public property
public string $name null
$path public property
public array $path null
$prefix public property
public string $prefix null
$raw public property
public string $raw null
$suffix public property
public string $suffix null

Method Details

Hide inherited methods

__construct() public method

public __construct( string $property ): mixed
$property string

The property name or expression

throws InvalidArgumentException

If the property name contains non-word characters.

                public function __construct(string $property)
{
    if (!preg_match('/(^|.*\])([\w\.\+\-_]+)(\[.*|$)/u', $property, $matches)) {
        throw new InvalidArgumentException('Property name must contain word characters only.');
    }
    $this->raw = $property;
    $this->name = $matches[2];
    $this->prefix = $matches[1];
    $this->suffix = $matches[3];
    $this->path = PathNormalizer::normalize($this->name . $this->suffix);
}