Parse a full email address "FirstName LastName <user@domain.tld>" into name and address part.

@param  string $value

@return string[]|null - aray with name and address part or NULL if the specified address is invalid
550709
public static function parseAddress($value) {
        if (!is_string($value)) throw new IllegalTypeException('Illegal type of parameter $value: '.gettype($value));

        $value = trim($value);

        if (strEndsWith($value, '>')) {
            // closing angle bracket found, check for a matching opening bracket
            $name    = trim(strLeftTo($value, '<', -1));
            $address = strRightFrom($value, '<', -1);           // omits the opening bracket
            $address = trim(strLeft($address, -1));             // omit the closing bracket
        }
        else {
            // no closing angle bracket found, it must be a simple address
            $name  = '';
            $address = $value;
        }

        if (strlen($address) && filter_var($address, FILTER_VALIDATE_EMAIL)) {
            return [
                'name'    => $name,
                'address' => $address
            ];
        }
        return null;
    }
1150508
public function parse_value($value) {
        if (strpos($value, '$ToolProxy.custom.url') !== false) {
            $value = str_replace('$ToolProxy.custom.url', parent::get_endpoint(), $value);
        }
        return $value;

    }
526971
public function transform($value)
    {
        if (trim($value) == '')
            return null;

        if (preg_match('/^(?:(.+) )?<(.+)>$/', $value, $matches)) {
            return new Address($matches[2], $matches[1]);
        }

        throw new AddressException(sprintf('Unable to parse Address "%s".', $value));
    }
356180
public function setPrimaryAddress($value)
    {
        // TODO: Remove after deprecated setEmail(), setFirstName(), setLastName() methods removed
        if (is_array($value)) {
            $value = Address::createFromData($value);
        }

        if (empty($value->getEmails()) && $this->getAttribute('email') !== null) {
            $email = Email::createFromData([
                'label' => 'main',
                'value' => $this->getAttribute('email'),
                'primary' => true,
            ]);

            $value->setEmails([$email]);
        }

        if (empty($value->getFirstName()) && $this->getAttribute('firstName') !== null) {
            $value->setFirstName($this->getAttribute('firstName'));
        }

        if (empty($value->getLastName()) && $this->getAttribute('lastName') !== null) {
            $value->setLastName($this->getAttribute('lastName'));
        }

        return $this->setAttribute('primaryAddress', $value);
    }
29010
private static function parseModifications($value)
    {
        $modifications = array();
        $matches = null;
        preg_match_all('/\(([^()]|(?R))*\)/', $value, $matches);

        foreach ($matches[0] as $modString) {
            $elements = null;
            preg_match('/\(([0-9,]+)\|([A-Z]+:[0-9]+)?\|(.*)\|?(.+)?\)/', $modString, $elements);

            $locations = explode(',', $elements[1]);
            foreach ($locations as $location) {
                $modification = new Modification();
                $modification->setLocation((int) $location);
                $modification->setName($elements[3]);
                $modification->setAccession($elements[2]);

                $modifications[] = $modification;
            }
        }

        return $modifications;
    }
1016008
public function getNameByValue($value)
    {
        $i = array_search($value, $this->__data, true);
        if($i===false)
        {
            return null;
        }
        return $i;
    }
900870
public function parseValue($value)
    {
        if (strlen($value) === 0) {
            return $value;
        }

        if ($value[0] === '"' || $value[0] === "'") {
            $value = substr($value, 1, -1);
        }

        $value = stripslashes($value);

        return $value;
    }
164654
public static function getAllMatchingNames($value): array
    {
        $enumerables = self::getCache();
        $result = array_keys($enumerables, $value, true);
    
        if ([] === $result) {
            throw EnumerableException::valueNotFound();
        }
    
        return $result;
    }
27029
protected function parse_value($value){
        switch(true){
            case $value instanceof \Carbon\Carbon:
                $value = $value->format('d M y');
                break;
        }

        return (string) $value;
    }
373724
private function validateEmail($value)
    {
        if (empty($value)) {
            throw new InvalidArgumentException('An email address is required.');
        }
        if (!$filtered = filter_var($value, FILTER_VALIDATE_EMAIL)) {
            throw new InvalidArgumentException('Invalid email address: ' . $value);
        }

        return $filtered;
    }
1244366
protected function _emptyValue($value)
    {
        if ($value === true) {
            return ['' => ''];
        }
        if (is_scalar($value)) {
            return ['' => $value];
        }
        if (is_array($value)) {
            return $value;
        }

        return [];
    }
346568
public function validateValue($value)
    {
        list($domain, $ip) = explode('/', $value, 2);
        if (($error = (new DomainValidator())->validateValue($domain)) !== null) {
            return $error;
        }
        if ($ip !== null && ($error = (new IpValidator())->validateValue($ip)) !== null) {
            return $error;
        }

        return null;
    }
1297323
public function marshal($value)
    {
        if ($value === null || $value === '') {
            return null;
        }
        if (is_string($value) && $this->_useLocaleParser) {
            return $this->_parseValue($value);
        }
        if (is_numeric($value)) {
            return (float)$value;
        }
        if (is_string($value) && preg_match('/^[0-9,. ]+$/', $value)) {
            return $value;
        }

        return null;
    }
1104365
public function filter($value)
    {
        if (null === $value) {
            return null;
        }
        $this->checkValueIsArrayOrThrowException($value);

        $return = [];
        foreach ($value as $header => $condition) {
            $return[$header] = $this->conditionFilter->filter($condition);
        }

        return $return;
    }
704210
public function apply(Value $value): array
    {
        if ($value->isEmpty()) {
            return $this->null();
        }

        $mailAddress = $value->value();
        if (!isMailAddress($mailAddress)) {
            return $this->error($this->detectErrorId($mailAddress));
        }

        return $this->filtered($mailAddress);
    }
569725
public function setLastName($value)
    {
        $primaryAddress = $this->getPrimaryAddress();

        if ($primaryAddress !== null) {
            $primaryAddress->setLastName($value);
        } else {
            $primaryAddress = Address::createFromData(['lastName' => $value]);
        }

        $this->setPrimaryAddress($primaryAddress);
        $this->setAttribute('lastName', $value);

        return $this;
    }
1246256
public function parseValue($value)
    {
        if (is_array($value)) {
            array_walk_recursive($value, [$this, 'doHtmlspecialchars']);
        } else {
            $value = $this->doHtmlspecialchars($value);
        }

        return parent::parseValue($value);
    }