Skip to content

Commit 5dee0af

Browse files
committed
#1253 Remove usage of constants not available for PHP 7 version
1 parent 73b2e35 commit 5dee0af

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

library/Application/Console/Model/EnrichmentDeleteCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7979

8080
if ($key === null) {
8181
$output->writeln('<error>Enrichment key is required</error>');
82-
return self::FAILURE;
82+
return 1;
8383
}
8484

8585
$enrichment = EnrichmentKey::fetchByName($key);
8686

8787
if ($enrichment === null) {
8888
$output->writeln("<error>Enrichment key \"{$key}\" not found</error>");
89-
return self::FAILURE;
89+
return 1;
9090
}
9191

9292
if (! $input->getOption(self::OPTION_FORCE)) {
@@ -96,7 +96,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9696

9797
if (! $question->ask($input, $output, $confirmation)) {
9898
$output->writeln("Not removing enrichment key \"{$key}\".");
99-
return self::SUCCESS;
99+
return 0;
100100
}
101101
}
102102

@@ -107,6 +107,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
107107
$helper = new Admin_Model_EnrichmentKeys();
108108
$helper->removeTranslations($key);
109109

110-
return self::SUCCESS;
110+
return 0;
111111
}
112112
}

library/Application/Console/Model/EnrichmentExportCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8686

8787
if ($enrichment === null) {
8888
$output->writeln("<error>Enrichment key \"{$key}\" not found</error>");
89-
return self::FAILURE;
89+
return 1;
9090
}
9191
}
9292
}
9393

9494
if (count($keys) === 0) {
9595
$output->writeln("<info>No enrichment keys found</info>");
96-
return self::SUCCESS;
96+
return 0;
9797
}
9898

9999
$helper = new Admin_Model_EnrichmentKeys();
@@ -123,6 +123,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
123123
file_put_contents($outputFile, $yaml);
124124
}
125125

126-
return self::SUCCESS;
126+
return 0;
127127
}
128128
}

library/Application/Console/Model/EnrichmentImportCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6666

6767
if (! file_exists($file)) {
6868
$output->writeln('<fg=red>Input file not found</>');
69-
return self::FAILURE;
69+
return 1;
7070
}
7171

7272
if (! is_readable($file)) {
7373
$output->writeln('<fg=red>Input file not readable</>');
74-
return self::FAILURE;
74+
return 1;
7575
}
7676

7777
$importer = new Application_Configuration_EnrichmentConfigImporter();
7878
$importer->setOutput($output);
7979

8080
$importer->import($file);
8181

82-
return self::SUCCESS;
82+
return 0;
8383
}
8484
}

library/Application/Console/Model/EnrichmentListCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7676
->setRows($rows);
7777
$table->render();
7878

79-
return self::SUCCESS;
79+
return 0;
8080
}
8181
}

library/Application/Console/Model/EnrichmentRenameCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,28 +72,28 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7272

7373
if ($key === null) {
7474
$output->writeln('<error>Enrichment key is required.</error></>');
75-
return self::FAILURE;
75+
return 1;
7676
}
7777

7878
$newKey = $input->getArgument(self::ARGUMENT_NEW_KEY);
7979

8080
if ($newKey === null) {
8181
$output->writeln('<error>New enrichment key name is required.</error></>');
82-
return self::FAILURE;
82+
return 1;
8383
}
8484

8585
$enrichment = EnrichmentKey::fetchByName($key);
8686

8787
if ($enrichment === null) {
8888
$output->writeln("<error>Enrichment key \"{$key}\" not found.</error>");
89-
return self::FAILURE;
89+
return 1;
9090
}
9191

9292
$newEnrichment = EnrichmentKey::fetchByName($newKey);
9393

9494
if ($newEnrichment !== null) {
9595
$output->writeln("<error>Enrichment key \"{$newKey}\" already exists.</error>");
96-
return self::FAILURE;
96+
return 1;
9797
}
9898

9999
$output->writeln("Renaming key \"{$key}\" to \"{$newKey}\".");
@@ -105,6 +105,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
105105
$helper = new Admin_Model_EnrichmentKeys();
106106
$helper->createTranslations($newKey, $key);
107107

108-
return self::SUCCESS;
108+
return 0;
109109
}
110110
}

0 commit comments

Comments
 (0)