Skip to content

Commit

Permalink
refactor: Add typecast before use
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Jan 29, 2024
1 parent cb0193f commit 06b6739
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/services/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ protected function updateBlockTypeContent(string $fieldType, string $value, Cant
// Block types have the same methods as Matrix
/* @var Matrix $blockField */
$contentTableName = $blockField->contentTable;

Check failure on line 150 in src/services/Assets.php

View workflow job for this annotation

GitHub Actions / PHPStan

Access to an undefined property craft\base\FieldInterface::$contentTable.
/* @var Matrix $blockField */
$fields = $blockField->getBlockTypeFields();

Check failure on line 152 in src/services/Assets.php

View workflow job for this annotation

GitHub Actions / PHPStan

Call to an undefined method craft\base\FieldInterface::getBlockTypeFields().
// Filter out any non-CantoDamAsset fields
$fields = (new Collection($fields))->filter(fn($value) => $value instanceof CantoDamAsset)->toArray();
Expand Down

0 comments on commit 06b6739

Please sign in to comment.