Skip to content

Commit

Permalink
VueComponent: Params can be in format (key => value) or inverse.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek authored Mar 14, 2021
1 parent c499d69 commit e82ebc7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Component/VueComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public function __construct(array $config)

$parameters = [];
foreach ($config['params'] ?? [] as $parameterName => $parameterValue) {
if (\is_int($parameterName) && is_string($parameterValue)) {
$parameterName = $parameterValue;
$parameterValue = null;
}
if (\is_string($parameterName) === false) {
throw new \InvalidArgumentException(
'Component "' . $this->key . '": Parameter "' . $parameterName . '" must be '
Expand Down

0 comments on commit e82ebc7

Please sign in to comment.