for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @package s9e\RegexpBuilder
* @copyright Copyright (c) 2016 The s9e Authors
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
namespace s9e\RegexpBuilder\Output;
use InvalidArgumentException;
abstract class BaseImplementation implements OutputInterface
{
* @var integer
protected $maxValue = 0;
protected $minValue = 0;
* @param array $options
public function __construct(array $options = [])
$options
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
}
* {@inheritdoc}
public function output($value)
$this->validate($value);
return $this->outputValidValue($value);
* Validate given value
*
* @param integer $value
* @return void
protected function validate($value)
if ($value < $this->minValue || $value > $this->maxValue)
throw new InvalidArgumentException('Value ' . $value . ' is out of bounds (' . $this->minValue . '..' . $this->maxValue . ')');
* Serialize a valid value into a character
* @return string
abstract protected function outputValidValue($value);
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.