Rename namespace Function keyword to Functions to prevent errors

Signed-off-by: davidarendsen <davidarendsen@hey.com>
This commit is contained in:
davidarendsen 2022-08-12 12:37:30 +00:00
commit 79edee7400
19 changed files with 31 additions and 31 deletions

View file

@ -1,40 +0,0 @@
<?php
namespace Arendsen\FluxQueryBuilder\Function;
use Arendsen\FluxQueryBuilder\Formatters;
class Reduce extends Base {
/**
* @var array $settings
*/
private $settings;
/**
* @var array $identity
*/
private $identity;
public function __construct(array $settings, array $identity)
{
$this->settings = $settings;
$this->identity = $identity;
}
public function __toString()
{
return '|> reduce(fn: (r, accumulator) => ({' . implode(', ', $this->formatSettings($this->settings)) . '}), ' .
'identity: {' . Formatters::toFluxArrayString($this->identity) . '}) ';
}
protected function formatSettings(array $settings)
{
array_walk($settings, function(&$value, $key) {
$value = $key . ': ' . $value;
});
return $settings;
}
}