|
@@ -42,10 +42,11 @@ class CheckSintaxCommand extends ContainerAwareCommand
|
|
$this->loadParameters();
|
|
$this->loadParameters();
|
|
$error = "Nothing to do.";
|
|
$error = "Nothing to do.";
|
|
if (trim($fileYaml) != "") {
|
|
if (trim($fileYaml) != "") {
|
|
|
|
+ $output->writeln("Checking sintax " . $fileYaml);
|
|
$data = Yaml::parse(file_get_contents($fileYaml));
|
|
$data = Yaml::parse(file_get_contents($fileYaml));
|
|
$error = $this->checkFileArray($data);
|
|
$error = $this->checkFileArray($data);
|
|
} elseif (strlen(trim($dir)) > 0) {
|
|
} elseif (strlen(trim($dir)) > 0) {
|
|
- $error = $this->checkPathFile($dir);
|
|
|
|
|
|
+ $error = $this->checkPathFile($output, $dir);
|
|
} elseif (strlen(trim($string)) > 0) {
|
|
} elseif (strlen(trim($string)) > 0) {
|
|
$error = $this->verifyString($string);
|
|
$error = $this->verifyString($string);
|
|
}
|
|
}
|
|
@@ -113,15 +114,17 @@ class CheckSintaxCommand extends ContainerAwareCommand
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * @param OutputInterface $output
|
|
* @param string $dir Contains directory to read all files in it.
|
|
* @param string $dir Contains directory to read all files in it.
|
|
* @return string|null Return error.
|
|
* @return string|null Return error.
|
|
*/
|
|
*/
|
|
- private function checkPathFile($dir)
|
|
|
|
|
|
+ private function checkPathFile(OutputInterface $output, $dir)
|
|
{
|
|
{
|
|
$files = scandir($dir);
|
|
$files = scandir($dir);
|
|
$error = null;
|
|
$error = null;
|
|
foreach ($files as $file) {
|
|
foreach ($files as $file) {
|
|
if (is_file($dir . $file)) {
|
|
if (is_file($dir . $file)) {
|
|
|
|
+ $output->writeln("Checking sintax " . $dir . $file);
|
|
$errorTmp = $this->checkFileArray(Yaml::parse(file_get_contents($dir . $file)));
|
|
$errorTmp = $this->checkFileArray(Yaml::parse(file_get_contents($dir . $file)));
|
|
if (!is_null($errorTmp) && strlen(trim($errorTmp)) > 0) {
|
|
if (!is_null($errorTmp) && strlen(trim($errorTmp)) > 0) {
|
|
if (is_null($error)) {
|
|
if (is_null($error)) {
|