From 6e46dbf3006dc24205390e91982cd4fb94a788dd Mon Sep 17 00:00:00 2001 From: Caique Bispo Date: Wed, 7 Aug 2024 20:09:22 -0300 Subject: [PATCH 1/6] Update required version php 8.3 --- composer.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 2874285..34b1364 100755 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": "^7.2|^8.0|^8.1|^8.2", + "php": "^7.2|^8.0|^8.1|^8.2|^8.3", "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0", "livewire/livewire": "^2.0" }, @@ -37,7 +37,6 @@ "scripts": { "test": "vendor/bin/phpunit", "test-coverage": "vendor/bin/phpunit --coverage-html coverage" - }, "config": { "sort-packages": true @@ -52,4 +51,4 @@ } } } -} +} \ No newline at end of file From 648558c4b3e9ede7a5d86a0331eb4ca7d67d8056 Mon Sep 17 00:00:00 2001 From: Caique Bispo Date: Wed, 7 Aug 2024 20:10:35 -0300 Subject: [PATCH 2/6] Update version laravel for 11.x --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 34b1364..2e1cce8 100755 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": "^7.2|^8.0|^8.1|^8.2|^8.3", - "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0", + "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", "livewire/livewire": "^2.0" }, "require-dev": { From 3b60e7a0892a7125ffd4296885dfd3d4ee93fb59 Mon Sep 17 00:00:00 2001 From: Caique Bispo Date: Wed, 7 Aug 2024 20:10:53 -0300 Subject: [PATCH 3/6] Update version livewire for 3.x --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2e1cce8..4d66b6e 100755 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "require": { "php": "^7.2|^8.0|^8.1|^8.2|^8.3", "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", - "livewire/livewire": "^2.0" + "livewire/livewire": "^3.0" }, "require-dev": { "orchestra/testbench": "^5.0|^6.0", From 02a59f7d0608a49eb29b210455f4e3751eb06d43 Mon Sep 17 00:00:00 2001 From: Caique Bispo Date: Wed, 7 Aug 2024 20:18:19 -0300 Subject: [PATCH 4/6] update information packge composer.json --- composer.json | 18 +++++++++--------- src/LivewireCalendarServiceProvider.php | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 4d66b6e..e8b99b0 100755 --- a/composer.json +++ b/composer.json @@ -1,17 +1,17 @@ { - "name": "asantibanez/livewire-calendar", + "name": "caiquebispo/livewire-calendar", "description": "Laravel Livewire calendar component", "keywords": [ - "asantibanez", + "caiquebispo", "livewire-calendar" ], - "homepage": "https://github.com/asantibanez/livewire-calendar", + "homepage": "https://github.com/caiquebispo/livewire-calendar", "license": "MIT", "type": "library", "authors": [ { - "name": "Andrés Santibáñez", - "email": "santibanez.andres@gmail.com", + "name": "Caique Bispo", + "email": "caiquebispo0023@gmail.com", "role": "Developer" } ], @@ -26,12 +26,12 @@ }, "autoload": { "psr-4": { - "Asantibanez\\LivewireCalendar\\": "src" + "caiquebispo\\LivewireCalendar\\": "src" } }, "autoload-dev": { "psr-4": { - "Asantibanez\\LivewireCalendar\\Tests\\": "tests" + "caiquebispo\\LivewireCalendar\\Tests\\": "tests" } }, "scripts": { @@ -44,10 +44,10 @@ "extra": { "laravel": { "providers": [ - "Asantibanez\\LivewireCalendar\\LivewireCalendarServiceProvider" + "caiquebispo\\LivewireCalendar\\LivewireCalendarServiceProvider" ], "aliases": { - "LivewireCalendar": "Asantibanez\\LivewireCalendar\\LivewireCalendarFacade" + "LivewireCalendar": "caiquebispo\\LivewireCalendar\\LivewireCalendarFacade" } } } diff --git a/src/LivewireCalendarServiceProvider.php b/src/LivewireCalendarServiceProvider.php index 291cec9..009da55 100755 --- a/src/LivewireCalendarServiceProvider.php +++ b/src/LivewireCalendarServiceProvider.php @@ -7,7 +7,7 @@ class LivewireCalendarServiceProvider extends ServiceProvider { - /** + /**git * Bootstrap the application services. */ public function boot() From a8d8d96ead3e0441bf53322bcc360174260b6b98 Mon Sep 17 00:00:00 2001 From: Caique Bispo Date: Thu, 8 Aug 2024 08:58:49 -0300 Subject: [PATCH 5/6] refactor: corrigindo namespace do projeto --- composer.json | 8 ++-- src/LivewireCalendar.php | 63 +++++++++++++------------ src/LivewireCalendarFacade.php | 4 +- src/LivewireCalendarServiceProvider.php | 6 +-- 4 files changed, 41 insertions(+), 40 deletions(-) diff --git a/composer.json b/composer.json index e8b99b0..aabd40b 100755 --- a/composer.json +++ b/composer.json @@ -26,12 +26,12 @@ }, "autoload": { "psr-4": { - "caiquebispo\\LivewireCalendar\\": "src" + "CaiqueBispo\\LivewireCalendar\\": "src" } }, "autoload-dev": { "psr-4": { - "caiquebispo\\LivewireCalendar\\Tests\\": "tests" + "CaiqueBispo\\LivewireCalendar\\Tests\\": "tests" } }, "scripts": { @@ -44,10 +44,10 @@ "extra": { "laravel": { "providers": [ - "caiquebispo\\LivewireCalendar\\LivewireCalendarServiceProvider" + "CaiqueBispo\\LivewireCalendar\\LivewireCalendarServiceProvider" ], "aliases": { - "LivewireCalendar": "caiquebispo\\LivewireCalendar\\LivewireCalendarFacade" + "LivewireCalendar": "CaiqueBispo\\LivewireCalendar\\LivewireCalendarFacade" } } } diff --git a/src/LivewireCalendar.php b/src/LivewireCalendar.php index 60f7ce9..f4c842c 100755 --- a/src/LivewireCalendar.php +++ b/src/LivewireCalendar.php @@ -1,6 +1,6 @@ 'date', ]; - public function mount($initialYear = null, - $initialMonth = null, - $weekStartsAt = null, - $calendarView = null, - $dayView = null, - $eventView = null, - $dayOfWeekView = null, - $dragAndDropClasses = null, - $beforeCalendarView = null, - $afterCalendarView = null, - $pollMillis = null, - $pollAction = null, - $dragAndDropEnabled = true, - $dayClickEnabled = true, - $eventClickEnabled = true, - $extras = []) - { + public function mount( + $initialYear = null, + $initialMonth = null, + $weekStartsAt = null, + $calendarView = null, + $dayView = null, + $eventView = null, + $dayOfWeekView = null, + $dragAndDropClasses = null, + $beforeCalendarView = null, + $afterCalendarView = null, + $pollMillis = null, + $pollAction = null, + $dragAndDropEnabled = true, + $dayClickEnabled = true, + $eventClickEnabled = true, + $extras = [] + ) { $this->weekStartsAt = $weekStartsAt ?? Carbon::SUNDAY; $this->weekEndsAt = $this->weekStartsAt == Carbon::SUNDAY ? Carbon::SATURDAY - : collect([0,1,2,3,4,5,6])->get($this->weekStartsAt + 6 - 7) - ; + : collect([0, 1, 2, 3, 4, 5, 6])->get($this->weekStartsAt + 6 - 7); $initialYear = $initialYear ?? Carbon::today()->year; $initialMonth = $initialMonth ?? Carbon::today()->month; @@ -115,13 +115,14 @@ public function afterMount($extras = []) // } - public function setupViews($calendarView = null, - $dayView = null, - $eventView = null, - $dayOfWeekView = null, - $beforeCalendarView = null, - $afterCalendarView = null) - { + public function setupViews( + $calendarView = null, + $dayView = null, + $eventView = null, + $dayOfWeekView = null, + $beforeCalendarView = null, + $afterCalendarView = null + ) { $this->calendarView = $calendarView ?? 'livewire-calendar::calendar'; $this->dayView = $dayView ?? 'livewire-calendar::day'; $this->eventView = $eventView ?? 'livewire-calendar::event'; @@ -185,7 +186,7 @@ public function monthGrid() $monthGrid = collect(); $currentDay = $firstDayOfGrid->clone(); - while(!$currentDay->greaterThan($lastDayOfGrid)) { + while (!$currentDay->greaterThan($lastDayOfGrid)) { $monthGrid->push($currentDay->clone()); $currentDay->addDay(); } @@ -198,12 +199,12 @@ public function monthGrid() return $monthGrid; } - public function events() : Collection + public function events(): Collection { return collect(); } - public function getEventsForDay($day, Collection $events) : Collection + public function getEventsForDay($day, Collection $events): Collection { return $events ->filter(function ($event) use ($day) { diff --git a/src/LivewireCalendarFacade.php b/src/LivewireCalendarFacade.php index e69f375..c2269ae 100755 --- a/src/LivewireCalendarFacade.php +++ b/src/LivewireCalendarFacade.php @@ -1,11 +1,11 @@ loadViewsFrom(__DIR__.'/../resources/views', 'livewire-calendar'); + $this->loadViewsFrom(__DIR__ . '/../resources/views', 'livewire-calendar'); if ($this->app->runningInConsole()) { $this->publishes([ - __DIR__.'/../resources/views' => $this->app->resourcePath('views/vendor/livewire-calendar'), + __DIR__ . '/../resources/views' => $this->app->resourcePath('views/vendor/livewire-calendar'), ], 'livewire-calendar'); } From 1fe7682a683a560106eb31d83dd804597fdc08e3 Mon Sep 17 00:00:00 2001 From: Caique Bispo Date: Thu, 8 Aug 2024 10:26:52 -0300 Subject: [PATCH 6/6] refactor: rodando o dum-autoload --- .phpunit.result.cache | 1 + tests/LivewireCalendarTest.php | 6 +++--- tests/TestCase.php | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 .phpunit.result.cache diff --git a/.phpunit.result.cache b/.phpunit.result.cache new file mode 100644 index 0000000..6bb75ec --- /dev/null +++ b/.phpunit.result.cache @@ -0,0 +1 @@ +{"version":1,"defects":[],"times":{"CaiqueBispo\\LivewireCalendar\\Tests\\LivewireCalendarTest::can_build_component":0.51,"CaiqueBispo\\LivewireCalendar\\Tests\\LivewireCalendarTest::can_navigate_to_next_month":0.665,"CaiqueBispo\\LivewireCalendar\\Tests\\LivewireCalendarTest::can_navigate_to_previous_month":0.135,"CaiqueBispo\\LivewireCalendar\\Tests\\LivewireCalendarTest::can_navigate_to_current_month":0.227}} \ No newline at end of file diff --git a/tests/LivewireCalendarTest.php b/tests/LivewireCalendarTest.php index c0c1f41..9c9cdd6 100755 --- a/tests/LivewireCalendarTest.php +++ b/tests/LivewireCalendarTest.php @@ -1,14 +1,14 @@ test(LivewireCalendar::class, $parameters); } diff --git a/tests/TestCase.php b/tests/TestCase.php index 14a97a4..f6c4b0f 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,8 +1,8 @@