for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/******************************************************************************
* An implementation of dicto (scg.unibe.ch/dicto) in and for PHP.
*
* Copyright (c) 2016, 2015 Richard Klees <[email protected]>
* This software is licensed under The MIT License. You should have received
* a copy of the license along with the code.
*/
namespace Lechimp\Dicto\Indexer;
use Lechimp\Dicto\Rules\Schema;
use Psr\Log\LoggerInterface as Log;
/**
* Creates Indexers.
class IndexerFactory {
* @var Log
protected $log;
* @var \PhpParser\Parser
protected $parser;
* @var Schema[]
protected $schemas;
* @param string $project_root_path
$project_root_path
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 Schema[] $schemas
public function __construct(Log $log, \PhpParser\Parser $parser, array $schemas) {
$this->log = $log;
$this->parser = $parser;
$this->schemas = array_map(function(Schema $s) { return $s; }, $schemas);
}
* @return Indexer
public function build(Insert $insert) {
$indexer = new Indexer
( $this->log
, $this->parser
, $insert
);
foreach ($this->schemas as $schema) {
assert('$schema instanceof \Lechimp\Dicto\Rules\Schema');
$schema->register_listeners($indexer);
return $indexer;
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.