From 0737108d414f89c0f1c34dd93c535210d19d34b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 00:53:08 +0000 Subject: [PATCH 1/2] Bump actions/attest-build-provenance from 2 to 4 Bumps [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) from 2 to 4. - [Release notes](https://github.com/actions/attest-build-provenance/releases) - [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md) - [Commits](https://github.com/actions/attest-build-provenance/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/attest-build-provenance dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/attest-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/attest-release.yml b/.github/workflows/attest-release.yml index 402167d8..06ec4bb1 100644 --- a/.github/workflows/attest-release.yml +++ b/.github/workflows/attest-release.yml @@ -21,7 +21,7 @@ jobs: zip -r ${{ github.event.repository.name }}.zip . -x ".git/*" ".github/*" - name: Attest Build Provenance - uses: actions/attest-build-provenance@v2 + uses: actions/attest-build-provenance@v4 with: subject-path: ${{ github.event.repository.name }}.zip From 550826377e84876ed5c74bca851f26be8cba4c09 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 00:53:35 +0000 Subject: [PATCH 2/2] Dusting --- app/Actions/SaveGdprConsentsAction.php | 4 +- app/Actions/UpdateGdprConsentsAction.php | 4 +- .../Validation/ValidateUserDataAction.php | 7 +- app/Datas/GdprData.php | 420 +++++++++--------- app/Filament/Widgets/Auth/GdprConsentForm.php | 2 +- app/Filament/Widgets/Auth/RegisterWidget.php | 2 +- app/Models/Consent.php | 68 +-- app/Models/Event.php | 196 ++++---- app/Models/Profile.php | 182 ++++---- app/Models/Traits/HasGdpr.php | 4 +- app/Models/Treatment.php | 198 ++++----- app/Providers/EventServiceProvider.php | 4 +- app/Providers/GdprServiceProvider.php | 3 +- ...024_01_01_000001_create_consents_table.php | 6 +- ..._01_01_000001_create_gdpr_events_table.php | 6 +- ...4_01_01_000001_create_treatments_table.php | 6 +- ...024_01_01_000002_create_consents_table.php | 6 +- ...4_01_01_000002_create_treatments_table.php | 6 +- ...024_01_01_000005_create_consents_table.php | 6 +- ...024_01_01_000001_create_consents_table.php | 6 +- ...024_01_01_000002_create_consents_table.php | 6 +- .../views/components/consent-label.blade.php | 8 +- tests/Feature/ConflictResolutionTest.php | 8 +- .../Feature/RegisterPageComprehensiveTest.php | 4 +- tests/PestHelpers.php | 24 +- tests/TestCase.php | 8 +- .../Actions/CollectGdprConsentsActionTest.php | 6 +- .../HandleRegistrationErrorActionTest.php | 4 +- ...HandleSuccessfulRegistrationActionTest.php | 4 +- .../Actions/SaveGdprConsentsActionTest.php | 4 +- .../Actions/ValidateGdprConsentActionTest.php | 8 +- .../Actions/ValidateUserDataActionTest.php | 4 +- .../Resources/ConsentResourceTest.php | 4 +- .../Filament/Resources/EventResourceTest.php | 4 +- .../Resources/ProfileResourceTest.php | 4 +- .../Resources/TreatmentResourceTest.php | 4 +- tests/Unit/Models/BaseModelTest.php | 3 +- tests/Unit/Models/ConsentModelTest.php | 8 +- tests/Unit/Models/EventModelTest.php | 14 +- .../Models/GdprConsentBusinessLogicTest.php | 2 +- tests/Unit/Models/GdprConsentTest.php | 6 +- tests/Unit/Models/ProfileModelTest.php | 8 +- tests/Unit/Models/TreatmentModelTest.php | 8 +- 43 files changed, 634 insertions(+), 655 deletions(-) diff --git a/app/Actions/SaveGdprConsentsAction.php b/app/Actions/SaveGdprConsentsAction.php index 8ca12ab4..40f8ac70 100644 --- a/app/Actions/SaveGdprConsentsAction.php +++ b/app/Actions/SaveGdprConsentsAction.php @@ -17,8 +17,8 @@ class SaveGdprConsentsAction /** * Save all GDPR consents for a user. * - * @param array $consents Associative array of consent properties (privacy_accepted, terms_accepted, etc.) - * @param array $consents Associative array of consent properties (privacy_accepted, terms_accepted, etc.) + * @param array $consents Associative array of consent properties (privacy_accepted, terms_accepted, etc.) + * @param array $consents Associative array of consent properties (privacy_accepted, terms_accepted, etc.) */ public function execute(User $user, array $consents, ?string $ipAddress = null, ?string $userAgent = null): void { diff --git a/app/Actions/UpdateGdprConsentsAction.php b/app/Actions/UpdateGdprConsentsAction.php index 1df6fe7b..6547c125 100644 --- a/app/Actions/UpdateGdprConsentsAction.php +++ b/app/Actions/UpdateGdprConsentsAction.php @@ -18,8 +18,8 @@ class UpdateGdprConsentsAction use QueueableAction; /** - * @param array $consents - * @param array $consents + * @param array $consents + * @param array $consents */ public function execute(User $user, array $consents, ?string $ipAddress = null, ?string $userAgent = null): void { diff --git a/app/Actions/Validation/ValidateUserDataAction.php b/app/Actions/Validation/ValidateUserDataAction.php index 1258c7ed..11773373 100644 --- a/app/Actions/Validation/ValidateUserDataAction.php +++ b/app/Actions/Validation/ValidateUserDataAction.php @@ -15,10 +15,9 @@ class ValidateUserDataAction use QueueableAction; /** - * @param array $formData - * @param array $formData - * @param array $formData - * + * @param array $formData + * @param array $formData + * @param array $formData * @return array */ public function execute(array $formData): array diff --git a/app/Datas/GdprData.php b/app/Datas/GdprData.php index 5a82284a..32c392a8 100644 --- a/app/Datas/GdprData.php +++ b/app/Datas/GdprData.php @@ -12,216 +12,216 @@ /** * Class MetatagData. * - * @property string $title - * @property string $sitename - * @property string $subtitle - * @property string|null $generator - * @property string $charset - * @property string|null $author - * @property string|null $description - * @property string|null $keywords - * @property string $nome_regione - * @property string $nome_comune - * @property string $site_title - * @property string $logo - * @property string $logo_square - * @property string $logo_header - * @property string $logo_header_dark - * @property string $logo_height - * @property string $logo_footer - * @property string $logo_alt - * @property string $hide_megamenu - * @property string $hero_type - * @property string $facebook_href - * @property string $twitter_href - * @property string $youtube_href - * @property string $fastlink - * @property string $color_primary - * @property string $color_title - * @property string $color_megamenu - * @property string $color_hamburger - * @property string $color_banner - * @property string $favicon - * @property string $title - * @property string $sitename - * @property string $subtitle - * @property string|null $generator - * @property string $charset - * @property string|null $author - * @property string|null $description - * @property string|null $keywords - * @property string $nome_regione - * @property string $nome_comune - * @property string $site_title - * @property string $logo - * @property string $logo_square - * @property string $logo_header - * @property string $logo_header_dark - * @property string $logo_height - * @property string $logo_footer - * @property string $logo_alt - * @property string $hide_megamenu - * @property string $hero_type - * @property string $facebook_href - * @property string $twitter_href - * @property string $youtube_href - * @property string $fastlink - * @property string $color_primary - * @property string $color_title - * @property string $color_megamenu - * @property string $color_hamburger - * @property string $color_banner - * @property string $favicon - * @property string $title - * @property string $sitename - * @property string $subtitle - * @property string|null $generator - * @property string $charset - * @property string|null $author - * @property string|null $description - * @property string|null $keywords - * @property string $nome_regione - * @property string $nome_comune - * @property string $site_title - * @property string $logo - * @property string $logo_square - * @property string $logo_header - * @property string $logo_header_dark - * @property string $logo_height - * @property string $logo_footer - * @property string $logo_alt - * @property string $hide_megamenu - * @property string $hero_type - * @property string $facebook_href - * @property string $twitter_href - * @property string $youtube_href - * @property string $fastlink - * @property string $color_primary - * @property string $color_title - * @property string $color_megamenu - * @property string $color_hamburger - * @property string $color_banner - * @property string $favicon - * @property string $title - * @property string $sitename - * @property string $subtitle - * @property string|null $generator - * @property string $charset - * @property string|null $author - * @property string|null $description - * @property string|null $keywords - * @property string $nome_regione - * @property string $nome_comune - * @property string $site_title - * @property string $logo - * @property string $logo_square - * @property string $logo_header - * @property string $logo_header_dark - * @property string $logo_height - * @property string $logo_footer - * @property string $logo_alt - * @property string $hide_megamenu - * @property string $hero_type - * @property string $facebook_href - * @property string $twitter_href - * @property string $youtube_href - * @property string $fastlink - * @property string $color_primary - * @property string $color_title - * @property string $color_megamenu - * @property string $color_hamburger - * @property string $color_banner - * @property string $favicon - * @property string $title - * @property string $sitename - * @property string $subtitle - * @property string|null $generator - * @property string $charset - * @property string|null $author - * @property string|null $description - * @property string|null $keywords - * @property string $nome_regione - * @property string $nome_comune - * @property string $site_title - * @property string $logo - * @property string $logo_square - * @property string $logo_header - * @property string $logo_header_dark - * @property string $logo_height - * @property string $logo_footer - * @property string $logo_alt - * @property string $hide_megamenu - * @property string $hero_type - * @property string $facebook_href - * @property string $twitter_href - * @property string $youtube_href - * @property string $fastlink - * @property string $color_primary - * @property string $color_title - * @property string $color_megamenu - * @property string $color_hamburger - * @property string $color_banner - * @property string $favicon - * @property string $title - * @property string $sitename - * @property string $subtitle - * @property string|null $generator - * @property string $charset - * @property string|null $author - * @property string|null $description - * @property string|null $keywords - * @property string $nome_regione - * @property string $nome_comune - * @property string $site_title - * @property string $logo - * @property string $logo_square - * @property string $logo_header - * @property string $logo_header_dark - * @property string $logo_height - * @property string $logo_footer - * @property string $logo_alt - * @property string $hide_megamenu - * @property string $hero_type - * @property string $facebook_href - * @property string $twitter_href - * @property string $youtube_href - * @property string $fastlink - * @property string $color_primary - * @property string $color_title - * @property string $color_megamenu - * @property string $color_hamburger - * @property string $color_banner - * @property string $favicon - * @property string $title - * @property string $sitename - * @property string $subtitle - * @property string|null $generator - * @property string $charset - * @property string|null $author - * @property string|null $description - * @property string|null $keywords - * @property string $nome_regione - * @property string $nome_comune - * @property string $site_title - * @property string $logo - * @property string $logo_square - * @property string $logo_header - * @property string $logo_header_dark - * @property string $logo_height - * @property string $logo_footer - * @property string $logo_alt - * @property string $hide_megamenu - * @property string $hero_type - * @property string $facebook_href - * @property string $twitter_href - * @property string $youtube_href - * @property string $fastlink - * @property string $color_primary - * @property string $color_title - * @property string $color_megamenu - * @property string $color_hamburger - * @property string $color_banner - * @property string $favicon + * @property string $title + * @property string $sitename + * @property string $subtitle + * @property string|null $generator + * @property string $charset + * @property string|null $author + * @property string|null $description + * @property string|null $keywords + * @property string $nome_regione + * @property string $nome_comune + * @property string $site_title + * @property string $logo + * @property string $logo_square + * @property string $logo_header + * @property string $logo_header_dark + * @property string $logo_height + * @property string $logo_footer + * @property string $logo_alt + * @property string $hide_megamenu + * @property string $hero_type + * @property string $facebook_href + * @property string $twitter_href + * @property string $youtube_href + * @property string $fastlink + * @property string $color_primary + * @property string $color_title + * @property string $color_megamenu + * @property string $color_hamburger + * @property string $color_banner + * @property string $favicon + * @property string $title + * @property string $sitename + * @property string $subtitle + * @property string|null $generator + * @property string $charset + * @property string|null $author + * @property string|null $description + * @property string|null $keywords + * @property string $nome_regione + * @property string $nome_comune + * @property string $site_title + * @property string $logo + * @property string $logo_square + * @property string $logo_header + * @property string $logo_header_dark + * @property string $logo_height + * @property string $logo_footer + * @property string $logo_alt + * @property string $hide_megamenu + * @property string $hero_type + * @property string $facebook_href + * @property string $twitter_href + * @property string $youtube_href + * @property string $fastlink + * @property string $color_primary + * @property string $color_title + * @property string $color_megamenu + * @property string $color_hamburger + * @property string $color_banner + * @property string $favicon + * @property string $title + * @property string $sitename + * @property string $subtitle + * @property string|null $generator + * @property string $charset + * @property string|null $author + * @property string|null $description + * @property string|null $keywords + * @property string $nome_regione + * @property string $nome_comune + * @property string $site_title + * @property string $logo + * @property string $logo_square + * @property string $logo_header + * @property string $logo_header_dark + * @property string $logo_height + * @property string $logo_footer + * @property string $logo_alt + * @property string $hide_megamenu + * @property string $hero_type + * @property string $facebook_href + * @property string $twitter_href + * @property string $youtube_href + * @property string $fastlink + * @property string $color_primary + * @property string $color_title + * @property string $color_megamenu + * @property string $color_hamburger + * @property string $color_banner + * @property string $favicon + * @property string $title + * @property string $sitename + * @property string $subtitle + * @property string|null $generator + * @property string $charset + * @property string|null $author + * @property string|null $description + * @property string|null $keywords + * @property string $nome_regione + * @property string $nome_comune + * @property string $site_title + * @property string $logo + * @property string $logo_square + * @property string $logo_header + * @property string $logo_header_dark + * @property string $logo_height + * @property string $logo_footer + * @property string $logo_alt + * @property string $hide_megamenu + * @property string $hero_type + * @property string $facebook_href + * @property string $twitter_href + * @property string $youtube_href + * @property string $fastlink + * @property string $color_primary + * @property string $color_title + * @property string $color_megamenu + * @property string $color_hamburger + * @property string $color_banner + * @property string $favicon + * @property string $title + * @property string $sitename + * @property string $subtitle + * @property string|null $generator + * @property string $charset + * @property string|null $author + * @property string|null $description + * @property string|null $keywords + * @property string $nome_regione + * @property string $nome_comune + * @property string $site_title + * @property string $logo + * @property string $logo_square + * @property string $logo_header + * @property string $logo_header_dark + * @property string $logo_height + * @property string $logo_footer + * @property string $logo_alt + * @property string $hide_megamenu + * @property string $hero_type + * @property string $facebook_href + * @property string $twitter_href + * @property string $youtube_href + * @property string $fastlink + * @property string $color_primary + * @property string $color_title + * @property string $color_megamenu + * @property string $color_hamburger + * @property string $color_banner + * @property string $favicon + * @property string $title + * @property string $sitename + * @property string $subtitle + * @property string|null $generator + * @property string $charset + * @property string|null $author + * @property string|null $description + * @property string|null $keywords + * @property string $nome_regione + * @property string $nome_comune + * @property string $site_title + * @property string $logo + * @property string $logo_square + * @property string $logo_header + * @property string $logo_header_dark + * @property string $logo_height + * @property string $logo_footer + * @property string $logo_alt + * @property string $hide_megamenu + * @property string $hero_type + * @property string $facebook_href + * @property string $twitter_href + * @property string $youtube_href + * @property string $fastlink + * @property string $color_primary + * @property string $color_title + * @property string $color_megamenu + * @property string $color_hamburger + * @property string $color_banner + * @property string $favicon + * @property string $title + * @property string $sitename + * @property string $subtitle + * @property string|null $generator + * @property string $charset + * @property string|null $author + * @property string|null $description + * @property string|null $keywords + * @property string $nome_regione + * @property string $nome_comune + * @property string $site_title + * @property string $logo + * @property string $logo_square + * @property string $logo_header + * @property string $logo_header_dark + * @property string $logo_height + * @property string $logo_footer + * @property string $logo_alt + * @property string $hide_megamenu + * @property string $hero_type + * @property string $facebook_href + * @property string $twitter_href + * @property string $youtube_href + * @property string $fastlink + * @property string $color_primary + * @property string $color_title + * @property string $color_megamenu + * @property string $color_hamburger + * @property string $color_banner + * @property string $favicon * @property array $colors * * @method string getBrandLogoBase64() Get the brand logo as base64 data URI for inline embedding diff --git a/app/Filament/Widgets/Auth/GdprConsentForm.php b/app/Filament/Widgets/Auth/GdprConsentForm.php index 503d2b78..68eff469 100644 --- a/app/Filament/Widgets/Auth/GdprConsentForm.php +++ b/app/Filament/Widgets/Auth/GdprConsentForm.php @@ -106,7 +106,7 @@ protected function getView(): string } /** - * @param array $formData + * @param array $formData */ protected function logRegistrationAttempt(array $formData): void { diff --git a/app/Filament/Widgets/Auth/RegisterWidget.php b/app/Filament/Widgets/Auth/RegisterWidget.php index 514304a1..58039f48 100644 --- a/app/Filament/Widgets/Auth/RegisterWidget.php +++ b/app/Filament/Widgets/Auth/RegisterWidget.php @@ -106,7 +106,7 @@ public function submit(): void } /** - * @param array $formData + * @param array $formData */ protected function logRegistrationAttempt(array $formData): void { diff --git a/app/Models/Consent.php b/app/Models/Consent.php index eb230a09..8b4a7695 100644 --- a/app/Models/Consent.php +++ b/app/Models/Consent.php @@ -14,36 +14,36 @@ /** * Modules\Gdpr\Models\Consent. * - * @property string $id - * @property string|null $treatment_id - * @property string|null $subject_id - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $updated_by - * @property string|null $created_by - * @property Carbon|null $deleted_at - * @property string|null $deleted_by - * @property string $user_type - * @property string|null $user_id - * @property string|null $type - * @property string|null $accepted_at + * @property string $id + * @property string|null $treatment_id + * @property string|null $subject_id + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $updated_by + * @property string|null $created_by + * @property Carbon|null $deleted_at + * @property string|null $deleted_by + * @property string $user_type + * @property string|null $user_id + * @property string|null $type + * @property string|null $accepted_at * @property ProfileContract|null $creator - * @property Treatment|null $treatment - * @property string $id - * @property string|null $treatment_id - * @property string|null $subject_id - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $updated_by - * @property string|null $created_by - * @property Carbon|null $deleted_at - * @property string|null $deleted_by - * @property string $user_type - * @property string|null $user_id - * @property string|null $type - * @property string|null $accepted_at + * @property Treatment|null $treatment + * @property string $id + * @property string|null $treatment_id + * @property string|null $subject_id + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $updated_by + * @property string|null $created_by + * @property Carbon|null $deleted_at + * @property string|null $deleted_by + * @property string $user_type + * @property string|null $user_id + * @property string|null $type + * @property string|null $accepted_at * @property ProfileContract|null $creator - * @property Treatment|null $treatment + * @property Treatment|null $treatment * @property ProfileContract|null $updater * * @method static Builder|Consent newModelQuery() @@ -64,19 +64,19 @@ * @method static Builder|Consent whereUserType($value) * * @property ProfileContract|null $deleter - * @property string|null $ip_address - * @property string|null $user_agent + * @property string|null $ip_address + * @property string|null $user_agent * * @method static \Modules\Gdpr\Database\Factories\ConsentFactory factory($count = null, $state = []) - * @method static Builder|Consent whereIpAddress($value) - * @method static Builder|Consent whereUserAgent($value) + * @method static Builder|Consent whereIpAddress($value) + * @method static Builder|Consent whereUserAgent($value) * * @property string|null $ip_address * @property string|null $user_agent * * @method static \Modules\Gdpr\Database\Factories\ConsentFactory factory($count = null, $state = []) - * @method static Builder|Consent whereIpAddress($value) - * @method static Builder|Consent whereUserAgent($value) + * @method static Builder|Consent whereIpAddress($value) + * @method static Builder|Consent whereUserAgent($value) * * @mixin \Eloquent */ diff --git a/app/Models/Event.php b/app/Models/Event.php index 7dc81bbb..cade3aa7 100644 --- a/app/Models/Event.php +++ b/app/Models/Event.php @@ -20,104 +20,104 @@ /** * Modules\Gdpr\Models\Event. * - * @property string $id - * @property string|null $treatment_id - * @property string|null $consent_id - * @property string $subject_id - * @property string $ip - * @property string $action - * @property string $payload - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $updated_by - * @property string|null $created_by - * @property Carbon|null $deleted_at - * @property string|null $deleted_by - * @property Consent|null $consent - * @property string $id - * @property string|null $treatment_id - * @property string|null $consent_id - * @property string $subject_id - * @property string $ip - * @property string $action - * @property string $payload - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $updated_by - * @property string|null $created_by - * @property Carbon|null $deleted_at - * @property string|null $deleted_by - * @property Consent|null $consent - * @property string $id - * @property string|null $treatment_id - * @property string|null $consent_id - * @property string $subject_id - * @property string $ip - * @property string $action - * @property string $payload - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $updated_by - * @property string|null $created_by - * @property Carbon|null $deleted_at - * @property string|null $deleted_by - * @property Consent|null $consent - * @property string $id - * @property string|null $treatment_id - * @property string|null $consent_id - * @property string $subject_id - * @property string $ip - * @property string $action - * @property string $payload - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $updated_by - * @property string|null $created_by - * @property Carbon|null $deleted_at - * @property string|null $deleted_by - * @property Consent|null $consent - * @property string $id - * @property string|null $treatment_id - * @property string|null $consent_id - * @property string $subject_id - * @property string $ip - * @property string $action - * @property string $payload - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $updated_by - * @property string|null $created_by - * @property Carbon|null $deleted_at - * @property string|null $deleted_by - * @property Consent|null $consent - * @property string $id - * @property string|null $treatment_id - * @property string|null $consent_id - * @property string $subject_id - * @property string $ip - * @property string $action - * @property string $payload - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $updated_by - * @property string|null $created_by - * @property Carbon|null $deleted_at - * @property string|null $deleted_by - * @property Consent|null $consent - * @property string $id - * @property string|null $treatment_id - * @property string|null $consent_id - * @property string $subject_id - * @property string $ip - * @property string $action - * @property string $payload - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $updated_by - * @property string|null $created_by - * @property Carbon|null $deleted_at - * @property string|null $deleted_by - * @property Consent|null $consent + * @property string $id + * @property string|null $treatment_id + * @property string|null $consent_id + * @property string $subject_id + * @property string $ip + * @property string $action + * @property string $payload + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $updated_by + * @property string|null $created_by + * @property Carbon|null $deleted_at + * @property string|null $deleted_by + * @property Consent|null $consent + * @property string $id + * @property string|null $treatment_id + * @property string|null $consent_id + * @property string $subject_id + * @property string $ip + * @property string $action + * @property string $payload + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $updated_by + * @property string|null $created_by + * @property Carbon|null $deleted_at + * @property string|null $deleted_by + * @property Consent|null $consent + * @property string $id + * @property string|null $treatment_id + * @property string|null $consent_id + * @property string $subject_id + * @property string $ip + * @property string $action + * @property string $payload + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $updated_by + * @property string|null $created_by + * @property Carbon|null $deleted_at + * @property string|null $deleted_by + * @property Consent|null $consent + * @property string $id + * @property string|null $treatment_id + * @property string|null $consent_id + * @property string $subject_id + * @property string $ip + * @property string $action + * @property string $payload + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $updated_by + * @property string|null $created_by + * @property Carbon|null $deleted_at + * @property string|null $deleted_by + * @property Consent|null $consent + * @property string $id + * @property string|null $treatment_id + * @property string|null $consent_id + * @property string $subject_id + * @property string $ip + * @property string $action + * @property string $payload + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $updated_by + * @property string|null $created_by + * @property Carbon|null $deleted_at + * @property string|null $deleted_by + * @property Consent|null $consent + * @property string $id + * @property string|null $treatment_id + * @property string|null $consent_id + * @property string $subject_id + * @property string $ip + * @property string $action + * @property string $payload + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $updated_by + * @property string|null $created_by + * @property Carbon|null $deleted_at + * @property string|null $deleted_by + * @property Consent|null $consent + * @property string $id + * @property string|null $treatment_id + * @property string|null $consent_id + * @property string $subject_id + * @property string $ip + * @property string $action + * @property string $payload + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $updated_by + * @property string|null $created_by + * @property Carbon|null $deleted_at + * @property string|null $deleted_by + * @property Consent|null $consent * @property ProfileContract|null $creator * @property ProfileContract|null $updater * diff --git a/app/Models/Profile.php b/app/Models/Profile.php index cb3abb3f..c5d7231b 100644 --- a/app/Models/Profile.php +++ b/app/Models/Profile.php @@ -24,90 +24,90 @@ /** * Modules\Gdpr\Models\Profile. * - * @property string $id - * @property string|null $post_type - * @property string|null $bio - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $created_by - * @property string|null $updated_by - * @property string|null $deleted_by - * @property string|null $first_name - * @property string|null $surname - * @property string|null $email - * @property string|null $phone - * @property string|null $address - * @property string|null $user_id - * @property string|null $last_name - * @property string|null $tax_code - * @property string|null $vat_number - * @property Carbon|null $deleted_at - * @property SchemalessAttributes $extra - * @property string $avatar - * @property ProfileContract|null $creator - * @property Collection $deviceUsers - * @property int|null $device_users_count - * @property DeviceProfile|null $pivot - * @property Collection $devices - * @property int|null $devices_count - * @property string|null $full_name - * @property MediaCollection $media - * @property int|null $media_count - * @property Collection $mobileDeviceUsers - * @property int|null $mobile_device_users_count - * @property Collection $mobileDevices - * @property int|null $mobile_devices_count + * @property string $id + * @property string|null $post_type + * @property string|null $bio + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $created_by + * @property string|null $updated_by + * @property string|null $deleted_by + * @property string|null $first_name + * @property string|null $surname + * @property string|null $email + * @property string|null $phone + * @property string|null $address + * @property string|null $user_id + * @property string|null $last_name + * @property string|null $tax_code + * @property string|null $vat_number + * @property Carbon|null $deleted_at + * @property SchemalessAttributes $extra + * @property string $avatar + * @property ProfileContract|null $creator + * @property Collection $deviceUsers + * @property int|null $device_users_count + * @property DeviceProfile|null $pivot + * @property Collection $devices + * @property int|null $devices_count + * @property string|null $full_name + * @property MediaCollection $media + * @property int|null $media_count + * @property Collection $mobileDeviceUsers + * @property int|null $mobile_device_users_count + * @property Collection $mobileDevices + * @property int|null $mobile_devices_count * @property DatabaseNotificationCollection $notifications - * @property string $id - * @property string|null $post_type - * @property string|null $bio - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $created_by - * @property string|null $updated_by - * @property string|null $deleted_by - * @property string|null $first_name - * @property string|null $surname - * @property string|null $email - * @property string|null $phone - * @property string|null $address - * @property string|null $user_id - * @property string|null $last_name - * @property string|null $tax_code - * @property string|null $vat_number - * @property Carbon|null $deleted_at - * @property SchemalessAttributes $extra - * @property string $avatar - * @property ProfileContract|null $creator - * @property Collection $deviceUsers - * @property int|null $device_users_count - * @property DeviceProfile|null $pivot - * @property Collection $devices - * @property int|null $devices_count - * @property string|null $full_name - * @property MediaCollection $media - * @property int|null $media_count - * @property Collection $mobileDeviceUsers - * @property int|null $mobile_device_users_count - * @property Collection $mobileDevices - * @property int|null $mobile_devices_count + * @property string $id + * @property string|null $post_type + * @property string|null $bio + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $created_by + * @property string|null $updated_by + * @property string|null $deleted_by + * @property string|null $first_name + * @property string|null $surname + * @property string|null $email + * @property string|null $phone + * @property string|null $address + * @property string|null $user_id + * @property string|null $last_name + * @property string|null $tax_code + * @property string|null $vat_number + * @property Carbon|null $deleted_at + * @property SchemalessAttributes $extra + * @property string $avatar + * @property ProfileContract|null $creator + * @property Collection $deviceUsers + * @property int|null $device_users_count + * @property DeviceProfile|null $pivot + * @property Collection $devices + * @property int|null $devices_count + * @property string|null $full_name + * @property MediaCollection $media + * @property int|null $media_count + * @property Collection $mobileDeviceUsers + * @property int|null $mobile_device_users_count + * @property Collection $mobileDevices + * @property int|null $mobile_devices_count * @property DatabaseNotificationCollection $notifications - * @property int|null $notifications_count - * @property Collection $permissions - * @property int|null $permissions_count - * @property Collection $roles - * @property int|null $roles_count - * @property ProfileContract|null $updater - * @property User|null $user - * @property string|null $user_name - * @property int|null $notifications_count - * @property Collection $permissions - * @property int|null $permissions_count - * @property Collection $roles - * @property int|null $roles_count - * @property ProfileContract|null $updater - * @property User|null $user - * @property string|null $user_name + * @property int|null $notifications_count + * @property Collection $permissions + * @property int|null $permissions_count + * @property Collection $roles + * @property int|null $roles_count + * @property ProfileContract|null $updater + * @property User|null $user + * @property string|null $user_name + * @property int|null $notifications_count + * @property Collection $permissions + * @property int|null $permissions_count + * @property Collection $roles + * @property int|null $roles_count + * @property ProfileContract|null $updater + * @property User|null $user + * @property string|null $user_name * * @method static Builder|Profile newModelQuery() * @method static Builder|Profile newQuery() @@ -137,17 +137,17 @@ * @method static Builder|Profile withoutRole($roles, $guard = null) * * @property ProfileContract|null $deleter - * @property string|null $fiscal_code - * @property string|null $notes - * @property string|null $fiscal_code - * @property string|null $notes + * @property string|null $fiscal_code + * @property string|null $notes + * @property string|null $fiscal_code + * @property string|null $notes * - * @method static Builder|Profile childrenWith(array $relations) - * @method static Builder|Profile childrenWithCount(array $relations) + * @method static Builder|Profile childrenWith(array $relations) + * @method static Builder|Profile childrenWithCount(array $relations) * @method static \Modules\Gdpr\Database\Factories\ProfileFactory factory($count = null, $state = []) - * @method static Builder|Profile whereFiscalCode($value) - * @method static Builder|Profile whereNotes($value) - * @method static Builder|Profile byUuid(string $uuid) + * @method static Builder|Profile whereFiscalCode($value) + * @method static Builder|Profile whereNotes($value) + * @method static Builder|Profile byUuid(string $uuid) * * @mixin \Eloquent */ diff --git a/app/Models/Traits/HasGdpr.php b/app/Models/Traits/HasGdpr.php index 7cd1db84..daa49a82 100644 --- a/app/Models/Traits/HasGdpr.php +++ b/app/Models/Traits/HasGdpr.php @@ -90,8 +90,8 @@ public function hasGivenConsentWithoutCache(ConsentType|string $type): bool /** * Give consent for a specific type. * - * @param array $metadata - * @param array $metadata + * @param array $metadata + * @param array $metadata */ public function giveConsent(ConsentType|string $type, array $metadata = []): Consent { diff --git a/app/Models/Treatment.php b/app/Models/Treatment.php index 8614253d..020f10eb 100644 --- a/app/Models/Treatment.php +++ b/app/Models/Treatment.php @@ -12,104 +12,104 @@ /** * Modules\Gdpr\Models\Treatment. * - * @property string $id - * @property int $active - * @property int $required - * @property string $name - * @property string $description - * @property string|null $documentVersion - * @property string|null $documentUrl - * @property int $weight - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $updated_by - * @property string|null $created_by - * @property Carbon|null $deleted_at - * @property string|null $deleted_by - * @property string $id - * @property int $active - * @property int $required - * @property string $name - * @property string $description - * @property string|null $documentVersion - * @property string|null $documentUrl - * @property int $weight - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $updated_by - * @property string|null $created_by - * @property Carbon|null $deleted_at - * @property string|null $deleted_by - * @property string $id - * @property int $active - * @property int $required - * @property string $name - * @property string $description - * @property string|null $documentVersion - * @property string|null $documentUrl - * @property int $weight - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $updated_by - * @property string|null $created_by - * @property Carbon|null $deleted_at - * @property string|null $deleted_by - * @property string $id - * @property int $active - * @property int $required - * @property string $name - * @property string $description - * @property string|null $documentVersion - * @property string|null $documentUrl - * @property int $weight - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $updated_by - * @property string|null $created_by - * @property Carbon|null $deleted_at - * @property string|null $deleted_by - * @property string $id - * @property int $active - * @property int $required - * @property string $name - * @property string $description - * @property string|null $documentVersion - * @property string|null $documentUrl - * @property int $weight - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $updated_by - * @property string|null $created_by - * @property Carbon|null $deleted_at - * @property string|null $deleted_by - * @property string $id - * @property int $active - * @property int $required - * @property string $name - * @property string $description - * @property string|null $documentVersion - * @property string|null $documentUrl - * @property int $weight - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $updated_by - * @property string|null $created_by - * @property Carbon|null $deleted_at - * @property string|null $deleted_by - * @property string $id - * @property int $active - * @property int $required - * @property string $name - * @property string $description - * @property string|null $documentVersion - * @property string|null $documentUrl - * @property int $weight - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property string|null $updated_by - * @property string|null $created_by - * @property Carbon|null $deleted_at - * @property string|null $deleted_by + * @property string $id + * @property int $active + * @property int $required + * @property string $name + * @property string $description + * @property string|null $documentVersion + * @property string|null $documentUrl + * @property int $weight + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $updated_by + * @property string|null $created_by + * @property Carbon|null $deleted_at + * @property string|null $deleted_by + * @property string $id + * @property int $active + * @property int $required + * @property string $name + * @property string $description + * @property string|null $documentVersion + * @property string|null $documentUrl + * @property int $weight + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $updated_by + * @property string|null $created_by + * @property Carbon|null $deleted_at + * @property string|null $deleted_by + * @property string $id + * @property int $active + * @property int $required + * @property string $name + * @property string $description + * @property string|null $documentVersion + * @property string|null $documentUrl + * @property int $weight + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $updated_by + * @property string|null $created_by + * @property Carbon|null $deleted_at + * @property string|null $deleted_by + * @property string $id + * @property int $active + * @property int $required + * @property string $name + * @property string $description + * @property string|null $documentVersion + * @property string|null $documentUrl + * @property int $weight + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $updated_by + * @property string|null $created_by + * @property Carbon|null $deleted_at + * @property string|null $deleted_by + * @property string $id + * @property int $active + * @property int $required + * @property string $name + * @property string $description + * @property string|null $documentVersion + * @property string|null $documentUrl + * @property int $weight + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $updated_by + * @property string|null $created_by + * @property Carbon|null $deleted_at + * @property string|null $deleted_by + * @property string $id + * @property int $active + * @property int $required + * @property string $name + * @property string $description + * @property string|null $documentVersion + * @property string|null $documentUrl + * @property int $weight + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $updated_by + * @property string|null $created_by + * @property Carbon|null $deleted_at + * @property string|null $deleted_by + * @property string $id + * @property int $active + * @property int $required + * @property string $name + * @property string $description + * @property string|null $documentVersion + * @property string|null $documentUrl + * @property int $weight + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property string|null $updated_by + * @property string|null $created_by + * @property Carbon|null $deleted_at + * @property string|null $deleted_by * @property ProfileContract|null $creator * @property ProfileContract|null $updater * @@ -151,7 +151,7 @@ protected static function booted(): void static::creating(function (Treatment $treatment): void { $name = $treatment->name; - if (! is_string($name) || '' === $name) { + if (! is_string($name) || $name === '') { return; } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index f6722686..fc0b2b0e 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -23,7 +23,5 @@ class EventServiceProvider extends XotBaseEventServiceProvider /** * Configure the proper event listeners for email verification. */ - protected function configureEmailVerification(): void - { - } + protected function configureEmailVerification(): void {} } diff --git a/app/Providers/GdprServiceProvider.php b/app/Providers/GdprServiceProvider.php index 763f4730..30cc9957 100644 --- a/app/Providers/GdprServiceProvider.php +++ b/app/Providers/GdprServiceProvider.php @@ -7,11 +7,10 @@ use Illuminate\Routing\Router; use Modules\Gdpr\Datas\GdprData; use Modules\Xot\Providers\XotBaseServiceProvider; +use Statikbe\CookieConsent\CookieConsentMiddleware; use function Safe\realpath; -use Statikbe\CookieConsent\CookieConsentMiddleware; - class GdprServiceProvider extends XotBaseServiceProvider { public string $name = 'Gdpr'; diff --git a/database/migrations/2024_01_01_000001_create_consents_table.php b/database/migrations/2024_01_01_000001_create_consents_table.php index 18bcb7fc..ce1e0d6a 100644 --- a/database/migrations/2024_01_01_000001_create_consents_table.php +++ b/database/migrations/2024_01_01_000001_create_consents_table.php @@ -5,12 +5,10 @@ use Illuminate\Database\Schema\Blueprint; use Modules\Xot\Database\Migrations\XotBaseMigration; -return new class extends XotBaseMigration { +return new class extends XotBaseMigration +{ protected $connection = 'gdpr'; - /** - * Run the migrations. - */ public function up(): void { // -- CREATE -- diff --git a/database/migrations/2024_01_01_000001_create_gdpr_events_table.php b/database/migrations/2024_01_01_000001_create_gdpr_events_table.php index c4b3cc8b..bf7b232a 100644 --- a/database/migrations/2024_01_01_000001_create_gdpr_events_table.php +++ b/database/migrations/2024_01_01_000001_create_gdpr_events_table.php @@ -6,12 +6,10 @@ use Modules\Gdpr\Models\Event; use Modules\Xot\Database\Migrations\XotBaseMigration; -return new class extends XotBaseMigration { +return new class extends XotBaseMigration +{ protected ?string $model_class = Event::class; - /** - * Run the migrations. - */ public function up(): void { // -- CREATE -- diff --git a/database/migrations/2024_01_01_000001_create_treatments_table.php b/database/migrations/2024_01_01_000001_create_treatments_table.php index 9d2528b5..35cbe371 100644 --- a/database/migrations/2024_01_01_000001_create_treatments_table.php +++ b/database/migrations/2024_01_01_000001_create_treatments_table.php @@ -5,10 +5,8 @@ use Illuminate\Database\Schema\Blueprint; use Modules\Xot\Database\Migrations\XotBaseMigration; -return new class extends XotBaseMigration { - /** - * Run the migrations. - */ +return new class extends XotBaseMigration +{ public function up(): void { // -- CREATE -- diff --git a/database/migrations/2024_01_01_000002_create_consents_table.php b/database/migrations/2024_01_01_000002_create_consents_table.php index ff2a0939..2c081556 100644 --- a/database/migrations/2024_01_01_000002_create_consents_table.php +++ b/database/migrations/2024_01_01_000002_create_consents_table.php @@ -5,10 +5,8 @@ use Illuminate\Database\Schema\Blueprint; use Modules\Xot\Database\Migrations\XotBaseMigration; -return new class extends XotBaseMigration { - /** - * Run the migrations. - */ +return new class extends XotBaseMigration +{ public function up(): void { // -- CREATE -- diff --git a/database/migrations/2024_01_01_000002_create_treatments_table.php b/database/migrations/2024_01_01_000002_create_treatments_table.php index 9d2528b5..35cbe371 100644 --- a/database/migrations/2024_01_01_000002_create_treatments_table.php +++ b/database/migrations/2024_01_01_000002_create_treatments_table.php @@ -5,10 +5,8 @@ use Illuminate\Database\Schema\Blueprint; use Modules\Xot\Database\Migrations\XotBaseMigration; -return new class extends XotBaseMigration { - /** - * Run the migrations. - */ +return new class extends XotBaseMigration +{ public function up(): void { // -- CREATE -- diff --git a/database/migrations/2024_01_01_000005_create_consents_table.php b/database/migrations/2024_01_01_000005_create_consents_table.php index 38788f79..3312be56 100644 --- a/database/migrations/2024_01_01_000005_create_consents_table.php +++ b/database/migrations/2024_01_01_000005_create_consents_table.php @@ -6,12 +6,10 @@ use Modules\Gdpr\Models\Consent; use Modules\Xot\Database\Migrations\XotBaseMigration; -return new class extends XotBaseMigration { +return new class extends XotBaseMigration +{ protected ?string $model_class = Consent::class; - /** - * Run the migrations. - */ public function up(): void { // -- CREATE -- diff --git a/database/migrations/_archive_redundant/2024_01_01_000001_create_consents_table.php b/database/migrations/_archive_redundant/2024_01_01_000001_create_consents_table.php index 18bcb7fc..ce1e0d6a 100644 --- a/database/migrations/_archive_redundant/2024_01_01_000001_create_consents_table.php +++ b/database/migrations/_archive_redundant/2024_01_01_000001_create_consents_table.php @@ -5,12 +5,10 @@ use Illuminate\Database\Schema\Blueprint; use Modules\Xot\Database\Migrations\XotBaseMigration; -return new class extends XotBaseMigration { +return new class extends XotBaseMigration +{ protected $connection = 'gdpr'; - /** - * Run the migrations. - */ public function up(): void { // -- CREATE -- diff --git a/database/migrations/_archive_redundant/2024_01_01_000002_create_consents_table.php b/database/migrations/_archive_redundant/2024_01_01_000002_create_consents_table.php index ff2a0939..2c081556 100644 --- a/database/migrations/_archive_redundant/2024_01_01_000002_create_consents_table.php +++ b/database/migrations/_archive_redundant/2024_01_01_000002_create_consents_table.php @@ -5,10 +5,8 @@ use Illuminate\Database\Schema\Blueprint; use Modules\Xot\Database\Migrations\XotBaseMigration; -return new class extends XotBaseMigration { - /** - * Run the migrations. - */ +return new class extends XotBaseMigration +{ public function up(): void { // -- CREATE -- diff --git a/resources/views/components/consent-label.blade.php b/resources/views/components/consent-label.blade.php index 9cce3f89..aa1397df 100644 --- a/resources/views/components/consent-label.blade.php +++ b/resources/views/components/consent-label.blade.php @@ -1,13 +1,13 @@
{{ $label }} - @foreach($links as $link) - {{ $link['text'] }} - @if(!$loop->last) {{ __('gdpr::register.links.and') }} @endif + @if (!$loop->last) {{ __('gdpr::register.links.and') }} @endif @endforeach
diff --git a/tests/Feature/ConflictResolutionTest.php b/tests/Feature/ConflictResolutionTest.php index 1e9dfbe6..2cc68528 100644 --- a/tests/Feature/ConflictResolutionTest.php +++ b/tests/Feature/ConflictResolutionTest.php @@ -10,13 +10,13 @@ uses(TestCase::class); it('verifica che le classi corrette siano istanziabili', function (): void { - Assert::assertInstanceOf(Treatment::class, new Treatment()); - Assert::assertInstanceOf(Profile::class, new Profile()); + Assert::assertInstanceOf(Treatment::class, new Treatment); + Assert::assertInstanceOf(Profile::class, new Profile); }); it('verifica che le proprietà delle classi siano accessibili', function (): void { - $treatment = new Treatment(); - $profile = new Profile(); + $treatment = new Treatment; + $profile = new Profile; Assert::assertIsArray($treatment->getFillable()); Assert::assertIsArray($profile->getFillable()); diff --git a/tests/Feature/RegisterPageComprehensiveTest.php b/tests/Feature/RegisterPageComprehensiveTest.php index 22a72352..fa55dc9b 100644 --- a/tests/Feature/RegisterPageComprehensiveTest.php +++ b/tests/Feature/RegisterPageComprehensiveTest.php @@ -337,11 +337,11 @@ $user = UserFactory::new()->createOne(['type' => 'customer_user']); gdprActingAs($user); - $widget = new RegisterWidget(); + $widget = new RegisterWidget; Assert::assertFalse($widget->canView()); }); it('widget is visible to guest users', function (): void { - $widget = new RegisterWidget(); + $widget = new RegisterWidget; Assert::assertTrue($widget->canView()); }); diff --git a/tests/PestHelpers.php b/tests/PestHelpers.php index ccb0e3bc..1628e6d3 100644 --- a/tests/PestHelpers.php +++ b/tests/PestHelpers.php @@ -33,8 +33,7 @@ function gdprTest(): TestCase } /** - * @param array $headers - * + * @param array $headers * @return TestResponse */ function gdprGet(string $uri, array $headers = []): TestResponse @@ -43,9 +42,8 @@ function gdprGet(string $uri, array $headers = []): TestResponse } /** - * @param array $data - * @param array $headers - * + * @param array $data + * @param array $headers * @return TestResponse */ function gdprPost(string $uri, array $data = [], array $headers = []): TestResponse @@ -59,7 +57,7 @@ function gdprActingAs(Authenticatable $user, ?string $driver = null): TestCase } /** - * @param array $parameters + * @param array $parameters */ function gdprArtisan(string $command, array $parameters = []): int { @@ -72,7 +70,7 @@ function gdprSkipTest(string $message = ''): void } /** - * @param array $where + * @param array $where */ function assertGdprTableHas(string $table, array $where, ?string $connection = 'gdpr'): void { @@ -86,7 +84,7 @@ function assertGdprTableHas(string $table, array $where, ?string $connection = ' } /** - * @param array $where + * @param array $where */ function assertGdprTableMissing(string $table, array $where, ?string $connection = 'gdpr'): void { @@ -100,7 +98,7 @@ function assertGdprTableMissing(string $table, array $where, ?string $connection } /** - * @param array $attributes + * @param array $attributes */ function createGdprConsent(array $attributes = []): Consent { @@ -117,7 +115,7 @@ function gdprAssertDatabaseAvailable(): void } /** - * @param class-string $exceptionClass + * @param class-string $exceptionClass */ function gdprAssertThrows(string $exceptionClass, callable $callback): void { @@ -130,7 +128,7 @@ function gdprAssertThrows(string $exceptionClass, callable $callback): void } /** - * @param class-string $exceptionClass + * @param class-string $exceptionClass */ function gdprAssertDoesNotThrow(string $exceptionClass, callable $callback): void { @@ -146,8 +144,8 @@ function gdprAssertDoesNotThrow(string $exceptionClass, callable $callback): voi } /** - * @param list $fields - * @param array $fillable + * @param list $fields + * @param array $fillable */ function assertFillableContains(array $fields, array $fillable): void { diff --git a/tests/TestCase.php b/tests/TestCase.php index 332e92c6..5adef050 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -48,7 +48,7 @@ protected function getPackageProviders(Application $app): array } /** - * @param array $data + * @param array $data */ public function assertDatabaseHasRow(string $table, array $data, ?string $connection = null): void { @@ -56,7 +56,7 @@ public function assertDatabaseHasRow(string $table, array $data, ?string $connec } /** - * @param array $data + * @param array $data */ public function assertDatabaseMissingRow(string $table, array $data, ?string $connection = null): void { @@ -70,12 +70,12 @@ public function assertDatabaseMissingRow(string $table, array $data, ?string $co } /** - * @param class-string<\Throwable> $exceptionClass + * @param class-string<\Throwable> $exceptionClass */ public function expectApplicationException(string $exceptionClass, ?string $message = null): void { $this->expectException($exceptionClass); - if (null !== $message) { + if ($message !== null) { $this->expectThrowableMessage($message); } } diff --git a/tests/Unit/Actions/CollectGdprConsentsActionTest.php b/tests/Unit/Actions/CollectGdprConsentsActionTest.php index 0897fecc..6f8d8cb4 100644 --- a/tests/Unit/Actions/CollectGdprConsentsActionTest.php +++ b/tests/Unit/Actions/CollectGdprConsentsActionTest.php @@ -11,7 +11,7 @@ uses(TestCase::class); test('CollectGdprConsentsAction returns correct array', function () { - $action = new CollectGdprConsentsAction(); + $action = new CollectGdprConsentsAction; $result = $action->execute(true, true, false); Assert::assertArrayHasKey('privacy_accepted', $result); @@ -23,7 +23,7 @@ }); test('CollectGdprConsentsAction handles all false', function () { - $action = new CollectGdprConsentsAction(); + $action = new CollectGdprConsentsAction; $result = $action->execute(false, false, false); Assert::assertFalse($result['privacy_accepted']); @@ -32,7 +32,7 @@ }); test('CollectGdprConsentsAction handles all true', function () { - $action = new CollectGdprConsentsAction(); + $action = new CollectGdprConsentsAction; $result = $action->execute(true, true, true); Assert::assertTrue($result['privacy_accepted']); diff --git a/tests/Unit/Actions/HandleRegistrationErrorActionTest.php b/tests/Unit/Actions/HandleRegistrationErrorActionTest.php index 8ad88604..3593f945 100644 --- a/tests/Unit/Actions/HandleRegistrationErrorActionTest.php +++ b/tests/Unit/Actions/HandleRegistrationErrorActionTest.php @@ -11,11 +11,11 @@ uses(TestCase::class); test('HandleRegistrationErrorAction can be instantiated', function (): void { - $action = new HandleRegistrationErrorAction(); + $action = new HandleRegistrationErrorAction; Assert::assertInstanceOf(HandleRegistrationErrorAction::class, $action); }); test('HandleRegistrationErrorAction execute method exists', function (): void { - $action = new HandleRegistrationErrorAction(); + $action = new HandleRegistrationErrorAction; Assert::assertTrue((new \ReflectionClass($action))->hasMethod('execute')); }); diff --git a/tests/Unit/Actions/HandleSuccessfulRegistrationActionTest.php b/tests/Unit/Actions/HandleSuccessfulRegistrationActionTest.php index 2be849fc..2dc947de 100644 --- a/tests/Unit/Actions/HandleSuccessfulRegistrationActionTest.php +++ b/tests/Unit/Actions/HandleSuccessfulRegistrationActionTest.php @@ -11,11 +11,11 @@ uses(TestCase::class); test('HandleSuccessfulRegistrationAction can be instantiated', function (): void { - $action = new HandleSuccessfulRegistrationAction(); + $action = new HandleSuccessfulRegistrationAction; Assert::assertInstanceOf(HandleSuccessfulRegistrationAction::class, $action); }); test('HandleSuccessfulRegistrationAction execute method exists', function (): void { - $action = new HandleSuccessfulRegistrationAction(); + $action = new HandleSuccessfulRegistrationAction; Assert::assertTrue((new \ReflectionClass($action))->hasMethod('execute')); }); diff --git a/tests/Unit/Actions/SaveGdprConsentsActionTest.php b/tests/Unit/Actions/SaveGdprConsentsActionTest.php index 8f4ccbb2..47b276f4 100644 --- a/tests/Unit/Actions/SaveGdprConsentsActionTest.php +++ b/tests/Unit/Actions/SaveGdprConsentsActionTest.php @@ -11,11 +11,11 @@ uses(TestCase::class); test('SaveGdprConsentsAction can be instantiated', function (): void { - $action = new SaveGdprConsentsAction(); + $action = new SaveGdprConsentsAction; Assert::assertInstanceOf(SaveGdprConsentsAction::class, $action); }); test('SaveGdprConsentsAction execute method exists', function (): void { - $action = new SaveGdprConsentsAction(); + $action = new SaveGdprConsentsAction; Assert::assertTrue((new \ReflectionClass($action))->hasMethod('execute')); }); diff --git a/tests/Unit/Actions/ValidateGdprConsentActionTest.php b/tests/Unit/Actions/ValidateGdprConsentActionTest.php index 402a4650..537a9b16 100644 --- a/tests/Unit/Actions/ValidateGdprConsentActionTest.php +++ b/tests/Unit/Actions/ValidateGdprConsentActionTest.php @@ -11,25 +11,25 @@ uses(TestCase::class); test('ValidateGdprConsentAction passes with valid consents', function () { - $action = new ValidateGdprConsentAction(); + $action = new ValidateGdprConsentAction; gdprAssertDoesNotThrow(ValidationException::class, static fn () => $action->execute(true, true)); }); test('ValidateGdprConsentAction throws with false privacy', function () { - $action = new ValidateGdprConsentAction(); + $action = new ValidateGdprConsentAction; gdprAssertThrows(ValidationException::class, static fn () => $action->execute(false, true)); }); test('ValidateGdprConsentAction throws with false terms', function () { - $action = new ValidateGdprConsentAction(); + $action = new ValidateGdprConsentAction; gdprAssertThrows(ValidationException::class, static fn () => $action->execute(true, false)); }); test('ValidateGdprConsentAction throws with both false', function () { - $action = new ValidateGdprConsentAction(); + $action = new ValidateGdprConsentAction; gdprAssertThrows(ValidationException::class, static fn () => $action->execute(false, false)); }); diff --git a/tests/Unit/Actions/ValidateUserDataActionTest.php b/tests/Unit/Actions/ValidateUserDataActionTest.php index a8cd2b1b..4707377b 100644 --- a/tests/Unit/Actions/ValidateUserDataActionTest.php +++ b/tests/Unit/Actions/ValidateUserDataActionTest.php @@ -12,7 +12,7 @@ uses(TestCase::class); test('ValidateUserDataAction returns valid user data', function () { - $action = new ValidateUserDataAction(); + $action = new ValidateUserDataAction; $uniqueEmail = 'test'.uniqid().'@example.com'; $formData = [ @@ -39,7 +39,7 @@ }); test('ValidateUserDataAction hashes password', function () { - $action = new ValidateUserDataAction(); + $action = new ValidateUserDataAction; $uniqueEmail = 'test'.uniqid().'@example.com'; $formData = [ diff --git a/tests/Unit/Filament/Resources/ConsentResourceTest.php b/tests/Unit/Filament/Resources/ConsentResourceTest.php index 702da4d2..e31334a0 100644 --- a/tests/Unit/Filament/Resources/ConsentResourceTest.php +++ b/tests/Unit/Filament/Resources/ConsentResourceTest.php @@ -13,11 +13,11 @@ uses(TestCase::class); test('consent_resource_extends_xot_base_resource', function (): void { - Assert::assertInstanceOf(XotBaseResource::class, new ConsentResource()); + Assert::assertInstanceOf(XotBaseResource::class, new ConsentResource); }); test('consent_resource_model_is_consent', function (): void { - $resource = new ConsentResource(); + $resource = new ConsentResource; Assert::assertSame(Consent::class, $resource->getModel()); }); diff --git a/tests/Unit/Filament/Resources/EventResourceTest.php b/tests/Unit/Filament/Resources/EventResourceTest.php index a9dd810d..ac0208d4 100644 --- a/tests/Unit/Filament/Resources/EventResourceTest.php +++ b/tests/Unit/Filament/Resources/EventResourceTest.php @@ -13,11 +13,11 @@ uses(TestCase::class); test('event_resource_extends_xot_base_resource', function (): void { - Assert::assertInstanceOf(XotBaseResource::class, new EventResource()); + Assert::assertInstanceOf(XotBaseResource::class, new EventResource); }); test('event_resource_model_is_event', function (): void { - $resource = new EventResource(); + $resource = new EventResource; Assert::assertSame(Event::class, $resource->getModel()); }); diff --git a/tests/Unit/Filament/Resources/ProfileResourceTest.php b/tests/Unit/Filament/Resources/ProfileResourceTest.php index 113a1877..917f3af8 100644 --- a/tests/Unit/Filament/Resources/ProfileResourceTest.php +++ b/tests/Unit/Filament/Resources/ProfileResourceTest.php @@ -13,11 +13,11 @@ uses(TestCase::class); test('profile_resource_extends_xot_base_resource', function (): void { - Assert::assertInstanceOf(XotBaseResource::class, new ProfileResource()); + Assert::assertInstanceOf(XotBaseResource::class, new ProfileResource); }); test('profile_resource_model_is_profile', function (): void { - $resource = new ProfileResource(); + $resource = new ProfileResource; Assert::assertSame(Profile::class, $resource->getModel()); }); diff --git a/tests/Unit/Filament/Resources/TreatmentResourceTest.php b/tests/Unit/Filament/Resources/TreatmentResourceTest.php index 3cb6bc94..6d0b3065 100644 --- a/tests/Unit/Filament/Resources/TreatmentResourceTest.php +++ b/tests/Unit/Filament/Resources/TreatmentResourceTest.php @@ -13,11 +13,11 @@ uses(TestCase::class); test('treatment_resource_extends_xot_base_resource', function (): void { - Assert::assertInstanceOf(XotBaseResource::class, new TreatmentResource()); + Assert::assertInstanceOf(XotBaseResource::class, new TreatmentResource); }); test('treatment_resource_model_is_treatment', function (): void { - $resource = new TreatmentResource(); + $resource = new TreatmentResource; Assert::assertSame(Treatment::class, $resource->getModel()); }); diff --git a/tests/Unit/Models/BaseModelTest.php b/tests/Unit/Models/BaseModelTest.php index 5a73b809..bb51017b 100644 --- a/tests/Unit/Models/BaseModelTest.php +++ b/tests/Unit/Models/BaseModelTest.php @@ -13,7 +13,8 @@ function makeGdprBaseModel(): BaseModel { - return new class extends BaseModel { + return new class extends BaseModel + { protected $table = 'test_gdpr_table'; }; } diff --git a/tests/Unit/Models/ConsentModelTest.php b/tests/Unit/Models/ConsentModelTest.php index 856aa11d..88362df8 100644 --- a/tests/Unit/Models/ConsentModelTest.php +++ b/tests/Unit/Models/ConsentModelTest.php @@ -12,7 +12,7 @@ uses(TestCase::class); test('consent_fillable_attributes', function (): void { - $consent = new Consent(); + $consent = new Consent; $fillable = $consent->getFillable(); assertFillableContains([ @@ -26,19 +26,19 @@ }); test('consent_has_treatment_relationship_method', function (): void { - $consent = new Consent(); + $consent = new Consent; Assert::assertTrue((new \ReflectionClass($consent))->hasMethod('treatment')); }); test('consent_is_not_incrementing', function (): void { - $consent = new Consent(); + $consent = new Consent; Assert::assertFalse($consent->getIncrementing()); }); test('consent_is_uuid', function (): void { - $consent = new Consent(); + $consent = new Consent; $traits = class_uses_recursive($consent); Assert::assertArrayHasKey(HasUuids::class, $traits); diff --git a/tests/Unit/Models/EventModelTest.php b/tests/Unit/Models/EventModelTest.php index 438cc288..f33ec22c 100644 --- a/tests/Unit/Models/EventModelTest.php +++ b/tests/Unit/Models/EventModelTest.php @@ -12,7 +12,7 @@ uses(TestCase::class); test('event_fillable_attributes', function (): void { - $event = new Event(); + $event = new Event; $fillable = $event->getFillable(); assertFillableContains([ @@ -26,38 +26,38 @@ }); test('event_has_consent_relationship_method', function (): void { - $event = new Event(); + $event = new Event; Assert::assertTrue((new \ReflectionClass($event))->hasMethod('consent')); }); test('event_table_name_is_gdpr_events', function (): void { - $event = new Event(); + $event = new Event; Assert::assertSame('gdpr_events', $event->getTable()); }); test('event_is_not_incrementing', function (): void { - $event = new Event(); + $event = new Event; Assert::assertFalse($event->getIncrementing()); }); test('event_is_uuid', function (): void { - $event = new Event(); + $event = new Event; $traits = class_uses_recursive($event); Assert::assertArrayHasKey(HasUuids::class, $traits); }); test('event_has_set_payload_attribute', function (): void { - $event = new Event(); + $event = new Event; Assert::assertTrue((new \ReflectionClass($event))->hasMethod('setPayloadAttribute')); }); test('event_has_set_ip_attribute', function (): void { - $event = new Event(); + $event = new Event; Assert::assertTrue((new \ReflectionClass($event))->hasMethod('setIpAttribute')); }); diff --git a/tests/Unit/Models/GdprConsentBusinessLogicTest.php b/tests/Unit/Models/GdprConsentBusinessLogicTest.php index b0d8579c..3330d78d 100644 --- a/tests/Unit/Models/GdprConsentBusinessLogicTest.php +++ b/tests/Unit/Models/GdprConsentBusinessLogicTest.php @@ -66,7 +66,7 @@ }); it('validates fillable consent fields', function () { - $consent = new Consent(); + $consent = new Consent; $fillable = $consent->getFillable(); assertFillableContains([ diff --git a/tests/Unit/Models/GdprConsentTest.php b/tests/Unit/Models/GdprConsentTest.php index 16846933..d4b10bb9 100644 --- a/tests/Unit/Models/GdprConsentTest.php +++ b/tests/Unit/Models/GdprConsentTest.php @@ -30,19 +30,19 @@ }); test('gdpr consent has treatment relationship method', function () { - $consent = new Consent(); + $consent = new Consent; Assert::assertContains('treatment', get_class_methods($consent)); }); test('gdpr consent is not incrementing', function () { - $consent = new Consent(); + $consent = new Consent; Assert::assertFalse($consent->getIncrementing()); }); test('gdpr consent uses uuid trait', function () { - $consent = new Consent(); + $consent = new Consent; $traits = class_uses_recursive($consent); Assert::assertArrayHasKey('Illuminate\Database\Eloquent\Concerns\HasUuids', $traits); diff --git a/tests/Unit/Models/ProfileModelTest.php b/tests/Unit/Models/ProfileModelTest.php index b3c2f582..21318a72 100644 --- a/tests/Unit/Models/ProfileModelTest.php +++ b/tests/Unit/Models/ProfileModelTest.php @@ -13,25 +13,25 @@ uses(TestCase::class); test('profile_extends_base_profile', function (): void { - $profile = new Profile(); + $profile = new Profile; Assert::assertInstanceOf(BaseProfile::class, $profile); }); test('profile_has_gdpr_connection', function (): void { - $profile = new Profile(); + $profile = new Profile; Assert::assertSame('gdpr', $profile->getConnectionName()); }); test('profile_is_model', function (): void { - $profile = new Profile(); + $profile = new Profile; Assert::assertInstanceOf(Model::class, $profile); }); test('profile_has_standard_attributes', function (): void { - $profile = new Profile(); + $profile = new Profile; Assert::assertTrue((new \ReflectionClass($profile))->hasMethod('user')); }); diff --git a/tests/Unit/Models/TreatmentModelTest.php b/tests/Unit/Models/TreatmentModelTest.php index b8ddbc5f..3290773d 100644 --- a/tests/Unit/Models/TreatmentModelTest.php +++ b/tests/Unit/Models/TreatmentModelTest.php @@ -13,7 +13,7 @@ uses(TestCase::class); test('treatment_fillable_attributes', function (): void { - $treatment = new Treatment(); + $treatment = new Treatment; $fillable = $treatment->getFillable(); assertFillableContains([ @@ -29,20 +29,20 @@ }); test('treatment_is_not_incrementing', function (): void { - $treatment = new Treatment(); + $treatment = new Treatment; Assert::assertFalse($treatment->getIncrementing()); }); test('treatment_is_uuid', function (): void { - $treatment = new Treatment(); + $treatment = new Treatment; $traits = class_uses_recursive($treatment); Assert::assertArrayHasKey(HasUuids::class, $traits); }); test('treatment_extends_base_model', function (): void { - $treatment = new Treatment(); + $treatment = new Treatment; Assert::assertInstanceOf(BaseModel::class, $treatment); });