Skip to content

Commit

Permalink
Issue CollaboraOnline#43: Add inline @var doc for static analysis.
Browse files Browse the repository at this point in the history
  • Loading branch information
donquixote committed Nov 11, 2024
1 parent 52d4486 commit 58d465d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Cool/CoolUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public static function getFile(Media $media) {

/** Get the file based on the entity id */
public static function getFileById($id) {
/** @var \Drupal\media\MediaInterface|null $media */
$media = \Drupal::entityTypeManager()->getStorage('media')->load($id);
return CoolUtils::getFile($media);
}
Expand Down
1 change: 1 addition & 0 deletions src/Plugin/Field/FieldFormatter/CoolPreview.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function settingsSummary() {
* {@inheritdoc}
*/
public function viewElements(FieldItemListInterface $items, $langcode) {
/** @var \Drupal\Core\Field\EntityReferenceFieldItemListInterface $items */
$elements = [];
$media = $items->getEntity();
if (!$media instanceof MediaInterface) {
Expand Down

0 comments on commit 58d465d

Please sign in to comment.