private static function processTypeErrorOnSetValue($message, $trace, $i): void
    {
        if (0 !== strpos($message, 'Argument ')) {
            return;
        }

        if (isset($trace[$i]['file']) && __FILE__ === $trace[$i]['file'] && array_key_exists(0, $trace[$i]['args'])) {
            $pos = strpos($message, $delim = 'must be of the type ') ?: (strpos($message, $delim = 'must be an instance of ') ?: strpos($message, $delim = 'must implement interface '));
            if (false !== $pos) {
                $pos += \strlen($delim);
                $type = $trace[$i]['args'][0];
                $type = \is_object($type) ? \get_class($type) : \gettype($type);

                throw new InvalidArgumentException(sprintf('Expected argument of type "%s", "%s" given.', substr($message, $pos, (int) strpos($message, ',', $pos) - $pos), $type));
            }
        }
    }
private static function processTypeErrorOnSetValue($message, $trace, $i): void
    {
        if (0 !== strpos($message, 'Argument ')) {
            return;
        }

        if (isset($trace[$i]['file']) && __FILE__ === $trace[$i]['file'] && array_key_exists(0, $trace[$i]['args'])) {
            $pos = strpos($message, $delim = 'must be of the type ') ?: (strpos($message, $delim = 'must be an instance of ') ?: strpos($message, $delim = 'must implement interface '));
            if (false !== $pos) {
                $pos += \strlen($delim);
                $type = $trace[$i]['args'][0];
                $type = \is_object($type) ? \get_class($type) : \gettype($type);

                throw new InvalidArgumentException(sprintf('Expected argument of type "%s", "%s" given.', substr($message, $pos, (int) strpos($message, ',', $pos) - $pos), $type));
            }
        }
    }
private static function processTypeErrorOnSetValue ( $ message , $ trace , $ i ) : void { if ( 0 !== strpos ( $ message , 'Argument ' ) ) { return ; } if ( isset ( $ trace [ $ i ] [ 'file' ] ) && __FILE__ === $ trace [ $ i ] [ 'file' ] && array_key_exists ( 0 , $ trace [ $ i ] [ 'args' ] ) ) { $ pos = strpos ( $ message , $ delim = 'must be of the type ' ) ? : ( strpos ( $ message , $ delim = 'must be an instance of ' ) ? : strpos ( $ message , $ delim = 'must implement interface ' ) ) ; if ( false !== $ pos ) { $ pos += \ strlen ( $ delim ) ; $ type = $ trace [ $ i ] [ 'args' ] [ 0 ] ; $ type = \ is_object ( $ type ) ? \ get_class ( $ type ) : \ gettype ( $ type ) ; throw new InvalidArgumentException ( sprintf ( 'Expected argument of type "%s", "%s" given.' , substr ( $ message , $ pos , ( int ) strpos ( $ message , ',' , $ pos ) - $ pos ) , $ type ) ) ; } } }
Processes type error exception on value set.

Copy-paste of PropertyAccessor::throwInvalidArgumentException()
because it is private.

@param $message
@param $trace
@param $i

@see \Symfony\Component\PropertyAccess\PropertyAccessor::throwInvalidArgumentException()
Processes type error exception on value set .