for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace As3\Modlr\Persister\MongoDb;
use Doctrine\MongoDB\Collection;
/**
* Handles requests to create or sync schema
*
* @author Josh Worden <[email protected]>
* @todo This should be updated to read indices from the metadata factory
*/
class SchemaManager
{
* Applies schemata
* @param Collection $collection The MongoDB Collection
* @param array $index Associative array containing index data
$index
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.
public function createSchemata(Collection $collection, array $schemata)
foreach ($schemata as $schema) {
$schema['options']['background'] = true;
$collection->ensureIndex($schema['keys'], $schema['options']);
}
* Syncs schemata state
* @todo Implement
public function syncSchemata(Collection $collection, array $schemata)
$collection
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$schemata
return false;
// Remove all indices that match the expected format (modlr_md5hash) and are NOT present in $schemata
// Loop over $schemata and force update or remove/add index. Ensure background:true
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.