Skip to content

Commit f646b9c

Browse files
committed
docs: update sample code coding style
1 parent 775f50c commit f646b9c

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

user_guide_src/source/libraries/files.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,17 @@ Moving Files
9696
Each file can be moved to its new location with the aptly named ``move()`` method. This takes the directory to move
9797
the file to as the first parameter::
9898

99-
$file->move(WRITEPATH.'uploads');
99+
$file->move(WRITEPATH . 'uploads');
100100

101101
By default, the original filename was used. You can specify a new filename by passing it as the second parameter::
102102

103103
$newName = $file->getRandomName();
104-
$file->move(WRITEPATH.'uploads', $newName);
104+
$file->move(WRITEPATH . 'uploads', $newName);
105105

106106
The move() method returns a new File instance that for the relocated file, so you must capture the result if the
107107
resulting location is needed::
108108

109-
$file = $file->move(WRITEPATH.'uploads');
109+
$file = $file->move(WRITEPATH . 'uploads');
110110

111111
****************
112112
File Collections
@@ -136,8 +136,7 @@ When your collection is complete, you can use ``get()`` to retrieve the final li
136136
echo 'My files: ' . implode(PHP_EOL, $files->get());
137137
echo 'I have ' . count($files) . ' files!';
138138

139-
foreach ($files as $file)
140-
{
139+
foreach ($files as $file) {
141140
echo 'Moving ' . $file->getBasename() . ', ' . $file->getSizeByUnit('mb');
142141
$file->move(WRITABLE . $file->getRandomName());
143142
}

0 commit comments

Comments
 (0)