for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace NerdsAndCompany\Schematic\Controllers;
use Craft;
use craft\helpers\FileHelper;
use NerdsAndCompany\Schematic\Models\Data;
use NerdsAndCompany\Schematic\Schematic;
/**
* Schematic Export Controller.
*
* Sync Craft Setups.
* @author Nerds & Company
* @copyright Copyright (c) 2015-2018, Nerds & Company
* @license MIT
* @see http://www.nerds.company
*/
class ExportController extends Base
{
* Exports the Craft datamodel.
* @param string $file file to write the schema to
$file
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 array $exclude Data to not export
$exclude
* @return int
public function actionIndex(): int
$this->disableLogging();
$result = [];
foreach ($this->getDataTypes() as $dataTypeHandle) {
$dataType = $this->module->getDataType($dataTypeHandle);
if (null == $dataType) {
continue;
}
$mapper = $dataType->getMapperHandle();
if (!$this->module->checkMapper($mapper)) {
Schematic::info('Exporting '.$dataTypeHandle);
$records = $dataType->getRecords();
$result[$dataTypeHandle] = $this->module->$mapper->export($records);
FileHelper::writeToFile($this->file, Data::toYaml($result));
Schematic::info('Exported schema to '.$this->file);
return 0;
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.