for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace BestServedCold\PhalueObjects\VOString;
use BestServedCold\PhalueObjects\Exception\InvalidTypeException;
use BestServedCold\PhalueObjects\VOString;
use Doctrine\Common\Inflector\Inflector;
/**
* Class Word
*
* @package BestServedCold\PhalueObjects\VOString
*/
class Word extends VOString
{
* Word constructor.
* @param $value
public function __construct($value)
parent::__construct($value);
if (! preg_match('/[A-za-z]/', $this->getValue())) {
throw new InvalidTypeException($value, ['word']);
}
* @param integer $count
$count
integer|null
This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.
@param
It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.
* @return string
public function getPluralised($count = null)
return $count === null || $count > 1 ? Inflector::pluralize($this->getValue()) : $this->getValue();
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.