Migrated RabbitMqOptions to immutable object

This commit is contained in:
Alejandro Celaya
2022-09-17 13:56:59 +02:00
parent 0c34032fd3
commit 8f68078835
6 changed files with 42 additions and 74 deletions

View File

@@ -4,37 +4,12 @@ declare(strict_types=1);
namespace Shlinkio\Shlink\Core\Options;
use Laminas\Stdlib\AbstractOptions;
class RabbitMqOptions extends AbstractOptions
final class RabbitMqOptions
{
protected $__strictMode__ = false; // phpcs:ignore
private bool $enabled = false;
/** @deprecated */
private bool $legacyVisitsPublishing = false;
public function isEnabled(): bool
{
return $this->enabled;
}
protected function setEnabled(bool $enabled): self
{
$this->enabled = $enabled;
return $this;
}
/** @deprecated */
public function legacyVisitsPublishing(): bool
{
return $this->legacyVisitsPublishing;
}
/** @deprecated */
protected function setLegacyVisitsPublishing(bool $legacyVisitsPublishing): self
{
$this->legacyVisitsPublishing = $legacyVisitsPublishing;
return $this;
public function __construct(
public readonly bool $enabled = false,
/** @deprecated */
public readonly bool $legacyVisitsPublishing = false,
) {
}
}