Skip to content

Commit

Permalink
Merge pull request #102 from musimana/11.x
Browse files Browse the repository at this point in the history
v11.8.1
  • Loading branch information
musimana authored Jun 7, 2024
2 parents 4c78034 + c141364 commit 7b3bef0
Show file tree
Hide file tree
Showing 41 changed files with 385 additions and 195 deletions.
2 changes: 1 addition & 1 deletion app/Enums/Blocks/BlockType.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function staticData(): array
/**
* Get an array of the block type's schema.
*
* @return array{label: string, inputs: array<int, bool|int|string>}
* @return array{label: string, inputs: array<int, array<string, bool|int|string>>}
*/
public function schema(): array
{
Expand Down
4 changes: 2 additions & 2 deletions app/Enums/Regex.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ enum Regex: string
{
case TIMESTAMP_COOKIE = '/\w{3}, \d{2} \w{3} \d{4} \d{2}:\d{2}:\d{2} \w{3}/';

/** Get the template's filepath. */
/** Get the RegEx pattern string for the app's XSRF cookie. */
public static function cookieXsrf(): string
{
return '/XSRF-TOKEN\=.+;\sexpires\='
. self::valueWithoutRegexDelimiters(self::TIMESTAMP_COOKIE)
. ';\sMax-Age\=7[0-29]{3};\spath\=\/;\ssamesite=lax/';
}

/** Get the template's filepath. */
/** Get the RegEx pattern string for the app's session cookie. */
public static function cookieSession(): string
{
$session_cookie_name = Str::slug(config('app.name'), '_') . '_session';
Expand Down
7 changes: 6 additions & 1 deletion app/Http/Resources/Views/Admin/Blocks/AdminBlockResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ public function __construct(
/**
* Get the content array for the resource's block.
*
* @return array{id: int|false, type: string, data: array<string, array<int, string>|string>, schema: array{label: string, inputs: array<int, bool|int|string>}}
* @return array{
* id: int|false,
* type: string,
* data: array<string, array<int, string>|string>,
* schema: array{label: string, inputs: array<int, array<string, bool|int|string>>}
* }
*/
public function getItem(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ final class AdminBlocksResource implements CollectionIndexInterface
/**
* Get the content blocks array for the given block collections.
*
* @return array<int, array<string, array<string, string>|int|string|false>>
* @return array<int, array{
* id: int|false,
* type: string,
* data: array<string, array<int, string>|string>,
* schema: array{label: string, inputs: array<int, bool|int|string>}
* }>
*/
public function getItems(Collection $collection): array
{
Expand Down
16 changes: 15 additions & 1 deletion app/Http/Resources/Views/Admin/Pages/CreateEditPageResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,21 @@ final class CreateEditPageResource implements PageItemInterface
/**
* Get the content array for the given page's full public resource.
*
* @return array<string, array<int, array<int|string, mixed>>|bool|int|string>
* @return array{
* id: int|false,
* blocks: array<int, array{
* id: int|false,
* type: string,
* data: array<string, array<int, string>|string>,
* schema: array{label:string, inputs:array<int, bool|int|string>}
* }>,
* content: string,
* subtitle: string,
* title: string,
* metaTitle: string,
* metaDescription: string,
* inSitemap: bool,
* }
*/
public function getItem(Page $page): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class DashboardContentResource implements ConstantItemInterface
/**
* Get the content array for the site's homepage.
*
* @return array<string, array<int, array<string, string>>|string>
* @return array{items: array<int, array{content: string, title: string, url: string}>}
*/
public function getItem(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ final class DashboardMetadataResource implements ConstantItemInterface
/**
* Get the metadata array for the dashboard page.
*
* @return array<string, string>
* @return array{
* canonical: string,
* description: string,
* keywords: string,
* title: string,
* }
*/
public function getItem(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ final class EmailVerifyMetadataResource implements ConstantItemInterface
/**
* Get the metadata array for the email verification page.
*
* @return array<string, bool|string>
* @return array{
* canonical: string,
* description: string,
* keywords: string,
* title: string,
* status: bool,
* }
*/
public function getItem(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ final class LoginMetadataResource implements ConstantItemInterface
/**
* Get the metadata array for the login page.
*
* @return array<string, bool|string>
* @return array{
* canonical: string,
* canResetPassword: bool,
* description: string,
* keywords: string,
* title: string,
* status: bool,
* }
*/
public function getItem(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ final class PasswordConfirmMetadataResource implements ConstantItemInterface
/**
* Get the metadata array for the password confirmation page.
*
* @return array<string, string>
* @return array{
* canonical: string,
* description: string,
* keywords: string,
* title: string,
* }
*/
public function getItem(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ final class PasswordForgotMetadataResource implements ConstantItemInterface
/**
* Get the metadata array for the password reset token request page.
*
* @return array<string, bool|string>
* @return array{
* canonical: string,
* description: string,
* keywords: string,
* title: string,
* status: bool,
* }
*/
public function getItem(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ final class PasswordResetMetadataResource implements ConstantItemInterface
/**
* Get the metadata array for the password reset page.
*
* @return array<string, string>
* @return array{
* canonical: string,
* description: string,
* email: string,
* keywords: string,
* title: string,
* token: object|string|null,
* }
*/
public function getItem(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ final class ProfileCreateMetadataResource implements ConstantItemInterface
/**
* Get the metadata array for the user registration page.
*
* @return array<string, string>
* @return array{
* canonical: string,
* description: string,
* keywords: string,
* title: string,
* }
*/
public function getItem(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ final class ProfileEditMetadataResource implements ConstantItemInterface
/**
* Get the metadata array for the edit profile page.
*
* @return array<string, bool|string>
* @return array{
* canonical: string,
* description: string,
* keywords: string,
* mustVerifyEmail: bool,
* title: string,
* status: bool,
* }
*/
public function getItem(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ final class SessionMetadataResource implements ConstantItemInterface
/**
* Get the metadata array for the session's status.
*
* @return array<string, bool>
* @return array{status: bool}
*/
public function getItem(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ final class CreateEditSummaryResource implements PageItemInterface
/**
* Get the resource as an array.
*
* @return array<string, string>
* @return array{content: string, title: string, url: string}
*/
public function getItem(Page $page): array
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Resources/Views/Public/Blocks/BlocksResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class BlocksResource implements CollectionIndexInterface
/**
* Get the content blocks array for the given block collections.
*
* @return array<int, array<string, array<string, string>|int|string|false>>
* @return array<int, array{type: string, data: array<string, array<int, string>|string>}>
*/
public function getItems(Collection $collection): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ final class HomepageContentResource implements ConstantItemInterface
/**
* Get the content array for the site's homepage.
*
* @return array<string, array<int, array<string, string>>|string>
* @return array{
* blocks: array<int, array{
* type: string,
* data: array<string, array<int, string>|string>,
* }>,
* bodytext: string,
* heading: string,
* items: array<int, array{content: string, title: string, url: string}>,
* subheading: string,
* }
*/
public function getItem(): array
{
Expand Down
10 changes: 9 additions & 1 deletion app/Http/Resources/Views/Public/Content/PageContentResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@ final class PageContentResource implements PageItemInterface
/**
* Get the content array for the given page's full public resource.
*
* @return array<string, array<int, array<int|string, mixed>>|string>>|string>
* @return array{
* blocks: array<int, array{
* type: string,
* data: array<string, array<int, string>|string>,
* }>,
* bodytext: string,
* heading: string,
* subheading: string,
* }
*/
public function getItem(Page $page): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ final class HomepageMetadataResource implements ConstantItemInterface
/**
* Get the metadata array for the site homepage.
*
* @return array<string, string>
* @return array{openGraphImage: string}
*/
public function getItem(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ final class PageMetadataResource implements PageItemInterface
/**
* Get the public view metadata array for the given page.
*
* @return array<string, string>
* @return array{canonical: string, description: string, title: string}
*/
public function getItem(Page $page): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ final class PageSummaryResource implements PageItemInterface
/**
* Get the resource as an array.
*
* @return array<string, string>
* @return array{content: string, title: string, url: string}
*/
public function getItem(Page $page): array
{
Expand Down
7 changes: 6 additions & 1 deletion app/Http/Resources/Views/Sitemaps/PageSitemapResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ final class PageSitemapResource implements PageItemInterface
/**
* Get the content array for the given page's sitemap item.
*
* @return array<string, float|string>
* @return array{
* loc: string,
* lastmod: string,
* changefreq: string,
* priority: float
* }
*/
public function getItem(Page $page): array
{
Expand Down
7 changes: 6 additions & 1 deletion app/Http/Resources/Views/Sitemaps/PagesSitemapResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ final class PagesSitemapResource implements ConstantIndexInterface
/**
* Get the content array for the pages sitemap index resource.
*
* @return array<int, array<string, int|string>>
* @return array<int, array{
* loc: string,
* lastmod: string,
* changefreq: string,
* priority: float
* }>
*/
public function getItems(): array
{
Expand Down
7 changes: 6 additions & 1 deletion app/Repositories/Views/SitemapViewRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ final class SitemapViewRepository
/**
* Render the given template after injecting the given items array.
*
* @param array<int, array<string, int|string>|string> $items = []
* @param array<int, array{
* loc: string,
* lastmod: string,
* changefreq: string,
* priority: float
* }|string> $items = []
*/
public function getView(string $template, array $items = []): View
{
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"php": "8.2.*||8.3.*",
"guzzlehttp/guzzle": "^7.8.1",
"inertiajs/inertia-laravel": "^1.2",
"laravel/framework": "^11.9",
"laravel/framework": "^11.10",
"laravel/tinker": "^2.9.0",
"tightenco/ziggy": "^1.8.2"
},
Expand Down
Loading

0 comments on commit 7b3bef0

Please sign in to comment.