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/composer.json b/composer.json index 2874285..aabd40b 100755 --- a/composer.json +++ b/composer.json @@ -1,24 +1,24 @@ { - "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" } ], "require": { - "php": "^7.2|^8.0|^8.1|^8.2", - "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0", - "livewire/livewire": "^2.0" + "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": "^3.0" }, "require-dev": { "orchestra/testbench": "^5.0|^6.0", @@ -26,18 +26,17 @@ }, "autoload": { "psr-4": { - "Asantibanez\\LivewireCalendar\\": "src" + "CaiqueBispo\\LivewireCalendar\\": "src" } }, "autoload-dev": { "psr-4": { - "Asantibanez\\LivewireCalendar\\Tests\\": "tests" + "CaiqueBispo\\LivewireCalendar\\Tests\\": "tests" } }, "scripts": { "test": "vendor/bin/phpunit", "test-coverage": "vendor/bin/phpunit --coverage-html coverage" - }, "config": { "sort-packages": true @@ -45,11 +44,11 @@ "extra": { "laravel": { "providers": [ - "Asantibanez\\LivewireCalendar\\LivewireCalendarServiceProvider" + "CaiqueBispo\\LivewireCalendar\\LivewireCalendarServiceProvider" ], "aliases": { - "LivewireCalendar": "Asantibanez\\LivewireCalendar\\LivewireCalendarFacade" + "LivewireCalendar": "CaiqueBispo\\LivewireCalendar\\LivewireCalendarFacade" } } } -} +} \ No newline at end of file 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'); } 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 @@