66
77use Craft ;
88use craft \base \ElementInterface ;
9- use craft \elements \Asset ;
109use craft \elements \conditions \ElementCondition ;
1110use craft \elements \db \AssetQuery ;
1211use craft \elements \db \ElementQueryInterface ;
3029use craft \services \Gql as GqlService ;
3130use craft \web \UploadedFile ;
3231use CraftCms \Cms \Cms ;
32+ use CraftCms \Cms \Element \Elements \Asset ;
3333use CraftCms \Cms \Element \ElementSources ;
3434use CraftCms \Cms \Field \Events \LocateUploadedFiles ;
3535use CraftCms \Cms \Support \Arr ;
3636use CraftCms \Cms \Support \Html ;
3737use GraphQL \Type \Definition \Type ;
3838use Illuminate \Support \Collection ;
3939use Illuminate \Validation \Rule ;
40+ use Override ;
4041use Twig \Error \RuntimeError ;
4142use yii \base \InvalidConfigException ;
4243
@@ -60,7 +61,7 @@ final class Assets extends BaseRelationField
6061 /**
6162 * {@inheritdoc}
6263 */
63- #[\ Override]
64+ #[Override]
6465 public static function displayName (): string
6566 {
6667 return t ('Assets ' );
@@ -69,7 +70,7 @@ public static function displayName(): string
6970 /**
7071 * {@inheritdoc}
7172 */
72- #[\ Override]
73+ #[Override]
7374 public static function icon (): string
7475 {
7576 return 'image ' ;
@@ -86,7 +87,7 @@ public static function elementType(): string
8687 /**
8788 * {@inheritdoc}
8889 */
89- #[\ Override]
90+ #[Override]
9091 protected static function canShowSiteMenu (): bool
9192 {
9293 return false ;
@@ -95,7 +96,7 @@ protected static function canShowSiteMenu(): bool
9596 /**
9697 * {@inheritdoc}
9798 */
98- #[\ Override]
99+ #[Override]
99100 public static function defaultSelectionLabel (): string
100101 {
101102 return t ('Add an asset ' );
@@ -104,7 +105,7 @@ public static function defaultSelectionLabel(): string
104105 /**
105106 * {@inheritdoc}
106107 */
107- #[\ Override]
108+ #[Override]
108109 public static function phpType (): string
109110 {
110111 return sprintf ('\\%s| \\%s< \\%s> ' , AssetQuery::class, ElementCollection::class, Asset::class);
@@ -230,7 +231,7 @@ public function __construct(array $config = [])
230231 parent ::__construct ($ config );
231232 }
232233
233- #[\ Override]
234+ #[Override]
234235 public static function getRules (): array
235236 {
236237 return array_merge (parent ::getRules (), [
@@ -243,7 +244,7 @@ public static function getRules(): array
243244 /**
244245 * {@inheritdoc}
245246 */
246- #[\ Override]
247+ #[Override]
247248 public function getSourceOptions (): array
248249 {
249250 $ sourceOptions = [];
@@ -277,7 +278,7 @@ public function getFileKindOptions(): array
277278 /**
278279 * {@inheritdoc}
279280 */
280- #[\ Override]
281+ #[Override]
281282 protected function inputHtml (mixed $ value , ?ElementInterface $ element , bool $ inline ): string
282283 {
283284 try {
@@ -298,7 +299,7 @@ protected function inputHtml(mixed $value, ?ElementInterface $element, bool $inl
298299 /**
299300 * {@inheritdoc}
300301 */
301- #[\ Override]
302+ #[Override]
302303 public function getElementValidationRules (): array
303304 {
304305 $ rules = parent ::getElementValidationRules ();
@@ -382,7 +383,7 @@ public function validateFileSize(ElementInterface $element): void
382383 /**
383384 * {@inheritdoc}
384385 */
385- #[\ Override]
386+ #[Override]
386387 public function normalizeValue (mixed $ value , ?ElementInterface $ element ): mixed
387388 {
388389 // If data strings are passed along, make sure the array keys are retained.
@@ -421,7 +422,7 @@ public function normalizeValue(mixed $value, ?ElementInterface $element): mixed
421422 /**
422423 * {@inheritdoc}
423424 */
424- #[\ Override]
425+ #[Override]
425426 public function isValueEmpty (mixed $ value , ElementInterface $ element ): bool
426427 {
427428 return parent ::isValueEmpty ($ value , $ element ) && empty ($ this ->_getUploadedFiles ($ element ));
@@ -438,7 +439,7 @@ public function resolveDynamicPathToFolderId(?ElementInterface $element = null):
438439 /**
439440 * {@inheritdoc}
440441 */
441- #[\ Override]
442+ #[Override]
442443 public function includeInGqlSchema (GqlSchema $ schema ): bool
443444 {
444445 return Gql::canQueryAssets ($ schema );
@@ -447,7 +448,7 @@ public function includeInGqlSchema(GqlSchema $schema): bool
447448 /**
448449 * {@inheritdoc}
449450 */
450- #[\ Override]
451+ #[Override]
451452 public function getContentGqlType (): array
452453 {
453454 return [
@@ -462,7 +463,7 @@ public function getContentGqlType(): array
462463 /**
463464 * {@inheritdoc}
464465 */
465- #[\ Override]
466+ #[Override]
466467 protected function previewHtml (ElementCollection $ elements ): string
467468 {
468469 return Cp::elementPreviewHtml (
@@ -474,7 +475,7 @@ protected function previewHtml(ElementCollection $elements): string
474475 /**
475476 * {@inheritdoc}
476477 */
477- #[\ Override]
478+ #[Override]
478479 public function previewPlaceholderHtml (mixed $ value , ?ElementInterface $ element ): string
479480 {
480481 $ asset = new Asset ;
@@ -499,7 +500,7 @@ public function previewPlaceholderHtml(mixed $value, ?ElementInterface $element)
499500 /**
500501 * {@inheritdoc}
501502 */
502- #[\ Override]
503+ #[Override]
503504 public function beforeElementSave (ElementInterface $ element , bool $ isNew ): bool
504505 {
505506 // Only handle file uploads for the initial site
@@ -582,7 +583,7 @@ public function beforeElementSave(ElementInterface $element, bool $isNew): bool
582583 /**
583584 * {@inheritdoc}
584585 */
585- #[\ Override]
586+ #[Override]
586587 public function afterElementSave (ElementInterface $ element , bool $ isNew ): void
587588 {
588589 // No special treatment for revisions
@@ -658,7 +659,7 @@ public function afterElementSave(ElementInterface $element, bool $isNew): void
658659 /**
659660 * {@inheritdoc}
660661 */
661- #[\ Override]
662+ #[Override]
662663 public function getEagerLoadingGqlConditions (): ?array
663664 {
664665 $ allowedEntities = Gql::extractAllowedEntitiesFromSchema ();
@@ -683,7 +684,7 @@ public function getEagerLoadingGqlConditions(): ?array
683684 /**
684685 * {@inheritdoc}
685686 */
686- #[\ Override]
687+ #[Override]
687688 public function getInputSources (?ElementInterface $ element = null ): array
688689 {
689690 $ folder = $ this ->_uploadFolder ($ element , false , false );
@@ -755,7 +756,7 @@ public function getInputSources(?ElementInterface $element = null): array
755756 /**
756757 * {@inheritdoc}
757758 */
758- #[\ Override]
759+ #[Override]
759760 protected function inputTemplateVariables (array |ElementQueryInterface |null $ value = null , ?ElementInterface $ element = null ): array
760761 {
761762 $ variables = parent ::inputTemplateVariables ($ value , $ element );
@@ -798,7 +799,7 @@ protected function inputTemplateVariables(array|ElementQueryInterface|null $valu
798799 /**
799800 * {@inheritdoc}
800801 */
801- #[\ Override]
802+ #[Override]
802803 public function getInputSelectionCriteria (): array
803804 {
804805 $ criteria = parent ::getInputSelectionCriteria ();
@@ -825,7 +826,7 @@ protected function createSelectionCondition(): ElementCondition
825826 /**
826827 * {@inheritdoc}
827828 */
828- #[\ Override]
829+ #[Override]
829830 protected function showSearchInput (?ElementInterface $ element ): bool
830831 {
831832 if (! $ this ->showSearchInput || $ this ->sources === '* ' ) {
0 commit comments