for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Cycle\Migrations\Operation\Traits;
/**
* Consumer must define property "aliases".
*/
trait OptionsTrait
{
protected array $options = [];
protected function hasOption(string $name): bool
if (array_key_exists($name, $this->options)) {
return true;
}
if (!isset($this->aliases[$name])) {
return false;
foreach ($this->aliases as $source => $aliases) {
if (in_array($name, $aliases, true)) {
protected function getOption(string $name, mixed $default = null): mixed
if (!$this->hasOption($name)) {
return $default;
return $this->options[$name];
return $this->getOption($source);