1
0
mirror of synced 2025-02-09 00:39:25 +03:00

Remove constants existence validation

These constants are available since PHP 5.4 and since we're requiring
PHP 7.1 there's no reason to require them.

I've also simplified the `array_map()` call since it's useless to
define a closure that simply calls a function.
This commit is contained in:
Luís Cobucci 2017-11-24 00:56:42 +01:00
parent 214dc9896b
commit 8a893068ce
No known key found for this signature in database
GPG Key ID: EC61C5F01750ED3C

View File

@ -217,11 +217,7 @@ EOT
}
if (is_array($value)) {
if (defined('JSON_UNESCAPED_UNICODE') && defined('JSON_UNESCAPED_SLASHES')) {
return json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
}
return json_encode($value);
return json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
}
if (is_object($value)) {
@ -283,14 +279,6 @@ EOT
*/
private function formatEntityListeners(array $entityListeners)
{
return $this->formatField(
'Entity listeners',
array_map(
function ($entityListener) {
return get_class($entityListener);
},
$entityListeners
)
);
return $this->formatField('Entity listeners', array_map('get_class', $entityListeners));
}
}