From 680efd89918028b72c61a1fff03497d1767a9167 Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Sat, 6 Jul 2024 20:54:00 +0330 Subject: [PATCH] docs: add todo comment --- src/Abstracts/Jobs/Job.php | 4 ++++ src/Abstracts/Providers/AuthServiceProvider.php | 5 +++++ src/Services/Response.php | 2 ++ 3 files changed, 11 insertions(+) diff --git a/src/Abstracts/Jobs/Job.php b/src/Abstracts/Jobs/Job.php index 24217361..53521e41 100644 --- a/src/Abstracts/Jobs/Job.php +++ b/src/Abstracts/Jobs/Job.php @@ -8,6 +8,10 @@ use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; +// TODO: BC +// remove "implements ShouldQueue" +// from here and add let the child classes decide if they want to use the queue or not +// Also maybe move trait to the child classes, so they can decide if they want to use it or not? abstract class Job implements ShouldQueue { use Dispatchable; diff --git a/src/Abstracts/Providers/AuthServiceProvider.php b/src/Abstracts/Providers/AuthServiceProvider.php index dab1e87f..147f3b67 100644 --- a/src/Abstracts/Providers/AuthServiceProvider.php +++ b/src/Abstracts/Providers/AuthServiceProvider.php @@ -6,6 +6,11 @@ abstract class AuthServiceProvider extends LaravelAuthServiceProvider { + // TODO: BC + // https://laravel.com/docs/10.x/upgrade#register-policies + // parent::boot() should be removed from + // App\Containers\AppSection\Authentication\Providers\AuthServiceProvider::boot() + /** * The policy mappings for the application. * diff --git a/src/Services/Response.php b/src/Services/Response.php index da429c47..68003c28 100644 --- a/src/Services/Response.php +++ b/src/Services/Response.php @@ -55,6 +55,8 @@ private function defaultResourceName(): string } if (!empty($this->data) && 'collection' === $this->determineDataType($this->data)) { + // TODO: there was a problem $this->data->first() but I cant remember. It had to do with the data being an array + // also check AbstractTransformer where we also do this check and use the first item. we also have the same problem there $firstItem = $this->data->first(); if ($firstItem instanceof HasResourceKey) { return $firstItem->getResourceKey();