mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Fix review remarks
This commit is contained in:
@@ -36,18 +36,18 @@ class WopiEditTwigExtensionRuntime implements RuntimeExtensionInterface
|
||||
]);
|
||||
}
|
||||
|
||||
public function isEditable(Environment $environment, StoredObject $document): bool
|
||||
public function isEditable(StoredObject $document): bool
|
||||
{
|
||||
$mime_type = $this->discovery->discoverMimeType($document->getType());
|
||||
|
||||
if (empty($mime_type)) {
|
||||
if ([] === $mime_type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (array_key_exists('default', $mime_type[0])
|
||||
&& $mime_type[0]['default'] === 'true'
|
||||
) {
|
||||
return true;
|
||||
foreach ($mime_type as $item) {
|
||||
if (array_key_exists('default', $item) && $item['default'] === 'true') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user