for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the php-ansible package.
*
* (c) Marc Aschmann <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Asm\Ansible\Command;
/**
* Class Option
* @package Asm\Ansible\Command
* @author Metagûsto <[email protected]>
class Option
{
* @var string|null
protected $name = null;
protected $value = null;
* Option constructor.
* @param string|null $name
* @param string|null $value
public function __construct(?string $name = null, ?string $value = null)
$this->name = $name;
$this->value = $value;
}
* @return string|null
public function getName(): ?string
return $this->name;
public function setName(?string $name): void
public function getValue(): ?string
return $this->value;
public function setValue(?string $value): void
* @return string
public function __toString()
return sprintf('%s=%s', $this->name, $this->value);
* Converts the option to string
public function toString(): string
return $this->__toString();
* @param Option|null $other
* @return bool
public function equals(?Option $other)
if ($other === null)
return false;
return $this->name === $other->getName() && $this->value === $other->value;