Skip to content

Commit 1e8e2a3

Browse files
Replace more docblocks by type-hints
1 parent 31c27d3 commit 1e8e2a3

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

Exception/FileNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
class FileNotFoundException extends IOException
2121
{
22-
public function __construct($message = null, $code = 0, \Exception $previous = null, $path = null)
22+
public function __construct(string $message = null, int $code = 0, \Exception $previous = null, string $path = null)
2323
{
2424
if (null === $message) {
2525
if (null === $path) {

Exception/IOException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class IOException extends \RuntimeException implements IOExceptionInterface
2222
{
2323
private $path;
2424

25-
public function __construct($message, $code = 0, \Exception $previous = null, $path = null)
25+
public function __construct(string $message, int $code = 0, \Exception $previous = null, string $path = null)
2626
{
2727
$this->path = $path;
2828

Filesystem.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -740,12 +740,8 @@ private function toIterator($files)
740740

741741
/**
742742
* Gets a 2-tuple of scheme (may be null) and hierarchical part of a filename (e.g. file:///tmp -> array(file, tmp)).
743-
*
744-
* @param string $filename The filename to be parsed
745-
*
746-
* @return array The filename scheme and hierarchical part
747743
*/
748-
private function getSchemeAndHierarchy($filename)
744+
private function getSchemeAndHierarchy(string $filename): array
749745
{
750746
$components = explode('://', $filename, 2);
751747

Tests/FilesystemTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,12 +1602,8 @@ public function testCopyShouldKeepExecutionPermission()
16021602

16031603
/**
16041604
* Normalize the given path (transform each blackslash into a real directory separator).
1605-
*
1606-
* @param string $path
1607-
*
1608-
* @return string
16091605
*/
1610-
private function normalize($path)
1606+
private function normalize(string $path): string
16111607
{
16121608
return str_replace('/', DIRECTORY_SEPARATOR, $path);
16131609
}

0 commit comments

Comments
 (0)