Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update package #60

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -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}}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should remove this from the PR.

27 changes: 13 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,54 @@
{
"name": "asantibanez/livewire-calendar",
"name": "caiquebispo/livewire-calendar",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're renaming the package to your fork? ...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely not mergeable!

"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",
"phpunit/phpunit": "^8.0|^9.0"
},
"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
},
"extra": {
"laravel": {
"providers": [
"Asantibanez\\LivewireCalendar\\LivewireCalendarServiceProvider"
"CaiqueBispo\\LivewireCalendar\\LivewireCalendarServiceProvider"
],
"aliases": {
"LivewireCalendar": "Asantibanez\\LivewireCalendar\\LivewireCalendarFacade"
"LivewireCalendar": "CaiqueBispo\\LivewireCalendar\\LivewireCalendarFacade"
}
}
}
}
}
63 changes: 32 additions & 31 deletions src/LivewireCalendar.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Asantibanez\LivewireCalendar;
namespace CaiqueBispo\LivewireCalendar;

use Carbon\Carbon;
use Exception;
Expand All @@ -11,7 +11,7 @@

/**
* Class LivewireCalendar
* @package Asantibanez\LivewireCalendar
* @package CaiqueBispo\LivewireCalendar
* @property Carbon $startsAt
* @property Carbon $endsAt
* @property Carbon $gridStartsAt
Expand Down Expand Up @@ -66,28 +66,28 @@ class LivewireCalendar extends Component
'gridEndsAt' => '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;
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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();
}
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/LivewireCalendarFacade.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Asantibanez\LivewireCalendar;
namespace CaiqueBispo\LivewireCalendar;

use Illuminate\Support\Facades\Facade;

/**
* @see \Asantibanez\LivewireCalendar\Skeleton\SkeletonClass
* @see \CaiqueBispo\LivewireCalendar\Skeleton\SkeletonClass
*/
class LivewireCalendarFacade extends Facade
{
Expand Down
8 changes: 4 additions & 4 deletions src/LivewireCalendarServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<?php

namespace Asantibanez\LivewireCalendar;
namespace CaiqueBispo\LivewireCalendar;

use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;

class LivewireCalendarServiceProvider extends ServiceProvider
{
/**
/**git
* Bootstrap the application services.
*/
public function boot()
{
$this->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');
}

Expand Down
6 changes: 3 additions & 3 deletions tests/LivewireCalendarTest.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace Asantibanez\LivewireCalendar\Tests;
namespace CaiqueBispo\LivewireCalendar\Tests;

use Asantibanez\LivewireCalendar\LivewireCalendar;
use CaiqueBispo\LivewireCalendar\LivewireCalendar;
use Livewire\LivewireManager;
use Livewire\Testing\TestableLivewire;

class LivewireCalendarTest extends TestCase
{
private function createComponent($parameters = []) : TestableLivewire
private function createComponent($parameters = []): TestableLivewire
{
return app(LivewireManager::class)->test(LivewireCalendar::class, $parameters);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Asantibanez\LivewireCalendar\Tests;
namespace CaiqueBispo\LivewireCalendar\Tests;

use Asantibanez\LivewireCalendar\LivewireCalendarServiceProvider;
use CaiqueBispo\LivewireCalendar\LivewireCalendarServiceProvider;
use Livewire\LivewireServiceProvider;
use Orchestra\Testbench\TestCase as BaseCase;

Expand Down