for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Saxulum\ElasticSearchQueryBuilder\Node;
class ArrayNode extends AbstractParentNode
{
/**
* @param AbstractNode $node
* @param bool $allowDefault
*
* @return $this
*/
public function add(AbstractNode $node, $allowDefault = false)
$node->setParent($this);
$this->children[] = $node;
$this->allowDefault[] = $allowDefault;
return $this;
}
* @return array
public function getDefault()
return [];
* @return \stdClass|null
public function serialize()
$serialized = [];
foreach ($this->children as $i => $child) {
$this->serializeChild($serialized, $i, $child);
if ([] === $serialized) {
return;
return $serialized;
* @param array $serialized
* @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 AbstractNode $child
private function serializeChild(array &$serialized, $i, AbstractNode $child)
if (null !== $serializedChild = $child->serialize()) {
$serialized[] = $serializedChild;
} elseif ($this->allowDefault[$i]) {
$serialized[] = $child->getDefault();
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.