From 9d7a02fccfdeea2d3568ecda0b4f0ee2d57a2608 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Wed, 10 Jan 2024 00:51:45 +0000 Subject: [PATCH] Apply fixes from StyleCI --- .../Commands/PublishHomepageCommand.php | 6 +-- .../Contracts/FrontMatter/BlogPostSchema.php | 12 ++--- .../Contracts/FrontMatter/PageSchema.php | 6 +-- .../FrontMatter/SubSchemas/AuthorSchema.php | 6 +-- .../SubSchemas/FeaturedImageSchema.php | 16 +++--- .../SubSchemas/NavigationSchema.php | 8 +-- .../src/Support/Filesystem/MediaFile.php | 18 +++---- .../src/Support/Models/RouteListItem.php | 4 +- .../tests/Feature/MarkdownServiceTest.php | 2 +- .../tests/Feature/Support/MediaFileTest.php | 4 +- .../tests/Feature/Support/ProjectFileTest.php | 4 +- .../tests/Feature/Support/SourceFileTest.php | 4 +- .../tests/Unit/BreadcrumbsComponentTest.php | 2 +- .../tests/Unit/Pages/BaseHydePageUnitTest.php | 4 +- .../tests/Unit/SchemaContractsTest.php | 48 ++++++++--------- .../Unit/Views/FeaturedImageViewTest.php | 2 +- .../RelatedPublicationsComponent.php | 4 +- .../Feature/CreatesNewPublicationPageTest.php | 2 +- .../Feature/MakePublicationCommandTest.php | 52 +++++++++---------- .../tests/Feature/PublicationListPageTest.php | 12 ++--- .../tests/Feature/PublicationTypeTest.php | 4 +- .../src/Http/ExceptionHandler.php | 4 +- .../src/Http/HtmlResponse.php | 2 +- .../src/Models/FileObject.php | 16 +++--- .../realtime-compiler/src/Routing/Router.php | 2 +- 25 files changed, 122 insertions(+), 122 deletions(-) diff --git a/packages/framework/src/Console/Commands/PublishHomepageCommand.php b/packages/framework/src/Console/Commands/PublishHomepageCommand.php index 6a2a19dd7da..50b7ddb9df6 100644 --- a/packages/framework/src/Console/Commands/PublishHomepageCommand.php +++ b/packages/framework/src/Console/Commands/PublishHomepageCommand.php @@ -33,17 +33,17 @@ class PublishHomepageCommand extends Command /** @var array */ protected array $options = [ - 'welcome'=> [ + 'welcome' => [ 'name' => 'Welcome', 'description' => 'The default welcome page.', 'group' => 'hyde-welcome-page', ], - 'posts'=> [ + 'posts' => [ 'name' => 'Posts Feed', 'description' => 'A feed of your latest posts. Perfect for a blog site!', 'group' => 'hyde-posts-page', ], - 'blank'=> [ + 'blank' => [ 'name' => 'Blank Starter', 'description' => 'A blank Blade template with just the base layout.', 'group' => 'hyde-blank-page', diff --git a/packages/framework/src/Markdown/Contracts/FrontMatter/BlogPostSchema.php b/packages/framework/src/Markdown/Contracts/FrontMatter/BlogPostSchema.php index ad1b445e6df..cee053f88a8 100644 --- a/packages/framework/src/Markdown/Contracts/FrontMatter/BlogPostSchema.php +++ b/packages/framework/src/Markdown/Contracts/FrontMatter/BlogPostSchema.php @@ -13,11 +13,11 @@ interface BlogPostSchema extends PageSchema { public const BLOG_POST_SCHEMA = [ - 'title' => 'string', - 'description' => 'string', - 'category' => 'string', - 'date' => 'string', - 'author' => ['string', AuthorSchema::AUTHOR_SCHEMA], - 'image' => ['string', FeaturedImageSchema::FEATURED_IMAGE_SCHEMA], + 'title' => 'string', + 'description' => 'string', + 'category' => 'string', + 'date' => 'string', + 'author' => ['string', AuthorSchema::AUTHOR_SCHEMA], + 'image' => ['string', FeaturedImageSchema::FEATURED_IMAGE_SCHEMA], ]; } diff --git a/packages/framework/src/Markdown/Contracts/FrontMatter/PageSchema.php b/packages/framework/src/Markdown/Contracts/FrontMatter/PageSchema.php index a7e93c314b8..ac8eed79deb 100644 --- a/packages/framework/src/Markdown/Contracts/FrontMatter/PageSchema.php +++ b/packages/framework/src/Markdown/Contracts/FrontMatter/PageSchema.php @@ -12,8 +12,8 @@ interface PageSchema extends FrontMatterSchema { public const PAGE_SCHEMA = [ - 'title' => 'string', - 'canonicalUrl' => 'string', // While not present in the page data, it is supported as a front matter key for the accessor data source. - 'navigation' => NavigationSchema::NAVIGATION_SCHEMA, + 'title' => 'string', + 'canonicalUrl' => 'string', // While not present in the page data, it is supported as a front matter key for the accessor data source. + 'navigation' => NavigationSchema::NAVIGATION_SCHEMA, ]; } diff --git a/packages/framework/src/Markdown/Contracts/FrontMatter/SubSchemas/AuthorSchema.php b/packages/framework/src/Markdown/Contracts/FrontMatter/SubSchemas/AuthorSchema.php index a33f76497cc..7028cef6d6c 100644 --- a/packages/framework/src/Markdown/Contracts/FrontMatter/SubSchemas/AuthorSchema.php +++ b/packages/framework/src/Markdown/Contracts/FrontMatter/SubSchemas/AuthorSchema.php @@ -12,8 +12,8 @@ interface AuthorSchema extends BlogPostSchema { public const AUTHOR_SCHEMA = [ - 'name' => 'string', - 'username' => 'string', - 'website' => 'string', + 'name' => 'string', + 'username' => 'string', + 'website' => 'string', ]; } diff --git a/packages/framework/src/Markdown/Contracts/FrontMatter/SubSchemas/FeaturedImageSchema.php b/packages/framework/src/Markdown/Contracts/FrontMatter/SubSchemas/FeaturedImageSchema.php index b7c41e9955d..ad356ee5775 100644 --- a/packages/framework/src/Markdown/Contracts/FrontMatter/SubSchemas/FeaturedImageSchema.php +++ b/packages/framework/src/Markdown/Contracts/FrontMatter/SubSchemas/FeaturedImageSchema.php @@ -13,13 +13,13 @@ interface FeaturedImageSchema extends BlogPostSchema { public const FEATURED_IMAGE_SCHEMA = [ - 'source' => 'string', // Name of a file in _media/ or a remote URL (required) - 'altText' => 'string', // The alt text (important for accessibility) // todo: Support alt, description - 'titleText' => 'string', // The title text (hover tooltip & metadata) // todo: Support title, caption - 'licenseName' => 'string', // The name of the license (e.g. "CC BY 4.0") - 'licenseUrl' => 'string', // The URL of the license (e.g. "https://creativecommons.org/licenses/by/4.0/") - 'authorName' => 'string', // The name of the author/photographer of the image (e.g. "John Doe", Wikimedia Commons) - 'authorUrl' => 'string', // The URL of the author/photographer of the image (e.g. "https://commons.wikimedia.org/wiki/User:John_Doe", Wikimedia Commons) - 'copyright' => 'string', // The copyright text (e.g. "© 2023 John Doe") + 'source' => 'string', // Name of a file in _media/ or a remote URL (required) + 'altText' => 'string', // The alt text (important for accessibility) // todo: Support alt, description + 'titleText' => 'string', // The title text (hover tooltip & metadata) // todo: Support title, caption + 'licenseName' => 'string', // The name of the license (e.g. "CC BY 4.0") + 'licenseUrl' => 'string', // The URL of the license (e.g. "https://creativecommons.org/licenses/by/4.0/") + 'authorName' => 'string', // The name of the author/photographer of the image (e.g. "John Doe", Wikimedia Commons) + 'authorUrl' => 'string', // The URL of the author/photographer of the image (e.g. "https://commons.wikimedia.org/wiki/User:John_Doe", Wikimedia Commons) + 'copyright' => 'string', // The copyright text (e.g. "© 2023 John Doe") ]; } diff --git a/packages/framework/src/Markdown/Contracts/FrontMatter/SubSchemas/NavigationSchema.php b/packages/framework/src/Markdown/Contracts/FrontMatter/SubSchemas/NavigationSchema.php index ba655e2d673..707c600121f 100644 --- a/packages/framework/src/Markdown/Contracts/FrontMatter/SubSchemas/NavigationSchema.php +++ b/packages/framework/src/Markdown/Contracts/FrontMatter/SubSchemas/NavigationSchema.php @@ -13,9 +13,9 @@ interface NavigationSchema extends PageSchema { public const NAVIGATION_SCHEMA = [ - 'label' => 'string', // The text to display - 'priority' => 'int', // Order is also supported - 'hidden' => 'bool', // Visible is also supported (but obviously invert the value) - 'group' => 'string', // Category is also supported + 'label' => 'string', // The text to display + 'priority' => 'int', // Order is also supported + 'hidden' => 'bool', // Visible is also supported (but obviously invert the value) + 'group' => 'string', // Category is also supported ]; } diff --git a/packages/framework/src/Support/Filesystem/MediaFile.php b/packages/framework/src/Support/Filesystem/MediaFile.php index 75305b9119b..45298a50694 100644 --- a/packages/framework/src/Support/Filesystem/MediaFile.php +++ b/packages/framework/src/Support/Filesystem/MediaFile.php @@ -70,18 +70,18 @@ public function getMimeType(): string // See if we can find a mime type for the extension instead of // having to rely on a PHP extension and filesystem lookups. $lookup = [ - 'txt' => 'text/plain', - 'md' => 'text/markdown', + 'txt' => 'text/plain', + 'md' => 'text/markdown', 'html' => 'text/html', - 'css' => 'text/css', - 'svg' => 'image/svg+xml', - 'png' => 'image/png', - 'jpg' => 'image/jpeg', + 'css' => 'text/css', + 'svg' => 'image/svg+xml', + 'png' => 'image/png', + 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', - 'gif' => 'image/gif', + 'gif' => 'image/gif', 'json' => 'application/json', - 'js' => 'application/javascript', - 'xml' => 'application/xml', + 'js' => 'application/javascript', + 'xml' => 'application/xml', ]; if (isset($lookup[$extension])) { diff --git a/packages/framework/src/Support/Models/RouteListItem.php b/packages/framework/src/Support/Models/RouteListItem.php index 2b59f50f5e4..58afdc3fcdf 100644 --- a/packages/framework/src/Support/Models/RouteListItem.php +++ b/packages/framework/src/Support/Models/RouteListItem.php @@ -28,10 +28,10 @@ public function __construct(Route $route) public function toArray(): array { return [ - 'page_type' => $this->stylePageType($this->route->getPageClass()), + 'page_type' => $this->stylePageType($this->route->getPageClass()), 'source_file' => $this->styleSourcePath($this->route->getSourcePath()), 'output_file' => $this->styleOutputPath($this->route->getOutputPath()), - 'route_key' => $this->styleRouteKey($this->route->getRouteKey()), + 'route_key' => $this->styleRouteKey($this->route->getRouteKey()), ]; } diff --git a/packages/framework/tests/Feature/MarkdownServiceTest.php b/packages/framework/tests/Feature/MarkdownServiceTest.php index 828d1c6bb02..2cb4cd4239b 100644 --- a/packages/framework/tests/Feature/MarkdownServiceTest.php +++ b/packages/framework/tests/Feature/MarkdownServiceTest.php @@ -93,7 +93,7 @@ public function test_raw_html_tags_are_stripped_by_default() public function test_raw_html_tags_are_not_stripped_when_explicitly_enabled() { - config(['markdown.allow_html' =>true]); + config(['markdown.allow_html' => true]); $markdown = '

foo

'; $service = new MarkdownService($markdown); $html = $service->parse(); diff --git a/packages/framework/tests/Feature/Support/MediaFileTest.php b/packages/framework/tests/Feature/Support/MediaFileTest.php index 9694028d44c..9b514b1c31f 100644 --- a/packages/framework/tests/Feature/Support/MediaFileTest.php +++ b/packages/framework/tests/Feature/Support/MediaFileTest.php @@ -75,8 +75,8 @@ public function test_to_array_returns_array_of_file_properties() $this->file('foo.txt', 'foo bar'); $this->assertSame([ - 'name' => 'foo.txt', - 'path' => 'foo.txt', + 'name' => 'foo.txt', + 'path' => 'foo.txt', 'length' => 7, 'mimeType' => 'text/plain', ], MediaFile::make('foo.txt')->toArray()); diff --git a/packages/framework/tests/Feature/Support/ProjectFileTest.php b/packages/framework/tests/Feature/Support/ProjectFileTest.php index 038883b4a16..e1ebb9d8bd5 100644 --- a/packages/framework/tests/Feature/Support/ProjectFileTest.php +++ b/packages/framework/tests/Feature/Support/ProjectFileTest.php @@ -74,8 +74,8 @@ public function test_to_array_returns_array_of_file_properties() $this->file('foo.txt', 'foo bar'); $this->assertSame([ - 'name' => 'foo.txt', - 'path' => 'foo.txt', + 'name' => 'foo.txt', + 'path' => 'foo.txt', ], ProjectFileTestClass::make('foo.txt')->toArray()); } diff --git a/packages/framework/tests/Feature/Support/SourceFileTest.php b/packages/framework/tests/Feature/Support/SourceFileTest.php index 13a76c453cc..2b85f6e6809 100644 --- a/packages/framework/tests/Feature/Support/SourceFileTest.php +++ b/packages/framework/tests/Feature/Support/SourceFileTest.php @@ -93,8 +93,8 @@ public function test_to_array_returns_array_of_file_properties() $this->file('foo.txt', 'foo bar'); $this->assertSame([ - 'name' => 'foo.txt', - 'path' => 'foo.txt', + 'name' => 'foo.txt', + 'path' => 'foo.txt', 'pageClass' => HydePage::class, ], SourceFile::make('foo.txt')->toArray()); } diff --git a/packages/framework/tests/Unit/BreadcrumbsComponentTest.php b/packages/framework/tests/Unit/BreadcrumbsComponentTest.php index 3656c1e6f9c..c161d55b9f4 100644 --- a/packages/framework/tests/Unit/BreadcrumbsComponentTest.php +++ b/packages/framework/tests/Unit/BreadcrumbsComponentTest.php @@ -47,7 +47,7 @@ public function testCanRender() $view = Mockery::mock(\Illuminate\View\View::class); $mock = Mockery::mock(Factory::class); $mock->shouldReceive('make')->once()->with('hyde::components.breadcrumbs')->andReturn($view); - app()->singleton('view', fn () =>$mock); + app()->singleton('view', fn () => $mock); View::swap($mock); $this->assertSame($view, (new BreadcrumbsComponent())->render()); diff --git a/packages/framework/tests/Unit/Pages/BaseHydePageUnitTest.php b/packages/framework/tests/Unit/Pages/BaseHydePageUnitTest.php index c900c38d3e6..3d063cc9770 100644 --- a/packages/framework/tests/Unit/Pages/BaseHydePageUnitTest.php +++ b/packages/framework/tests/Unit/Pages/BaseHydePageUnitTest.php @@ -37,8 +37,8 @@ protected function setUp(): void ]), 'share' => null, ])); - app()->bind(\Illuminate\Contracts\View\Factory::class, fn () =>$mock); - app()->bind('view', fn () =>$mock); + app()->bind(\Illuminate\Contracts\View\Factory::class, fn () => $mock); + app()->bind('view', fn () => $mock); Render::swap(new RenderData()); } diff --git a/packages/framework/tests/Unit/SchemaContractsTest.php b/packages/framework/tests/Unit/SchemaContractsTest.php index 3ac8a06a964..9f9f6d1205a 100644 --- a/packages/framework/tests/Unit/SchemaContractsTest.php +++ b/packages/framework/tests/Unit/SchemaContractsTest.php @@ -45,42 +45,42 @@ class SchemaContractsTest extends UnitTestCase public function testSchemasAreNotAccidentallyChanged() { $this->assertSame([ - 'title' => 'string', - 'canonicalUrl' => 'string', - 'navigation' => NavigationSchema::NAVIGATION_SCHEMA, + 'title' => 'string', + 'canonicalUrl' => 'string', + 'navigation' => NavigationSchema::NAVIGATION_SCHEMA, ], PageSchema::PAGE_SCHEMA); $this->assertSame([ - 'label' => 'string', - 'priority' => 'int', - 'hidden' => 'bool', - 'group' => 'string', + 'label' => 'string', + 'priority' => 'int', + 'hidden' => 'bool', + 'group' => 'string', ], NavigationSchema::NAVIGATION_SCHEMA); $this->assertSame([ - 'title' => 'string', - 'description' => 'string', - 'category' => 'string', - 'date' => 'string', - 'author' => ['string', AuthorSchema::AUTHOR_SCHEMA], - 'image' => ['string', FeaturedImageSchema::FEATURED_IMAGE_SCHEMA], + 'title' => 'string', + 'description' => 'string', + 'category' => 'string', + 'date' => 'string', + 'author' => ['string', AuthorSchema::AUTHOR_SCHEMA], + 'image' => ['string', FeaturedImageSchema::FEATURED_IMAGE_SCHEMA], ], BlogPostSchema::BLOG_POST_SCHEMA); $this->assertSame([ - 'name' => 'string', - 'username' => 'string', - 'website' => 'string', + 'name' => 'string', + 'username' => 'string', + 'website' => 'string', ], AuthorSchema::AUTHOR_SCHEMA); $this->assertSame([ - 'source' => 'string', - 'altText' => 'string', - 'titleText' => 'string', - 'licenseName' => 'string', - 'licenseUrl' => 'string', - 'authorName' => 'string', - 'authorUrl' => 'string', - 'copyright' => 'string', + 'source' => 'string', + 'altText' => 'string', + 'titleText' => 'string', + 'licenseName' => 'string', + 'licenseUrl' => 'string', + 'authorName' => 'string', + 'authorUrl' => 'string', + 'copyright' => 'string', ], FeaturedImageSchema::FEATURED_IMAGE_SCHEMA); } diff --git a/packages/framework/tests/Unit/Views/FeaturedImageViewTest.php b/packages/framework/tests/Unit/Views/FeaturedImageViewTest.php index a420f626254..9b3c11db6f6 100644 --- a/packages/framework/tests/Unit/Views/FeaturedImageViewTest.php +++ b/packages/framework/tests/Unit/Views/FeaturedImageViewTest.php @@ -266,7 +266,7 @@ protected function stripWhitespace(string $string): string return str_replace([' ', "\r", "\n"], '', $string); } - protected function renderComponent(FeaturedImage|array $data = ['image.source'=>'foo']): string + protected function renderComponent(FeaturedImage|array $data = ['image.source' => 'foo']): string { $image = $data instanceof FeaturedImage ? $data : $this->make($data); diff --git a/packages/publications/src/Views/Components/RelatedPublicationsComponent.php b/packages/publications/src/Views/Components/RelatedPublicationsComponent.php index 72fd8958fc1..8ec58140f38 100644 --- a/packages/publications/src/Views/Components/RelatedPublicationsComponent.php +++ b/packages/publications/src/Views/Components/RelatedPublicationsComponent.php @@ -105,9 +105,9 @@ protected function getAllRelatedPages(Collection $publicationPages, Collection $ if ($matchedTagCount) { $allRelatedPages->add( collect([ - 'count' => $matchedTagCount, + 'count' => $matchedTagCount, 'identifier' => $publicationPage->identifier, - 'page' => $publicationPage, + 'page' => $publicationPage, ]) ); } diff --git a/packages/publications/tests/Feature/CreatesNewPublicationPageTest.php b/packages/publications/tests/Feature/CreatesNewPublicationPageTest.php index fed0a5752a6..d0642669a7a 100644 --- a/packages/publications/tests/Feature/CreatesNewPublicationPageTest.php +++ b/packages/publications/tests/Feature/CreatesNewPublicationPageTest.php @@ -203,7 +203,7 @@ public function testItCreatesValidYaml() '__createdAt' => 1640995200, 'title' => 'Hello World', 'description' => "This is a description.\nIt can be multiple lines.\n", - 'tags' => ['tag1', 'tag2', 'foo bar'], + 'tags' => ['tag1', 'tag2', 'foo bar'], ], Yaml::parse(Str::between($contents, '---', '---'))); } diff --git a/packages/publications/tests/Feature/MakePublicationCommandTest.php b/packages/publications/tests/Feature/MakePublicationCommandTest.php index 347a77526dd..3c0ecbb7c5a 100644 --- a/packages/publications/tests/Feature/MakePublicationCommandTest.php +++ b/packages/publications/tests/Feature/MakePublicationCommandTest.php @@ -66,20 +66,20 @@ public function test_command_selects_the_right_publication_using_the_names() { $this->makeSchemaFile([ 'canonicalField' => '__createdAt', - 'fields' => [], + 'fields' => [], ]); $this->directory('second-publication'); file_put_contents( Hyde::path('second-publication/schema.json'), json_encode([ - 'name' => 'Second Publication', + 'name' => 'Second Publication', 'canonicalField' => '__createdAt', 'detailTemplate' => 'detail', - 'listTemplate' => 'list', - 'pageSize' => 10, - 'sortField' => '__createdAt', - 'sortAscending' => true, - 'fields' => [], + 'listTemplate' => 'list', + 'pageSize' => 10, + 'sortField' => '__createdAt', + 'sortAscending' => true, + 'fields' => [], ]) ); @@ -222,7 +222,7 @@ public function test_command_with_text_input() InputStreamHandler::mockInput("Hello\nWorld\n<<<"); $this->makeSchemaFile([ 'canonicalField' => '__createdAt', - 'fields' => [[ + 'fields' => [[ 'type' => 'text', 'name' => 'description', ], @@ -243,7 +243,7 @@ public function test_command_with_boolean_input() { $this->makeSchemaFile([ 'canonicalField' => '__createdAt', - 'fields' => [[ + 'fields' => [[ 'type' => 'boolean', 'name' => 'published', ], @@ -262,7 +262,7 @@ public function test_command_with_array_input() InputStreamHandler::mockInput("First Tag\nSecond Tag\nThird Tag\n<<<"); $this->makeSchemaFile([ 'canonicalField' => '__createdAt', - 'fields' => [[ + 'fields' => [[ 'type' => 'array', 'name' => 'tags', ], @@ -287,7 +287,7 @@ public function test_command_with_media_input() $this->file('_media/test-publication/image.jpg'); $this->makeSchemaFile([ 'canonicalField' => '__createdAt', - 'fields' => [[ + 'fields' => [[ 'type' => 'media', 'name' => 'media', ], @@ -311,7 +311,7 @@ public function test_media_input_selects_the_right_file() $this->makeSchemaFile([ 'canonicalField' => '__createdAt', - 'fields' => [[ + 'fields' => [[ 'type' => 'media', 'name' => 'media', ], @@ -333,7 +333,7 @@ public function test_command_with_single_tag_input() ]); $this->makeSchemaFile([ 'canonicalField' => '__createdAt', - 'fields' => [[ + 'fields' => [[ 'type' => 'tag', 'name' => 'tag', ], @@ -357,7 +357,7 @@ public function test_command_with_multiple_tag_inputs() ]); $this->makeSchemaFile([ 'canonicalField' => '__createdAt', - 'fields' => [[ + 'fields' => [[ 'type' => 'tag', 'name' => 'tags', ], @@ -380,7 +380,7 @@ public function test_media_input_with_no_images() $this->throwOnConsoleException(false); $this->makeSchemaFile([ 'canonicalField' => '__createdAt', - 'fields' => [[ + 'fields' => [[ 'type' => 'media', 'name' => 'media', ], @@ -400,7 +400,7 @@ public function test_media_input_with_no_files_but_skips() { $this->makeSchemaFile([ 'canonicalField' => '__createdAt', - 'fields' => [[ + 'fields' => [[ 'type' => 'media', 'name' => 'media', ], @@ -431,7 +431,7 @@ public function test_tag_input_with_no_tags() $this->throwOnConsoleException(false); $this->makeSchemaFile([ 'canonicalField' => '__createdAt', - 'fields' => [[ + 'fields' => [[ 'type' => 'tag', 'name' => 'tag', ], @@ -450,7 +450,7 @@ public function test_handleEmptyOptionsCollection_for_required_field() $this->throwOnConsoleException(false); $this->makeSchemaFile([ 'canonicalField' => '__createdAt', - 'fields' => [[ + 'fields' => [[ 'type' => 'media', 'name' => 'media', 'rules' => ['required'], @@ -468,7 +468,7 @@ public function test_with_custom_validation_rules() { $this->makeSchemaFile([ 'canonicalField' => '__createdAt', - 'fields' => [[ + 'fields' => [[ 'type' => 'integer', 'name' => 'integer', 'rules' => ['max:10'], @@ -492,7 +492,7 @@ public function test_with_skipping_inputs() { $this->makeSchemaFile([ 'canonicalField' => '__createdAt', - 'fields' => [[ + 'fields' => [[ 'type' => 'string', 'name' => 'string', ], @@ -522,14 +522,14 @@ protected function makeSchemaFile(array $merge = []): void file_put_contents( Hyde::path('test-publication/schema.json'), json_encode(array_merge([ - 'name' => 'Test Publication', + 'name' => 'Test Publication', 'canonicalField' => 'title', 'detailTemplate' => 'detail', - 'listTemplate' => 'list', - 'pageSize' => 10, - 'sortField' => '__createdAt', - 'sortAscending' => true, - 'fields' => [ + 'listTemplate' => 'list', + 'pageSize' => 10, + 'sortField' => '__createdAt', + 'sortAscending' => true, + 'fields' => [ [ 'name' => 'title', 'type' => 'string', diff --git a/packages/publications/tests/Feature/PublicationListPageTest.php b/packages/publications/tests/Feature/PublicationListPageTest.php index 03265e03833..5d4d50acc06 100644 --- a/packages/publications/tests/Feature/PublicationListPageTest.php +++ b/packages/publications/tests/Feature/PublicationListPageTest.php @@ -90,14 +90,14 @@ protected function getPublicationType(): PublicationType protected function getTestData(): array { return [ - 'name' => 'test', + 'name' => 'test', 'canonicalField' => 'canonical', 'detailTemplate' => 'detail.blade.php', - 'listTemplate' => 'list.blade.php', - 'sortField' => 'sort', - 'sortAscending' => true, - 'pageSize' => 10, - 'fields' => [ + 'listTemplate' => 'list.blade.php', + 'sortField' => 'sort', + 'sortAscending' => true, + 'pageSize' => 10, + 'fields' => [ [ 'type' => 'string', 'name' => 'Foo', diff --git a/packages/publications/tests/Feature/PublicationTypeTest.php b/packages/publications/tests/Feature/PublicationTypeTest.php index 3f63efeb32e..16bfd064e57 100644 --- a/packages/publications/tests/Feature/PublicationTypeTest.php +++ b/packages/publications/tests/Feature/PublicationTypeTest.php @@ -61,9 +61,9 @@ public function test_construct_with_default_values() public function test_construct_with_pagination_settings() { $paginationSettings = [ - 'sortField' => 'title', + 'sortField' => 'title', 'sortAscending' => false, - 'pageSize' => 10, + 'pageSize' => 10, ]; $publicationType = new PublicationType('Test Publication', ...$paginationSettings); diff --git a/packages/realtime-compiler/src/Http/ExceptionHandler.php b/packages/realtime-compiler/src/Http/ExceptionHandler.php index 752b9a99654..8d7b9f510d9 100644 --- a/packages/realtime-compiler/src/Http/ExceptionHandler.php +++ b/packages/realtime-compiler/src/Http/ExceptionHandler.php @@ -22,9 +22,9 @@ public static function handle(Throwable $exception): Response $html = $whoops->handleException($exception); return Response::make(500, 'Internal Server Error', [ - 'Content-Type' => 'text/html', + 'Content-Type' => 'text/html', 'Content-Length' => strlen($html), - 'body' => $html, + 'body' => $html, ]); } } diff --git a/packages/realtime-compiler/src/Http/HtmlResponse.php b/packages/realtime-compiler/src/Http/HtmlResponse.php index 9b19e497bf6..2b8a560c29e 100644 --- a/packages/realtime-compiler/src/Http/HtmlResponse.php +++ b/packages/realtime-compiler/src/Http/HtmlResponse.php @@ -9,7 +9,7 @@ class HtmlResponse extends Response public function send(): void { $this->withHeaders([ - 'Content-Type' => 'text/html', + 'Content-Type' => 'text/html', 'Content-Length' => strlen($this->responseData['body']), ]); diff --git a/packages/realtime-compiler/src/Models/FileObject.php b/packages/realtime-compiler/src/Models/FileObject.php index f6c015e09f1..4e66828283a 100644 --- a/packages/realtime-compiler/src/Models/FileObject.php +++ b/packages/realtime-compiler/src/Models/FileObject.php @@ -27,17 +27,17 @@ public function getMimeType(): string // See if we can find a mime type for the extension, // instead of having to rely on a PHP extension. $lookup = [ - 'txt' => 'text/plain', - 'md' => 'text/markdown', + 'txt' => 'text/plain', + 'md' => 'text/markdown', 'html' => 'text/html', - 'css' => 'text/css', - 'svg' => 'image/svg+xml', - 'png' => 'image/png', - 'jpg' => 'image/jpeg', + 'css' => 'text/css', + 'svg' => 'image/svg+xml', + 'png' => 'image/png', + 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', - 'gif' => 'image/gif', + 'gif' => 'image/gif', 'json' => 'application/json', - 'js' => 'application/javascript', + 'js' => 'application/javascript', ]; if (isset($lookup[$extension])) { diff --git a/packages/realtime-compiler/src/Routing/Router.php b/packages/realtime-compiler/src/Routing/Router.php index 9b3ca859784..636e4a991ad 100644 --- a/packages/realtime-compiler/src/Routing/Router.php +++ b/packages/realtime-compiler/src/Routing/Router.php @@ -89,7 +89,7 @@ protected function proxyStatic(): Response return (new Response(200, 'OK', [ 'body' => $file->getStream(), ]))->withHeaders([ - 'Content-Type' => $file->getMimeType(), + 'Content-Type' => $file->getMimeType(), 'Content-Length' => $file->getContentLength(), ]); }