discovery = $discovery; } public function isEditable(StoredObject $document): bool { $mime_type = $this->discovery->discoverMimeType($document->getType()); foreach ($mime_type as $item) { if (array_key_exists('default', $item) && 'true' === $item['default']) { return true; } } return false; } public function renderEditButton(Environment $environment, StoredObject $document, ?array $options = null): string { return $environment->render(self::TEMPLATE, [ 'document' => $document, 'options' => $options, ]); } }