Skip to content

Commit a492322

Browse files
committed
Improved CakePHP 5.3 compatibility
1 parent 5cbb57f commit a492322

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/FilePathProcessor/CloudProcessor.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace FileUploader\FilePathProcessor;
55

66
use Cake\Datasource\EntityInterface;
7-
use Cake\I18n\FrozenTime;
7+
use Cake\I18n\DateTime;
88
use Cake\ORM\Table;
99
use Cake\Utility\Hash;
1010
use Cake\Utility\Text;
@@ -62,9 +62,9 @@ class CloudProcessor implements FilePathProcessorInterface
6262
protected string $directory;
6363

6464
/**
65-
* @var \Cake\I18n\FrozenTime The current time
65+
* @var \Cake\I18n\DateTime The current time
6666
*/
67-
private FrozenTime $currentTime;
67+
private DateTime $currentTime;
6868

6969
/**
7070
* @var float The current time in milliseconds
@@ -86,7 +86,7 @@ public function __construct(
8686
$this->uploadedFile = $data;
8787
$this->field = $field;
8888
$this->settings = $settings;
89-
$this->currentTime = new FrozenTime(null, 'GMT');
89+
$this->currentTime = new DateTime('now', 'GMT');
9090
$this->currentTimeInMilliseconds = floor(microtime(true) * 1000);
9191
usleep(1000);
9292
}

src/FilePathProcessor/DefaultProcessor.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use Cake\Core\Configure;
77
use Cake\Datasource\EntityInterface;
8-
use Cake\I18n\FrozenTime;
8+
use Cake\I18n\DateTime;
99
use Cake\ORM\Table;
1010
use Cake\Utility\Text;
1111
use Psr\Http\Message\UploadedFileInterface;
@@ -63,9 +63,9 @@ class DefaultProcessor implements FilePathProcessorInterface
6363
protected string $directory;
6464

6565
/**
66-
* @var \Cake\I18n\FrozenTime The current time
66+
* @var \Cake\I18n\DateTime The current time
6767
*/
68-
private FrozenTime $currentTime;
68+
private DateTime $currentTime;
6969

7070
/**
7171
* @var float The current time in milliseconds
@@ -87,7 +87,7 @@ public function __construct(
8787
$this->uploadedFile = $data;
8888
$this->field = $field;
8989
$this->settings = $settings;
90-
$this->currentTime = new FrozenTime(null, 'GMT');
90+
$this->currentTime = new DateTime('now', 'GMT');
9191
$this->currentTimeInMilliseconds = floor(microtime(true) * 1000);
9292
usleep(1000);
9393
}

src/Plugin.php renamed to src/FileUploaderPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/**
1212
* Plugin for CakephpImageUploader
1313
*/
14-
class Plugin extends BasePlugin
14+
class FileUploaderPlugin extends BasePlugin
1515
{
1616
/**
1717
* Load all the plugin configuration and bootstrap logic.

src/Model/Entity/UploadedFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* @property string $origin
2222
* @property array $metadata
2323
* @property string|null $cloud_provider
24-
* @property \Cake\I18n\FrozenTime $created
24+
* @property \Cake\I18n\DateTime $created
2525
* @property string $full_path
2626
* @property bool $is_local_file
2727
* @property string $full_filename

0 commit comments

Comments
 (0)