Skip to content

Commit

Permalink
Fix stan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jun 21, 2022
1 parent ec3cb65 commit bffeeef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
25 changes: 5 additions & 20 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ parameters:
count: 1
path: src/Listener/ViewListener.php

-
message: "#^Access to an undefined property object\\:\\:\\$params\\.$#"
count: 1
path: src/Listener/ViewListener.php

-
message: "#^Access to an undefined property object\\:\\:\\$query\\.$#"
count: 4
Expand All @@ -21,7 +16,7 @@ parameters:
path: src/Listener/ViewListener.php

-
message: "#^Cannot unset offset mixed on array\\{\\}\\.$#"
message: "#^Cannot unset offset mixed on array\\.$#"
count: 2
path: src/Listener/ViewListener.php

Expand All @@ -46,32 +41,22 @@ parameters:
path: src/Listener/ViewSearchListener.php

-
message: "#^Binary operation \"\\+\" between string and array\\{data\\-enable\\-seconds\\?\\: 'true', data\\-date\\-format\\: string, data\\-enable\\-time\\?\\: 'true', data\\-alt\\-format\\?\\: mixed, data\\-alt\\-input\\?\\: 'true', data\\-no\\-calendar\\?\\: 'true', data\\-alt\\-input\\-class\\?\\: string, class\\: array\\{'input\\-group', 'flatpickr'\\}\\} results in an error\\.$#"
count: 1
path: src/View/Widget/DateTimeWidget.php

-
message: "#^Binary operation \"\\+\\=\" between array\\<string\\>\\|string and array\\{data\\-enable\\-seconds\\?\\: 'true', data\\-date\\-format\\: string, data\\-enable\\-time\\?\\: 'true', data\\-alt\\-format\\?\\: mixed, data\\-alt\\-input\\?\\: 'true', data\\-no\\-calendar\\?\\: 'true'\\} results in an error\\.$#"
count: 1
path: src/View/Widget/DateTimeWidget.php

-
message: "#^Cannot assign offset 'class' to array\\<string\\>\\|string\\.$#"
message: "#^Binary operation \"\\+\" between string and array\\{data\\-enable\\-seconds\\?\\: 'true', data\\-date\\-format\\: string, data\\-alt\\-format\\?\\: mixed, data\\-alt\\-input\\?\\: 'true', data\\-no\\-calendar\\?\\: 'true', data\\-enable\\-time\\?\\: 'true', data\\-alt\\-input\\-class\\?\\: string, class\\: array\\{'input\\-group', 'flatpickr'\\}\\} results in an error\\.$#"
count: 1
path: src/View/Widget/DateTimeWidget.php

-
message: "#^Cannot assign offset 'datetimePicker' to array\\<string\\>\\|string\\.$#"
message: "#^Binary operation \"\\+\\=\" between array\\<string\\>\\|string and array\\{data\\-enable\\-seconds\\?\\: 'true', data\\-date\\-format\\: string, data\\-alt\\-format\\?\\: mixed, data\\-alt\\-input\\?\\: 'true', data\\-no\\-calendar\\?\\: 'true', data\\-enable\\-time\\?\\: 'true'\\} results in an error\\.$#"
count: 1
path: src/View/Widget/DateTimeWidget.php

-
message: "#^Offset 'data\\-wrap' does not exist on array\\{data\\-enable\\-seconds\\?\\: 'true', data\\-date\\-format\\: string, data\\-enable\\-time\\?\\: 'true', data\\-alt\\-format\\?\\: mixed, data\\-alt\\-input\\?\\: 'true', data\\-no\\-calendar\\?\\: 'true'\\}\\.$#"
message: "#^Offset 'data\\-wrap' does not exist on array\\{data\\-enable\\-seconds\\?\\: 'true', data\\-date\\-format\\: string, data\\-alt\\-format\\?\\: mixed, data\\-alt\\-input\\?\\: 'true', data\\-no\\-calendar\\?\\: 'true', data\\-enable\\-time\\?\\: 'true'\\}\\.$#"
count: 1
path: src/View/Widget/DateTimeWidget.php

-
message: "#^Offset 'iconClass' on array\\{data\\-enable\\-seconds\\?\\: 'true', data\\-date\\-format\\: string, data\\-enable\\-time\\?\\: 'true', data\\-alt\\-format\\?\\: mixed, data\\-alt\\-input\\?\\: 'true', data\\-no\\-calendar\\?\\: 'true'\\} in isset\\(\\) does not exist\\.$#"
message: "#^Offset 'iconClass' on array\\{data\\-enable\\-seconds\\?\\: 'true', data\\-date\\-format\\: string, data\\-alt\\-format\\?\\: mixed, data\\-alt\\-input\\?\\: 'true', data\\-no\\-calendar\\?\\: 'true', data\\-enable\\-time\\?\\: 'true'\\} in isset\\(\\) does not exist\\.$#"
count: 1
path: src/View/Widget/DateTimeWidget.php

Expand Down
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ parameters:
- src
universalObjectCratesClasses:
- Crud\Event\Subject
bootstrapFiles:
- vendor/cakephp/cakephp/src/Database/Exception/DatabaseException.php
3 changes: 1 addition & 2 deletions src/View/Widget/DateTimeWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ protected function convertPHPToDatePickerFormat(string $format): string
's' => 'S',
'A' => 'K',
];
$datePickerFormat = strtr($format, $replacements);

return $datePickerFormat;
return strtr($format, $replacements);
}
}

0 comments on commit bffeeef

Please sign in to comment.