src/Controller/RouteAction.php 1 location
|
@@ 59-62 (lines=4) @@
|
| 56 |
|
$route = (object)$route; |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
if (!$route instanceof \stdClass) { |
| 60 |
|
$type = (is_object($route) ? get_class($route) . ' ' : '') . gettype($route); |
| 61 |
|
throw new \UnexpectedValueException("Expected route to be a stdClass object, not a $type"); |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
return $route; |
| 65 |
|
} |
src/Controller/View/Twig.php 1 location
|
@@ 54-57 (lines=4) @@
|
| 51 |
|
*/ |
| 52 |
|
protected function assertViewVariableName($name) |
| 53 |
|
{ |
| 54 |
|
if (!is_string($name)) { |
| 55 |
|
$type = (is_object($name) ? get_class($name) . ' ' : '') . gettype($name); |
| 56 |
|
throw new \InvalidArgumentException("Expected name to be a string, not a $type"); |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
if (!preg_match('/^[a-z]\w*$/i', $name)) { |
| 60 |
|
throw new \InvalidArgumentException("Invalid name '$name'"); |