FIX: null cases & method name
This commit is contained in:
@ -4,7 +4,7 @@ namespace ProVM\Common\Define\Model;
|
||||
use Carbon\Carbon;
|
||||
|
||||
trait Date {
|
||||
public function date(\DateTime $date) {
|
||||
public function date(\DateTime $date = null) {
|
||||
if ($date === null) {
|
||||
return Carbon::parse($this->date);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ namespace ProVM\Common\Define\Model;
|
||||
use Carbon\Carbon;
|
||||
|
||||
trait DateTime {
|
||||
public function date(\DateTime $date_time) {
|
||||
public function dateTime(\DateTime $date_time = null) {
|
||||
if ($date_time === null) {
|
||||
return Carbon::parse($this->date_time);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ namespace ProVM\Common\Define\Model;
|
||||
use Carbon\Carbon;
|
||||
|
||||
trait Time {
|
||||
public function date(\DateTime $time) {
|
||||
public function time(\DateTime $time = null) {
|
||||
if ($time === null) {
|
||||
return Carbon::parse($this->time);
|
||||
}
|
||||
|
Reference in New Issue
Block a user