Switch from stdClass to object casting

This commit is contained in:
Kleis Auke Wolthuizen
2017-11-21 17:35:01 +01:00
parent 4f3f82b1ba
commit a4224265d8
10 changed files with 27 additions and 68 deletions

View File

@@ -14,13 +14,15 @@ class PageRulesTargets implements Configurations
public function __construct(string $queryUrl)
{
$target = new \stdClass();
$target->target = 'url';
$target->constraint = new \stdClass();
$target->constraint->operator = 'matches';
$target->constraint->value = $queryUrl;
$this->targets = [$target];
$this->targets = [
(object)[
'target' => 'url',
'constraint' => (object)[
'operator' => 'matches',
'value' => $queryUrl
]
]
];
}
public function getArray(): array