fixbug get methods

This commit is contained in:
Nasser committed 2020-03-05 19:31:37 +03:30
1 parent 2fec7f078a
commit c62f2a6c94
2 files changed
+7 -5

No files matched your search

+2 -2
View File
@@ -12,8 +12,8 @@
"require": {
"php": ">=5.5",
"hekmatinasser/notowo": "^1.0",
"illuminate/validation": "^5|^6",
"illuminate/support": "^5|^6"
"illuminate/validation": "^5|^6|^7",
"illuminate/support": "^5|^6|^7"
},
"require-dev" : {
"phpunit/phpunit": "7.2.*",
+5 -3
View File
@@ -636,8 +636,7 @@ class Verta extends DateTime {
*/
public function __get($name)
{
switch (true) {
case array_key_exists($name, $formats = array(
static $formats = array(
'year' => 'Y',
'month' => 'n',
'day' => 'j',
@@ -650,7 +649,10 @@ class Verta extends DateTime {
'weekOfYear' => 'W',
'daysInMonth' => 't',
'timestamp' => 'U',
)):
);
switch (true) {
case isset($formats[$name]):
return (int) $this->format($formats[$name]);
case $name === 'quarter':