49
49
50
50
use Platine \Filesystem \Adapter \AdapterInterface ;
51
51
use Platine \Filesystem \Adapter \Local \Exception \FilesystemException ;
52
+ use Platine \Filesystem \DirectoryInterface ;
53
+ use Platine \Filesystem \FileInterface ;
52
54
use Platine \Filesystem \FilesystemInterface ;
53
55
use Platine \Stdlib \Helper \Path ;
54
56
55
57
56
58
/**
57
- * Class AbstractLocal
59
+ * @class AbstractLocal
58
60
* @package Platine\Filesystem\Adapter\Local
59
61
*/
60
62
abstract class AbstractLocal implements FilesystemInterface
@@ -133,7 +135,7 @@ public function getOriginalPath(): string
133
135
/**
134
136
* {@inheritdoc}
135
137
*/
136
- public function moveTo ($ directory )
138
+ public function moveTo (string | DirectoryInterface $ directory ): FileInterface | DirectoryInterface
137
139
{
138
140
$ dest = $ this ->copyTo ($ directory );
139
141
$ dest ->touch ($ this ->getMtime ());
@@ -145,7 +147,7 @@ public function moveTo($directory)
145
147
/**
146
148
* {@inheritdoc}
147
149
*/
148
- public function chmod (int $ mode )
150
+ public function chmod (int $ mode ): self
149
151
{
150
152
chmod ($ this ->path , $ mode );
151
153
@@ -244,7 +246,7 @@ public function isWritable(): bool
244
246
/**
245
247
* {@inheritdoc}
246
248
*/
247
- public function rename (string $ newPath )
249
+ public function rename (string $ newPath ): self
248
250
{
249
251
$ normalizedNewPath = rtrim (Path::normalizePathDS ($ newPath ), '\\/ ' );
250
252
if (strpos ($ normalizedNewPath , DIRECTORY_SEPARATOR ) === false ) {
@@ -264,7 +266,7 @@ public function rename(string $newPath)
264
266
/**
265
267
* {@inheritdoc}
266
268
*/
267
- public function touch (int $ time )
269
+ public function touch (int $ time ): self
268
270
{
269
271
touch ($ this ->path , $ time );
270
272
0 commit comments