encode arrays as string
This commit is contained in:
parent
9b652ed5d5
commit
5a3e57c2f5
2 changed files with 6 additions and 4 deletions
|
@ -127,9 +127,6 @@ class CheckCode extends Command {
|
|||
if($value === [] || is_null($value) || $value === '') {
|
||||
$output->writeln("<info>Deprecated field available: $key</info>");
|
||||
} else {
|
||||
if(is_array($value)) {
|
||||
$value = 'Array of ' . count($value) . ' element(s)';
|
||||
}
|
||||
$output->writeln("<info>Deprecated field available: $key => $value</info>");
|
||||
}
|
||||
});
|
||||
|
|
|
@ -39,6 +39,7 @@ class InfoChecker extends BasicEmitter {
|
|||
private $optionalFields = [
|
||||
'bugs',
|
||||
'category',
|
||||
'dependencies',
|
||||
'documentation',
|
||||
'namespace',
|
||||
'ocsid',
|
||||
|
@ -51,6 +52,7 @@ class InfoChecker extends BasicEmitter {
|
|||
];
|
||||
private $deprecatedFields = [
|
||||
'default_enable',
|
||||
'info',
|
||||
'public',
|
||||
'remote',
|
||||
'shipped',
|
||||
|
@ -76,6 +78,9 @@ class InfoChecker extends BasicEmitter {
|
|||
$info = $this->infoParser->parse($appPath . '/appinfo/info.xml');
|
||||
|
||||
foreach ($info as $key => $value) {
|
||||
if(is_array($value)) {
|
||||
$value = json_encode($value);
|
||||
}
|
||||
if (in_array($key, $this->mandatoryFields)) {
|
||||
$this->emit('InfoChecker', 'mandatoryFieldFound', [$key, $value]);
|
||||
continue;
|
||||
|
@ -88,7 +93,7 @@ class InfoChecker extends BasicEmitter {
|
|||
|
||||
if (in_array($key, $this->deprecatedFields)) {
|
||||
// skip empty arrays - empty arrays for remote and public are always added
|
||||
if($value === []) {
|
||||
if($value === '[]' && in_array($key, ['public', 'remote', 'info'])) {
|
||||
continue;
|
||||
}
|
||||
$this->emit('InfoChecker', 'deprecatedFieldFound', [$key, $value]);
|
||||
|
|
Loading…
Reference in a new issue