for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Zenstruck\ScheduleBundle\Schedule\Task;
/**
* @author Kevin Bond <[email protected]>
*/
final class Config
{
private $data = [];
* @param mixed $value
public function set(string $name, $value): self
$this->data[$name] = $value;
return $this;
}
* @param mixed $default
*
* @return mixed
public function get(string $name, $default = null)
return $this->data[$name] ?? $default;
public function all(): array
return $this->data;
public function humanized(): array
$ret = [];
foreach ($this->data as $key => $value) {
switch (true) {
case \is_bool($value):
$value = $value ? 'yes' : 'no';
break;
case \is_scalar($value):
case \is_object($value):
$value = \sprintf('(%s)', \get_class($value));
default:
$value = \sprintf('(%s)', \gettype($value));
$ret[$key] = $value;
return $ret;