From 85f4b9aec592bc500f6b48edeaa4d8c306e466f7 Mon Sep 17 00:00:00 2001 From: Zyra Date: Thu, 3 Sep 2026 11:07:49 +0000 Subject: [PATCH 1/2] Fix #131: ColumnBuilder cacht kolommen per resource-class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ColumnBuilder::build() doorliep bij elke datatable-request opnieuw de velden van een resource (o.a. dubbel via de zichtbaarheidscheck). Een statische in-memory cache per resource-class zorgt dat dit werk maar één keer per proces gebeurt; de kolomstructuur hangt alleen af van de fieldsdefinitie van de class, niet van de instantie of het record. Test toont aan dat een tweede build()-aanroep voor dezelfde resource-class niet opnieuw door de velden gaat. --- src/Datatable/ColumnBuilder.php | 31 +++++- tests/Unit/Datatable/ColumnBuilderTest.php | 121 +++++++++++++++++++++ 2 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 tests/Unit/Datatable/ColumnBuilderTest.php diff --git a/src/Datatable/ColumnBuilder.php b/src/Datatable/ColumnBuilder.php index c27a902..b88fc40 100644 --- a/src/Datatable/ColumnBuilder.php +++ b/src/Datatable/ColumnBuilder.php @@ -9,6 +9,19 @@ */ class ColumnBuilder { + /** + * In-memory cache van reeds opgebouwde kolommen, per resource-class. + * + * De structuur van de kolommen (naam, sortable, label, zichtbaarheid) hangt + * alleen af van de fieldsdefinitie van de resource-class en niet van de + * specifieke instantie of het model-record. Daarom mag dit resultaat + * process-breed hergebruikt worden en hoeft build() niet bij elke + * datatable-request opnieuw de fields van de resource te doorlopen. + * + * @var array> + */ + private static array $columnCache = []; + /** * Builds an array of visible and optionally sortable column definitions. * @@ -17,7 +30,13 @@ class ColumnBuilder */ public static function build(object $resource): array { - return array_values(array_filter( + $cacheKey = get_class($resource); + + if (array_key_exists($cacheKey, self::$columnCache)) { + return self::$columnCache[$cacheKey]; + } + + $columns = array_values(array_filter( array_map( fn($field): array => [ 'name' => $field->name, @@ -28,6 +47,16 @@ public static function build(object $resource): array ), fn(array $field): bool => self::isVisibleInTable($resource, $field['name']) )); + + return self::$columnCache[$cacheKey] = $columns; + } + + /** + * Leegt de kolommencache. Vooral bedoeld voor gebruik in tests. + */ + public static function clearCache(): void + { + self::$columnCache = []; } /** diff --git a/tests/Unit/Datatable/ColumnBuilderTest.php b/tests/Unit/Datatable/ColumnBuilderTest.php new file mode 100644 index 0000000..a23d08f --- /dev/null +++ b/tests/Unit/Datatable/ColumnBuilderTest.php @@ -0,0 +1,121 @@ +assertSame([ + ['name' => 'naam', 'sortable' => true, 'label' => 'Naam'], + ], $columns); + } + + /** @test */ + public function een_tweede_build_voor_dezelfde_resource_class_roept_definefields_niet_opnieuw_aan(): void + { + $columns1 = ColumnBuilder::build(new CountingFieldsResource()); + + // Bij een cache-miss doorloopt build() de velden (o.a. voor de + // zichtbaarheidscheck); zolang dat aantal na de tweede aanroep niet + // stijgt, is aangetoond dat defineFields() niet opnieuw draait. + $callsAfterFirstBuild = CountingFieldsResource::$defineFieldsCalls; + $this->assertGreaterThan(0, $callsAfterFirstBuild); + + // Nieuwe instantie van dezelfde resource-class, zoals bij een volgend datatable-request. + $columns2 = ColumnBuilder::build(new CountingFieldsResource()); + + $this->assertSame($columns1, $columns2); + $this->assertSame( + $callsAfterFirstBuild, + CountingFieldsResource::$defineFieldsCalls, + 'defineFields() mag dankzij de ColumnBuilder-cache niet opnieuw worden aangeroepen voor dezelfde resource-class.' + ); + } + + /** @test */ + public function verschillende_resource_classes_hebben_hun_eigen_cache_entry(): void + { + $columnsA = ColumnBuilder::build(new CountingFieldsResource()); + $columnsB = ColumnBuilder::build(new OtherCountingFieldsResource()); + + $this->assertNotSame($columnsA, $columnsB); + $this->assertGreaterThan(0, CountingFieldsResource::$defineFieldsCalls); + $this->assertGreaterThan(0, OtherCountingFieldsResource::$defineFieldsCalls); + } +} + +/** + * Test-double die het gedrag van een BuildoraResource nabootst: getFields() + * levert de velden op basis van defineFields(). De teller maakt zichtbaar + * hoe vaak defineFields() daadwerkelijk is uitgevoerd. + */ +class CountingFieldsResource +{ + public static int $defineFieldsCalls = 0; + + public function getFields(): array + { + return $this->defineFields(); + } + + public function defineFields(): array + { + self::$defineFieldsCalls++; + + return [ + (object) [ + 'name' => 'naam', + 'label' => 'Naam', + 'sortable' => true, + 'visibility' => ['table' => true], + ], + (object) [ + 'name' => 'verborgen', + 'label' => 'Verborgen', + 'sortable' => false, + 'visibility' => ['table' => false], + ], + ]; + } +} + +class OtherCountingFieldsResource +{ + public static int $defineFieldsCalls = 0; + + public function getFields(): array + { + return $this->defineFields(); + } + + public function defineFields(): array + { + self::$defineFieldsCalls++; + + return [ + (object) [ + 'name' => 'email', + 'label' => 'E-mailadres', + 'sortable' => false, + 'visibility' => ['table' => true], + ], + ]; + } +} From eb3df333fe7760580329376e06170c05c6f6e06d Mon Sep 17 00:00:00 2001 From: Zyra Date: Thu, 3 Sep 2026 11:11:13 +0000 Subject: [PATCH 2/2] Bewijs #131: test-, lint- en typecheck-logs toevoegen Logbestanden van phpunit, phpcs (ColumnBuilder + volledige src) en phpstan (level 5, ColumnBuilder + volledige src) plus een proefdraai-log van .zyra/proef.sh, ter onderbouwing dat de cache-wijziging in ColumnBuilder groen is en geen nieuwe lint/typecheck-fouten introduceert. --- .zyra/logs/phpcs-full.log | 98 +++++++++ .zyra/logs/phpcs.log | 1 + .zyra/logs/phpstan-columnbuilder.log | 24 ++ .zyra/logs/phpstan-full.log | 315 +++++++++++++++++++++++++++ .zyra/logs/phpunit.log | 58 +++++ .zyra/logs/proef.log | 22 ++ 6 files changed, 518 insertions(+) create mode 100644 .zyra/logs/phpcs-full.log create mode 100644 .zyra/logs/phpcs.log create mode 100644 .zyra/logs/phpstan-columnbuilder.log create mode 100644 .zyra/logs/phpstan-full.log create mode 100644 .zyra/logs/phpunit.log create mode 100644 .zyra/logs/proef.log diff --git a/.zyra/logs/phpcs-full.log b/.zyra/logs/phpcs-full.log new file mode 100644 index 0000000..2b66f1d --- /dev/null +++ b/.zyra/logs/phpcs-full.log @@ -0,0 +1,98 @@ + +FILE: ...93c293-a2e7-47ed-8820-9732a9962da1/src/Resources/Defaults/UserBuildora.php +-------------------------------------------------------------------------------- +FOUND 1 ERROR AFFECTING 1 LINE +-------------------------------------------------------------------------------- + 59 | ERROR | [x] Expected 0 spaces before closing parenthesis; newline found +-------------------------------------------------------------------------------- +PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY +-------------------------------------------------------------------------------- + + +FILE: ...993c293-a2e7-47ed-8820-9732a9962da1/src/Fields/Types/RelationLinkField.php +-------------------------------------------------------------------------------- +FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE +-------------------------------------------------------------------------------- + 204 | WARNING | Line exceeds 120 characters; contains 203 characters +-------------------------------------------------------------------------------- + + +FILE: ...293-a2e7-47ed-8820-9732a9962da1/src/Http/Controllers/InstallController.php +-------------------------------------------------------------------------------- +FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES +-------------------------------------------------------------------------------- + 49 | WARNING | [ ] Line exceeds 120 characters; contains 127 characters + 131 | ERROR | [x] Blank line found at end of control structure +-------------------------------------------------------------------------------- +PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY +-------------------------------------------------------------------------------- + + +FILE: ...7-47ed-8820-9732a9962da1/src/Http/Controllers/InlineRelationController.php +-------------------------------------------------------------------------------- +FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES +-------------------------------------------------------------------------------- + 45 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found + 148 | WARNING | [ ] Line exceeds 120 characters; contains 123 characters +-------------------------------------------------------------------------------- +PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY +-------------------------------------------------------------------------------- + + +FILE: ...3-a2e7-47ed-8820-9732a9962da1/src/Http/Controllers/TwoFactorController.php +-------------------------------------------------------------------------------- +FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE +-------------------------------------------------------------------------------- + 160 | WARNING | Line exceeds 120 characters; contains 126 characters +-------------------------------------------------------------------------------- + + +FILE: ...93c293-a2e7-47ed-8820-9732a9962da1/src/Commands/UpgradeBuildoraCommand.php +-------------------------------------------------------------------------------- +FOUND 1 ERROR AFFECTING 1 LINE +-------------------------------------------------------------------------------- + 45 | ERROR | [x] Blank line found at end of control structure +-------------------------------------------------------------------------------- +PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY +-------------------------------------------------------------------------------- + + +FILE: ...93c293-a2e7-47ed-8820-9732a9962da1/src/Commands/InstallBuildoraCommand.php +-------------------------------------------------------------------------------- +FOUND 1 ERROR AFFECTING 1 LINE +-------------------------------------------------------------------------------- + 67 | ERROR | [x] Blank line found at end of control structure +-------------------------------------------------------------------------------- +PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY +-------------------------------------------------------------------------------- + + +FILE: ...werkplaats/8993c293-a2e7-47ed-8820-9732a9962da1/src/Support/UrlBuilder.php +-------------------------------------------------------------------------------- +FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE +-------------------------------------------------------------------------------- + 33 | WARNING | Line exceeds 120 characters; contains 130 characters +-------------------------------------------------------------------------------- + + +FILE: ...s/8993c293-a2e7-47ed-8820-9732a9962da1/src/Datatable/BuildoraDatatable.php +-------------------------------------------------------------------------------- +FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES +-------------------------------------------------------------------------------- + 66 | WARNING | Line exceeds 120 characters; contains 148 characters + 76 | WARNING | Line exceeds 120 characters; contains 147 characters + 99 | WARNING | Line exceeds 120 characters; contains 151 characters +-------------------------------------------------------------------------------- + + +FILE: ...kplaats/8993c293-a2e7-47ed-8820-9732a9962da1/src/Datatable/DataFetcher.php +-------------------------------------------------------------------------------- +FOUND 1 ERROR AFFECTING 1 LINE +-------------------------------------------------------------------------------- + 140 | ERROR | [x] Expected 0 spaces before closing parenthesis; newline found +-------------------------------------------------------------------------------- +PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY +-------------------------------------------------------------------------------- + +Time: 439ms; Memory: 16MB + diff --git a/.zyra/logs/phpcs.log b/.zyra/logs/phpcs.log new file mode 100644 index 0000000..f8000a0 --- /dev/null +++ b/.zyra/logs/phpcs.log @@ -0,0 +1 @@ +geen output = schoon diff --git a/.zyra/logs/phpstan-columnbuilder.log b/.zyra/logs/phpstan-columnbuilder.log new file mode 100644 index 0000000..40e3405 --- /dev/null +++ b/.zyra/logs/phpstan-columnbuilder.log @@ -0,0 +1,24 @@ + +⚠️ You're running an old version of PHPStan.️ + +The last release in the 1.12.x series with new features +and bugfixes was released on July 17th 2025, +that's 413 days ago. + +Since then more than 65 new PHPStan versions were released +with hundreds of new features, bugfixes, and other +quality of life improvements. + +To learn about what you're missing out on, check out +this blog with articles about the latest major releases: +https://phpstan.org/blog + +Upgrade today to PHPStan 2.2 or newer by using +"phpstan/phpstan": "^2.2" in your composer.json. + +Note: Using configuration file /app/werkplaats/8993c293-a2e7-47ed-8820-9732a9962da1/phpstan.neon. + 0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% + + + [OK] No errors + diff --git a/.zyra/logs/phpstan-full.log b/.zyra/logs/phpstan-full.log new file mode 100644 index 0000000..c997b69 --- /dev/null +++ b/.zyra/logs/phpstan-full.log @@ -0,0 +1,315 @@ + +⚠️ You're running an old version of PHPStan.️ + +The last release in the 1.12.x series with new features +and bugfixes was released on July 17th 2025, +that's 413 days ago. + +Since then more than 65 new PHPStan versions were released +with hundreds of new features, bugfixes, and other +quality of life improvements. + +To learn about what you're missing out on, check out +this blog with articles about the latest major releases: +https://phpstan.org/blog + +Upgrade today to PHPStan 2.2 or newer by using +"phpstan/phpstan": "^2.2" in your composer.json. + +Note: Using configuration file /app/werkplaats/8993c293-a2e7-47ed-8820-9732a9962da1/phpstan.neon. + 0/97 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 20/97 [▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░] 20% 40/97 [▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░] 41% 60/97 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░] 61% 80/97 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░] 82% 97/97 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% + + ------ --------------------------------------------- + Line Actions/RowAction.php + ------ --------------------------------------------- + 135 Negated boolean expression is always false. + ------ --------------------------------------------- + + ------ ----------------------------------------------------------------------- + Line Buildora.php + ------ ----------------------------------------------------------------------- + 23 Method Ginkelsoft\Buildora\Buildora::css() has invalid return type + Ginkelsoft\Buildora\Illuminate\Contracts\Support\Htmlable. + 37 Method Ginkelsoft\Buildora\Buildora::css() should return + Ginkelsoft\Buildora\Illuminate\Contracts\Support\Htmlable but returns + Illuminate\Support\HtmlString. + ------ ----------------------------------------------------------------------- + + ------ --------------------------------------------------------------------- + Line Commands/BuildoraSyncPermissionsCommand.php + ------ --------------------------------------------------------------------- + 39 Strict comparison using === between class-string and + 'App\\Buildora\\Resources\\PermissionBuildora' will always evaluate + to false. + ------ --------------------------------------------------------------------- + + ------ ----------------------------------------------------------------------- + Line Commands/GrantUserResourcePermissions.php + ------ ----------------------------------------------------------------------- + 26 PHPDoc tag @var for variable $user contains unknown class + App\Models\User. + 💡 Learn more at https://phpstan.org/user-guide/discovering-symbols + 42 Call to method hasPermissionTo() on an unknown class App\Models\User. + 💡 Learn more at https://phpstan.org/user-guide/discovering-symbols + 43 Call to method givePermissionTo() on an unknown class + App\Models\User. + 💡 Learn more at https://phpstan.org/user-guide/discovering-symbols + ------ ----------------------------------------------------------------------- + + ------ ------------------------------------------------------------------ + Line Datatable/BuildoraDatatable.php + ------ ------------------------------------------------------------------ + 66 Deprecated in PHP 8.4: Parameter #4 $perPage (int) is implicitly + nullable via default value null. + 76 Deprecated in PHP 8.4: Parameter #4 $perPage (int) is implicitly + nullable via default value null. + 99 Deprecated in PHP 8.4: Parameter #4 $perPage (int) is implicitly + nullable via default value null. + ------ ------------------------------------------------------------------ + + ------ -------------------------------------------------------------------------- + Line Datatable/DataFetcher.php + ------ -------------------------------------------------------------------------- + 139 Call to function is_array() with Ginkelsoft\Buildora\Fields\Field + will always evaluate to false. + 139 Offset 'name' on *NEVER* on left side of ?? always exists and is not + nullable. + 139 Strict comparison using === between Ginkelsoft\Buildora\Fields\Field + and non-falsy-string will always evaluate to false. + 💡 Because the type is coming from a PHPDoc, you can turn off this + check by setting treatPhpDocTypesAsCertain: false in your + phpstan.neon. + 142 Call to function is_array() with + Ginkelsoft\Buildora\Fields\Field|null will always evaluate to false. + 💡 Because the type is coming from a PHPDoc, you can turn off this + check by setting treatPhpDocTypesAsCertain: false in your + phpstan.neon. + 143 Offset 'name' on *NEVER* on left side of ?? always exists and is not + nullable. + 143 Offset 'search_column' on *NEVER* on left side of ?? always exists + and is not nullable. + 161 Parameter $query of method + Ginkelsoft\Buildora\Datatable\DataFetcher::eagerLoadBelongsToRelations() + has invalid type Ginkelsoft\Buildora\Datatable\Builder. + 173 Call to method with() on an unknown class + Ginkelsoft\Buildora\Datatable\Builder. + 💡 Learn more at https://phpstan.org/user-guide/discovering-symbols + ------ -------------------------------------------------------------------------- + + ------ ------------------------------------------------------------------ + Line Fields/Traits/HasSearch.php (in context of class + Ginkelsoft\Buildora\Fields\Field) + ------ ------------------------------------------------------------------ + 35 Deprecated in PHP 8.4: Parameter #1 $term (string) is implicitly + nullable via default value null. + ------ ------------------------------------------------------------------ + + ------ ---------------------------------------------------------------------- + Line Fields/Types/CurrencyField.php + ------ ---------------------------------------------------------------------- + 33 PHPDoc tag @param for parameter $type with type string|null is not + subtype of native type string. + 35 Method Ginkelsoft\Buildora\Fields\Types\CurrencyField::make() should + return static(Ginkelsoft\Buildora\Fields\Types\CurrencyField) but + returns Ginkelsoft\Buildora\Fields\Types\CurrencyField. + ------ ---------------------------------------------------------------------- + + ------ ---------------------------------------------------------------------- + Line Fields/Types/RichTextField.php + ------ ---------------------------------------------------------------------- + 32 PHPDoc tag @param for parameter $type with type string|null is not + subtype of native type string. + 34 Method Ginkelsoft\Buildora\Fields\Types\RichTextField::make() should + return static(Ginkelsoft\Buildora\Fields\Types\RichTextField) but + returns Ginkelsoft\Buildora\Fields\Types\RichTextField. + ------ ---------------------------------------------------------------------- + + ------ ----------------------------------------------------------------- + Line Fields/Types/SelectField.php + ------ ----------------------------------------------------------------- + 68 Property Ginkelsoft\Buildora\Fields\Types\SelectField::$options + (array|Closure|string) on left side of ?? is not nullable. + ------ ----------------------------------------------------------------- + + ------ ------------------------------------------------------------------------------------------- + Line Http/Controllers/Auth/ForgotPasswordController.php + ------ ------------------------------------------------------------------------------------------- + 20 Method + Ginkelsoft\Buildora\Http\Controllers\Auth\ForgotPasswordController::showLinkRequestForm() + should return Illuminate\View\View but returns + Illuminate\Contracts\View\View. + ------ ------------------------------------------------------------------------------------------- + + ------ ---------------------------------------------------------------------------- + Line Http/Controllers/Auth/LoginController.php + ------ ---------------------------------------------------------------------------- + 33 Method + Ginkelsoft\Buildora\Http\Controllers\Auth\LoginController::showLoginForm() + should return Illuminate\Http\RedirectResponse|Illuminate\View\View + but returns Illuminate\Contracts\View\View. + 70 Class App\Models\User not found. + 💡 Learn more at https://phpstan.org/user-guide/discovering-symbols + 89 Left side of && is always true. + 100 Left side of && is always true. + ------ ---------------------------------------------------------------------------- + + ------ ------------------------------------------------------------------------------------ + Line Http/Controllers/Auth/ResetPasswordController.php + ------ ------------------------------------------------------------------------------------ + 23 Deprecated in PHP 8.4: Parameter #2 $token (string) is implicitly + nullable via default value null. + 25 Method + Ginkelsoft\Buildora\Http\Controllers\Auth\ResetPasswordController::showResetForm() + should return Illuminate\View\View but returns + Illuminate\Contracts\View\View. + ------ ------------------------------------------------------------------------------------ + + ------ ------------------------------------------------------------------- + Line Http/Controllers/BuildoraController.php + ------ ------------------------------------------------------------------- + 43 Method + Ginkelsoft\Buildora\Http\Controllers\BuildoraController::create() + should return Illuminate\View\View but returns + Illuminate\Contracts\View\View. + 79 Expression on left side of ?? is not nullable. + 80 Expression on left side of ?? is not nullable. + 129 Method + Ginkelsoft\Buildora\Http\Controllers\BuildoraController::edit() + should return Illuminate\View\View but returns + Illuminate\Contracts\View\View. + 168 Expression on left side of ?? is not nullable. + 169 Expression on left side of ?? is not nullable. + ------ ------------------------------------------------------------------- + + ------ ------------------------------------------------------------------------------ + Line Http/Controllers/BuildoraDashboardController.php + ------ ------------------------------------------------------------------------------ + 28 Method + Ginkelsoft\Buildora\Http\Controllers\BuildoraDashboardController::__invoke() + should return Illuminate\View\View but returns + Illuminate\Contracts\View\View. + ------ ------------------------------------------------------------------------------ + + ------ --------------------------------------------------------------------------- + Line Http/Controllers/BuildoraDataTableController.php + ------ --------------------------------------------------------------------------- + 27 Method + Ginkelsoft\Buildora\Http\Controllers\BuildoraDataTableController::index() + should return Illuminate\View\View but returns + Illuminate\Contracts\View\View. + ------ --------------------------------------------------------------------------- + + ------ ----------------------------------------------------------------------- + Line Http/Controllers/GlobalSearchController.php + ------ ----------------------------------------------------------------------- + 24 Offset 'name' on array{name: string, resource: string, route: string, + label: string} in isset() always exists and is not nullable. + 43 Offset 'columns' on array{label: array|(callable(): mixed)|string, + columns: array} on left side of ?? always exists and is not + nullable. + 44 Offset 'label' on array{label: array|(callable(): mixed)|string, + columns: array} on left side of ?? always exists and is not + nullable. + ------ ----------------------------------------------------------------------- + + ------ --------------------------------------------------------------------- + Line Http/Controllers/InstallController.php + ------ --------------------------------------------------------------------- + 377 Class App\Models\User not found. + 💡 Learn more at https://phpstan.org/user-guide/discovering-symbols + 446 Class App\Models\User not found. + 💡 Learn more at https://phpstan.org/user-guide/discovering-symbols + 465 Left side of && is always true. + 472 Left side of && is always true. + ------ --------------------------------------------------------------------- + + ------ --------------------------------------------------------------------- + Line Http/Controllers/TwoFactorController.php + ------ --------------------------------------------------------------------- + 128 Class App\Models\User not found. + 💡 Learn more at https://phpstan.org/user-guide/discovering-symbols + ------ --------------------------------------------------------------------- + + ------ ----------------------------------------------------------------------- + Line Policies/BuildoraPolicy.php + ------ ----------------------------------------------------------------------- + 19 Call to method hasPermissionTo() on an unknown class App\Models\User. + 💡 Learn more at https://phpstan.org/user-guide/discovering-symbols + ------ ----------------------------------------------------------------------- + + ------ -------------------------------------------------------------- + Line Resources/BuildoraResource.php + ------ -------------------------------------------------------------- + 93 Cannot access property $displayValue on class-string|object. + ------ -------------------------------------------------------------- + + ------ -------------------------------------------------------------- + Line Resources/ModelResource.php + ------ -------------------------------------------------------------- + 324 Access to an undefined static property + static(Ginkelsoft\Buildora\Resources\ModelResource)::$model. + ------ -------------------------------------------------------------- + + ------ -------------------------------------------------------------------------------- + Line Support/NavigationBuilder.php + ------ -------------------------------------------------------------------------------- + 163 Parameter #1 $items of static method + Ginkelsoft\Buildora\Support\NavigationBuilder::filterNavigationByPermissions() + expects array, array, mixed> given. + 226 Method + Ginkelsoft\Buildora\Support\NavigationBuilder::filterNavigationByPermissions() + should return array but returns array. + ------ -------------------------------------------------------------------------------- + + ------ ------------------------------------------------------------------ + Line Support/UrlBuilder.php + ------ ------------------------------------------------------------------ + 33 Deprecated in PHP 8.4: Parameter #3 $item (object) is implicitly + nullable via default value null. + 57 Deprecated in PHP 8.4: Parameter #2 $item (object) is implicitly + nullable via default value null. + ------ ------------------------------------------------------------------ + + ------ ------------------------------------------------------------------- + Line View/Components/BuildoraGuestLayout.php + ------ ------------------------------------------------------------------- + 34 Method + Ginkelsoft\Buildora\View\Components\BuildoraGuestLayout::render() + should return Illuminate\View\View but returns + Illuminate\Contracts\View\View. + ------ ------------------------------------------------------------------- + + ------ --------------------------------------------------------------------- + Line View/Components/BuildoraLayout.php + ------ --------------------------------------------------------------------- + 34 Method Ginkelsoft\Buildora\View\Components\BuildoraLayout::render() + should return Illuminate\View\View but returns + Illuminate\Contracts\View\View. + ------ --------------------------------------------------------------------- + + ------ ------------------------------------------------------------------ + Line View/Components/Button/Back.php + ------ ------------------------------------------------------------------ + 17 Method Ginkelsoft\Buildora\View\Components\Button\Back::render() + should return Illuminate\View\View but returns + Illuminate\Contracts\View\View. + ------ ------------------------------------------------------------------ + + ------ ------------------------------------------------------------------ + Line View/Components/Button/Save.php + ------ ------------------------------------------------------------------ + 34 Method Ginkelsoft\Buildora\View\Components\Button\Save::render() + should return Illuminate\View\View but returns + Illuminate\Contracts\View\View. + ------ ------------------------------------------------------------------ + + ------ ------------------------------------------------------------------ + Line Widgets/BuildoraWidget.php + ------ ------------------------------------------------------------------ + 53 Method Ginkelsoft\Buildora\Widgets\BuildoraWidget::view() should + return Illuminate\View\View but returns + Illuminate\Contracts\View\View. + ------ ------------------------------------------------------------------ + + [ERROR] Found 59 errors + diff --git a/.zyra/logs/phpunit.log b/.zyra/logs/phpunit.log new file mode 100644 index 0000000..3c6185c --- /dev/null +++ b/.zyra/logs/phpunit.log @@ -0,0 +1,58 @@ +PHPUnit 11.5.56 by Sebastian Bergmann and contributors. + +Runtime: PHP 8.4.24 +Configuration: /app/werkplaats/8993c293-a2e7-47ed-8820-9732a9962da1/phpunit.xml.dist + +....................................... 39 / 39 (100%) + +Time: 00:00.182, Memory: 38.00 MB + +Column Builder (Ginkelsoft\Buildora\Tests\Unit\Datatable\ColumnBuilder) + ✔ Het bouwt alleen de zichtbare kolommen op + ✔ Een tweede build voor dezelfde resource class roept definefields niet opnieuw aan + ✔ Verschillende resource classes hebben hun eigen cache entry + +Currency Field (Ginkelsoft\Buildora\Tests\Unit\Fields\CurrencyField) + ✔ It formats a float value correctly + ✔ It formats an integer value correctly + ✔ It returns a dash for a null value + ✔ It does not crash for a well formed numeric string from a decimal column + ✔ It should return a dash instead of crashing for an empty string value + ✔ It should not crash for a non numeric string value + +Field Contract (Ginkelsoft\Buildora\Tests\Unit\Fields\FieldContract) + ✔ Has one field make geeft een has one field instance terug + ✔ View field make leidt label af uit de naam als geen label is opgegeven + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\AsyncBelongsToField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\BelongsToField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\BelongsToManyField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\BooleanField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\CheckboxListField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\CurrencyField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\DateField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\DateTimeField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\DisplayField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\EditorField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\EmailField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\FileField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\HasManyField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\HasOneField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\IDField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\JsonField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\NumberField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\PasswordField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\RelationLinkField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\RichTextField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\SelectField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\TextField" + ✔ Elk fieldtype geeft zijn eigen klasse terug via make with data set "Ginkelsoft\Buildora\Fields\Types\ViewField" + +Text Field (Ginkelsoft\Buildora\Tests\Unit\Fields\TextField) + ✔ It can create a text field + ✔ It can mark field as sortable + ✔ It can mark field as readonly + ✔ It can set help text + ✔ It generates label from field name when not provided + +OK, but there were issues! +Tests: 39, Assertions: 48, PHPUnit Deprecations: 17. diff --git a/.zyra/logs/proef.log b/.zyra/logs/proef.log new file mode 100644 index 0000000..3595498 --- /dev/null +++ b/.zyra/logs/proef.log @@ -0,0 +1,22 @@ +==> Composer-dependencies installeren +Installing dependencies from lock file (including require-dev) +Verifying lock file contents can be installed on current platform. +Nothing to install, update or remove +Generating optimized autoload files +Class App\View\Components\BuildoraGlobalSearch located in ./src/View/Components/BuildoraGlobalSearch.php does not comply with psr-4 autoloading standard (rule: Ginkelsoft\Buildora\ => ./src). Skipping. +109 packages you are using are looking for funding. +Use the `composer fund` command to find out more! +==> Testbench-database (sqlite) klaarzetten + File [@laravel/database/database.sqlite] already exists ............ SKIPPED +==> Migraties draaien (inclusief Buildora's eigen migraties) + + INFO Nothing to migrate. + +==> Server starten op 0.0.0.0:8099 + Open na het starten: http://localhost:8099/buildora/install + + INFO Server running on [http://0.0.0.0:8099]. + + Press Ctrl+C to stop the server + + 2026-09-03 11:11:01 /buildora/install ............................ ~ 0.68ms