Skip to content

Commit

Permalink
Merge pull request #1270 from it-novum/ITC-2648
Browse files Browse the repository at this point in the history
fixed deprecations for CakePHP 4.3.0
  • Loading branch information
ibering authored Nov 12, 2021
2 parents c01a6b3 + 67929d8 commit 3eb9cc3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
12 changes: 4 additions & 8 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,10 @@
* locale specific date formats. For details see
* @link https://book.cakephp.org/4/en/core-libraries/internationalization-and-localization.html#parsing-localized-datetime-data
*/
TypeFactory::build('time')
->useImmutable();
TypeFactory::build('date')
->useImmutable();
TypeFactory::build('datetime')
->useImmutable();
TypeFactory::build('timestamp')
->useImmutable();
TypeFactory::build('time');
TypeFactory::build('date');
TypeFactory::build('datetime');
TypeFactory::build('timestamp');

/*
* Custom Inflector rules, can be set to correctly pluralize or singularize
Expand Down
5 changes: 3 additions & 2 deletions plugins/Statusengine2Module/config/routes.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php
use Cake\Routing\RouteBuilder;
use Cake\Routing\Router;
use Cake\Routing\Route\DashedRoute;

Router::plugin(
/** @var \Cake\Routing\RouteBuilder $routes */

$routes->plugin(
'Statusengine2Module',
['path' => '/statusengine2-module'],
function (RouteBuilder $routes) {
Expand Down
1 change: 1 addition & 0 deletions src/Controller/HostsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ public function index() {
->where([
'Services.host_id' => $host['Host']['id']
])
->all()
->toList();

$servicestatus = $ServicestatusTable->byUuids($serviceUuids, $ServicestatusFields);
Expand Down
9 changes: 5 additions & 4 deletions src/itnovum/openITCOCKPIT/Core/Views/UserTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
namespace itnovum\openITCOCKPIT\Core\Views;


use Cake\I18n\Time;
use Cake\I18n\FrozenTime;
//use Cake\I18n\Time;
use DateTime;
use itnovum\openITCOCKPIT\Core\ValueObjects\User;

Expand Down Expand Up @@ -74,7 +75,7 @@ public function format($t_time) {
$t_time = 0;
}

$Time = new Time($t_time);
$Time = new FrozenTime($t_time);
$Time->setTimezone(new \DateTimeZone($this->timezone));

return $Time->format($this->format);
Expand All @@ -93,7 +94,7 @@ public function customFormat($format, $t_time) {
$t_time = 0;
}

$Time = new Time($t_time);
$Time = new FrozenTime($t_time);
$Time->setTimezone(new \DateTimeZone($this->timezone));

return $Time->format($format);
Expand Down Expand Up @@ -190,7 +191,7 @@ public function timeAgoInWords($t_time, $options = []) {
$t_time = 0;
}

$Time = new Time($t_time);
$Time = new FrozenTime($t_time);
$Time->setTimezone(new \DateTimeZone($this->timezone));

return $Time->timeAgoInWords($options);
Expand Down

0 comments on commit 3eb9cc3

Please sign in to comment.