for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of JSON-API.
*
* (c) Toby Zerner <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Tobscure\JsonApi;
trait MetaTrait
{
private $meta = [];
/**
* Set the meta data.
* @param array $meta
public function setMeta(array $meta)
$this->meta = $meta;
}
* Set a piece of meta data.
* @param string $key
* @param mixed $value
public function setMetaItem($key, $value)
$this->meta[$key] = $value;
* Remove a piece of meta data.
$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.
public function removeMetaItem($key)
unset($this->meta[$key]);
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 methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.