src/ConstraintCheck/Message/ViolationMessageSerializer.php 1 location
|
@@ 59-66 (lines=8) @@
|
| 56 |
|
$value = $argument['value']; |
| 57 |
|
$role = $argument['role']; |
| 58 |
|
|
| 59 |
|
if ( array_key_exists( $type, $methods ) ) { |
| 60 |
|
$method = $methods[$type]; |
| 61 |
|
$serializedValue = $this->$method( $value ); |
| 62 |
|
} else { |
| 63 |
|
throw new InvalidArgumentException( |
| 64 |
|
'Unknown ViolationMessage argument type ' . $type . '!' |
| 65 |
|
); |
| 66 |
|
} |
| 67 |
|
|
| 68 |
|
$serialized = [ |
| 69 |
|
't' => $type, |
src/ConstraintCheck/Message/ViolationMessageRenderer.php 1 location
|
@@ 127-134 (lines=8) @@
|
| 124 |
|
$value = $argument['value']; |
| 125 |
|
$role = $argument['role']; |
| 126 |
|
|
| 127 |
|
if ( array_key_exists( $type, $methods ) ) { |
| 128 |
|
$method = $methods[$type]; |
| 129 |
|
$params = $this->$method( $value, $role ); |
| 130 |
|
} else { |
| 131 |
|
throw new InvalidArgumentException( |
| 132 |
|
'Unknown ViolationMessage argument type ' . $type . '!' |
| 133 |
|
); |
| 134 |
|
} |
| 135 |
|
|
| 136 |
|
return $params; |
| 137 |
|
} |
src/ConstraintCheck/Message/ViolationMessageDeserializer.php 1 location
|
@@ 69-76 (lines=8) @@
|
| 66 |
|
$serializedValue = $serializedArgument['v']; |
| 67 |
|
$role = $serializedArgument['r']; |
| 68 |
|
|
| 69 |
|
if ( array_key_exists( $type, $methods ) ) { |
| 70 |
|
$method = $methods[$type]; |
| 71 |
|
$value = $this->$method( $serializedValue ); |
| 72 |
|
} else { |
| 73 |
|
throw new InvalidArgumentException( |
| 74 |
|
'Unknown ViolationMessage argument type ' . $type . '!' |
| 75 |
|
); |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
return $message->withArgument( $type, $role, $value ); |
| 79 |
|
} |