1 | <?php |
||
16 | final class Folder |
||
17 | { |
||
18 | /** @var Filesystem */ |
||
19 | private $fs; |
||
|
|||
20 | /** @var FilesystemPath */ |
||
21 | private $folder; |
||
22 | |||
23 | /** |
||
24 | * @param string $folderPath |
||
25 | */ |
||
26 | 12 | public function __construct($folderPath) |
|
36 | |||
37 | public function __toString() |
||
41 | |||
42 | /** |
||
43 | * Set a base folder that will be prefixed before all file writes and copies. |
||
44 | * |
||
45 | * @param string $folderName |
||
46 | * |
||
47 | * @since 0.1.0 |
||
48 | */ |
||
49 | public function setTargetDirectory($folderName) |
||
58 | |||
59 | /** |
||
60 | * Copy a file from an absolute file to a path relative to the Folder's location. |
||
61 | * |
||
62 | * @param string $absolutePath The absolute path of the file |
||
63 | * @param string $targetPath The relative file path to the Folder's location |
||
64 | * |
||
65 | * @since 0.1.0 |
||
66 | */ |
||
67 | public function copyFile($absolutePath, $targetPath) |
||
73 | |||
74 | /** |
||
75 | * Write a file with the specified content. |
||
76 | * |
||
77 | * @param string $relativePath The file path relative to this Folder's location |
||
78 | * @param string $content The content that will be written to the file |
||
79 | * |
||
80 | * @since 0.1.0 |
||
81 | * |
||
82 | * @return File |
||
83 | */ |
||
84 | 12 | public function writeFile($relativePath, $content) |
|
98 | } |
||
99 |
Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.