From eb0216341be64a21181e5e21a9e0705937773978 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 25 Apr 2023 10:05:35 +0200 Subject: [PATCH] Inline helper method parameter value --- .../publications/src/Commands/MakePublicationCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/publications/src/Commands/MakePublicationCommand.php b/packages/publications/src/Commands/MakePublicationCommand.php index e8531c8ea52..b46d6e2b018 100644 --- a/packages/publications/src/Commands/MakePublicationCommand.php +++ b/packages/publications/src/Commands/MakePublicationCommand.php @@ -151,7 +151,7 @@ protected function captureMediaFieldInput(PublicationFieldDefinition $field): ?P $mediaFiles = Publications::getMediaForType($this->publicationType); if ($mediaFiles->isEmpty()) { - return $this->handleEmptyMediaFilesCollection($field, 'media file', + return $this->handleEmptyMediaFilesCollection($field, // TODO Ask to pick from root media directory? sprintf('No media files found in directory %s/%s/', Hyde::getMediaDirectory(), $this->publicationType->getIdentifier() @@ -163,7 +163,7 @@ protected function captureMediaFieldInput(PublicationFieldDefinition $field): ?P } /** @return null */ - protected function handleEmptyMediaFilesCollection(PublicationFieldDefinition $field, string $type, string $message) + protected function handleEmptyMediaFilesCollection(PublicationFieldDefinition $field, string $message) { if (in_array('required', $field->rules)) { throw new InvalidArgumentException("Unable to create publication: $message"); @@ -174,7 +174,7 @@ protected function handleEmptyMediaFilesCollection(PublicationFieldDefinition $f if ($this->confirm('Would you like to skip this field?', true)) { return null; } else { - throw new InvalidArgumentException("Unable to locate any {$type}s for this publication type"); + throw new InvalidArgumentException('Unable to locate any media files for this publication type'); } }