for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Arrilot\Widgets;
use Arrilot\Widgets\Misc\NamespaceNotFoundException;
class NamespacesRepository
{
/**
* The array of namespaces.
*
* @var array
*/
protected $namespaces;
* Register a namespace.
* @param string $alias
* @param string $namespace
* @return WidgetNamespaces
public function registerNamespace($alias, $namespace)
$this->namespaces[$alias] = rtrim($namespace, '\\');
return $this;
}
* Get namespace by his alias.
* @param string $label
$label
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.
* @throws \Exception
* @return string
public function getNamespace($alias)
if (!isset($this->namespaces[$alias])) {
throw new NamespaceNotFoundException('Namespace not found with the alias "'.$alias.'"');
return $this->namespaces[$alias];
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.