for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of expect package.
*
* (c) Noritaka Horio <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace expect;
use \OutOfBoundsException;
use \Countable;
final class Dictionary implements Countable
{
private $values;
public function __construct(array $values = [])
$this->values = $values;
}
* @param string $value
$value
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @return boolean
public function containsKey($key)
return array_key_exists($key, $this->values);
* @return mixed
public function get($key)
if (!$this->containsKey($key)) {
throw new OutOfBoundsException('No element at position ' . $key);
return $this->values[$key];
public function set($key, $value)
$this->values[$key] = $value;
return $this;
* @return int
public function count()
return count($this->values);
public function toArray()
return $this->values;
public static function fromArray(array $values = [])
$defaultValues = [];
foreach ($values as $key => $value) {
if (is_array($value)) {
$defaultValues[$key] = new static($value);
} else {
$defaultValues[$key] = $value;
return new static($defaultValues);
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.