Add new types Array, Boolean, Record, Math
Signed-off-by: davidarendsen <davidarendsen@hey.com>
This commit is contained in:
parent
a50e33ba04
commit
057a2d625e
10 changed files with 137 additions and 29 deletions
27
src/Type/ArrayType.php
Normal file
27
src/Type/ArrayType.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace Arendsen\FluxQueryBuilder\Type;
|
||||
|
||||
use Arendsen\FluxQueryBuilder\Formatters;
|
||||
use Arendsen\FluxQueryBuilder\Type;
|
||||
|
||||
class ArrayType implements TypeInterface
|
||||
{
|
||||
public function __construct(array $value)
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
array_walk($this->value, function (&$value, $key) {
|
||||
if (is_string($key)) {
|
||||
$value = $key . ': ' . Formatters::valueToString($value);
|
||||
} else {
|
||||
$value = Formatters::valueToString($value);
|
||||
}
|
||||
});
|
||||
|
||||
return implode(', ', $this->value);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue