Skip to content

Commit

Permalink
Merge pull request #201 from yungifez/analysis-VBOGkD
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
yungifez authored Jan 5, 2023
2 parents 4ff6b8c + 59fbc41 commit 368fcef
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
9 changes: 4 additions & 5 deletions app/Http/Livewire/ShowTimetable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

namespace App\Http\Livewire;

use App\Models\Weekday;
use Livewire\Component;
use App\Models\Timetable;
use App\Models\TimetableTimeSlot;
use App\Models\Weekday;
use App\Services\Timetable\TimetableService;
use Illuminate\Console\View\Components\Warn;
use Livewire\Component;

class ShowTimetable extends Component
{
Expand All @@ -17,9 +16,9 @@ class ShowTimetable extends Component
public $customItems;

/**
* Determine if to show the timetable
* Determine if to show the timetable.
*
* @var boolean
* @var bool
*/
public bool $showDescription = true;

Expand Down
10 changes: 6 additions & 4 deletions app/Models/TimetableTimeSlot.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class TimetableTimeSlot extends Model
{
Expand All @@ -15,26 +15,28 @@ class TimetableTimeSlot extends Model
'stop_time',
'timetable_id',
];
protected $getDateFormat = "H:i";
protected $getDateFormat = 'H:i';

public function startTime(): Attribute
{
return new Attribute(
get: fn ($value) => \Carbon\Carbon::parse($value)->format($this->getDateFormat),
set: fn ($value) => $value,
);
}

public function stopTime(): Attribute
{
return new Attribute(
get: fn ($value) => \Carbon\Carbon::parse($value)->format($this->getDateFormat),
set: fn ($value) => $value,
);
}

public function name(): Attribute
{
return new Attribute(
get: fn ($value) => sprintf("%s - %s", $this->start_time,$this->stop_time),
get: fn ($value) => sprintf('%s - %s', $this->start_time, $this->stop_time),
set: fn ($value) => "$this->start_time - $this->stop_time",
);
}
Expand Down
5 changes: 2 additions & 3 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,10 @@ public function adminlte_desc()
{
$description = [];
if ($this->school) {
$description[] = $this->school->academicYear ?"Academic year: ".$this->school->academicYear->name(): "";
$description[] = $this->school->semester ?"Semester: ".$this->school->semester->name: "";
$description[] = $this->school->academicYear ? 'Academic year: '.$this->school->academicYear->name() : '';
$description[] = $this->school->semester ? 'Semester: '.$this->school->semester->name : '';
}


return $descriptionString = implode(', ', $description);
}

Expand Down
8 changes: 4 additions & 4 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public function register()
Paginator::useBootstrap();
Schema::defaultStringLength(100);
Relation::enforceMorphMap([
'subject' => "App\Models\Subject",
'custom' => "App\Models\CustomTimetableItems",
'App\Models\User' => 'App\Models\User',
'App\Models\AccountApplication' => 'App\Models\AccountApplication'
'subject' => "App\Models\Subject",
'custom' => "App\Models\CustomTimetableItems",
'App\Models\User' => 'App\Models\User',
'App\Models\AccountApplication' => 'App\Models\AccountApplication',
]);
}

Expand Down
2 changes: 1 addition & 1 deletion config/adminlte.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
'classes_content' => '',
'classes_sidebar' => env('ADMINLTE_CLASSES_SIDEBAR', 'sidebar-dark-primary elevation-4'),
'classes_sidebar_nav' => '',
'classes_topnav' => env('ADMINLTE_CLASSES_TOPNAV', 'navbar-white navbar-light'),
'classes_topnav' => env('ADMINLTE_CLASSES_TOPNAV', 'navbar-white navbar-light'),
'classes_topnav_nav' => 'navbar-expand',
'classes_topnav_container' => 'container',

Expand Down

0 comments on commit 368fcef

Please sign in to comment.