for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Remorhaz\JSON\Path\Processor\Result;
use function array_map;
use Remorhaz\JSON\Data\Export\ValueDecoderInterface;
use Remorhaz\JSON\Data\Export\ValueEncoderInterface;
use Remorhaz\JSON\Data\Value\ValueInterface;
final class SelectResult implements SelectResultInterface
{
private $encoder;
private $decoder;
private $values;
public function __construct(
ValueEncoderInterface $encoder,
ValueDecoderInterface $decoder,
ValueInterface ...$values
) {
$this->encoder = $encoder;
$this->decoder = $decoder;
$this->values = $values;
}
/**
* {@inheritDoc}
*
* @return array
*/
public function decode(): array
return array_map([$this->decoder, 'exportValue'], $this->values);
* @return string[]
public function encode(): array
return array_map([$this->encoder, 'exportValue'], $this->values);
* @return ValueInterface[]
public function get(): array
return $this->values;