for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Pumpkin\Database;
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Common\Annotations\Reader;
use Pumpkin\Test\Test;
use Pumpkin\Test\TestHelper;
class TableBuilder extends TestHelper
{
/**
* @var Reader
*/
private $reader;
* Constructor.
*
* @param Test $test
* @param Reader $reader
$reader
null|Reader
This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.
@param
It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.
public function __construct(Test $test, Reader $reader = null)
AnnotationRegistry::registerAutoloadNamespace('Pumpkin\Database\Annotation', __DIR__ . '/../..');
$this->reader = $reader ?: new AnnotationReader();
parent::__construct($test);
}
* @return Table[]
public function getTables()
$result = array();
foreach ($this->getAnnotations() as $annotation) {
if ($annotation instanceof Annotation) {
$result[$annotation->value] = $this->createTable($annotation->value);
return $result;
* @return array
private function getAnnotations()
return $this->reader->getMethodAnnotations($this->getTest()->getReflectedTestMethod());
* @param string $tableFullName
* @return Table
private function createTable($tableFullName)
list($dataBaseName, $tableName) = explode('.', $tableFullName);
return new Table($this->getTest(), $dataBaseName, $tableName);
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.