for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Moip;
/**
* Class Link represents a single link from the resource HATEOAS structure.
*/
class Link
{
* @var string link href. Currently it's taken from the href or redirectHref property.
private $href;
* @var string|null link title, can be null.
private $title = null;
* @var string link name it's used as key in the Links class.
private $name;
* Link constructor.
*
* @param string $name.
$name.
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.
* @param \stdClass $obj.
$obj.
* @throws \InvalidArgumentException if there isn't a href property on the $obj.
public function __construct($name, $obj)
$this->name = $name;
$hasHref = empty($obj->href);
if ($hasHref && empty($obj->redirectHref)) {
throw new \InvalidArgumentException('Link is malformed. No href property');
}
$this->href = !$hasHref ? $obj->href : $obj->redirectHref;
if (!empty($obj->title)) {
$this->title = $obj->title;
* Returns link location.
* @return string
public function getHref()
return $this->href;
* Return link title, if any.
* @return null|string
public function getTitle()
return $this->title;
* Returns link name e.g: "self". This is also the key used in the Links class.
public function getName()
return $this->name;
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.