for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Victoire\Bundle\ViewReferenceBundle\Builder\Chain;
use Symfony\Component\Form\DataTransformerInterface;
/**
* Class ViewReferenceTransformerChain.
*/
class ViewReferenceTransformerChain
{
private $viewsReferenceTransformers;
public function __construct()
$this->viewsReferenceTransformers = [];
}
* add a view Manager.
*
* @param DataTransformerInterface $viewManager
$viewManager
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 string $viewNamespace
public function addTransformer(DataTransformerInterface $transformer, $viewNamespace, $outputFormat)
if (!array_key_exists($viewNamespace, $this->viewsReferenceTransformers)) {
$this->viewsReferenceTransformers[$viewNamespace] = [];
if (!array_key_exists($outputFormat, $this->viewsReferenceTransformers[$viewNamespace])) {
$this->viewsReferenceTransformers[$viewNamespace][$outputFormat] = null;
$this->viewsReferenceTransformers[$viewNamespace][$outputFormat] = $transformer;
* @param string $outputFormat
* @return DataTransformerInterface
public function getViewReferenceTransformer($viewNamespace, $outputFormat = 'xml')
switch (array_key_exists($viewNamespace, $this->viewsReferenceTransformers)) {
case true:
return $this->viewsReferenceTransformers[$viewNamespace][$outputFormat];
case false:
return $this->viewsReferenceTransformers['Victoire\Bundle\PageBundle\Entity\BasePage'][$outputFormat];
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.