Skip to content

Commit 5c14d91

Browse files
committed
Merge branch '4.2' into short-array-master
* 4.2: fixed CS fixed CS fixed tests fixed CS fixed CS fixed CS fixed short array CS in comments fixed CS in ExpressionLanguage fixtures fixed CS in generated files fixed CS on generated container files fixed CS on Form PHP templates fixed CS on YAML fixtures fixed fixtures switched array() to []
2 parents b12244c + 7c16ebc commit 5c14d91

File tree

4 files changed

+96
-96
lines changed

4 files changed

+96
-96
lines changed

Filesystem.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function copy($originFile, $targetFile, $overwriteNewerFiles = false)
5959
}
6060

6161
// Stream context created to allow files overwrite when using FTP stream wrapper - disabled by default
62-
if (false === $target = @fopen($targetFile, 'w', null, stream_context_create(array('ftp' => array('overwrite' => true))))) {
62+
if (false === $target = @fopen($targetFile, 'w', null, stream_context_create(['ftp' => ['overwrite' => true]]))) {
6363
throw new IOException(sprintf('Failed to copy "%s" to "%s" because target file could not be opened for writing.', $originFile, $targetFile), 0, null, $originFile);
6464
}
6565

@@ -165,7 +165,7 @@ public function remove($files)
165165
if ($files instanceof \Traversable) {
166166
$files = iterator_to_array($files, false);
167167
} elseif (!\is_array($files)) {
168-
$files = array($files);
168+
$files = [$files];
169169
}
170170
$files = array_reverse($files);
171171
foreach ($files as $file) {
@@ -282,7 +282,7 @@ public function rename($origin, $target, $overwrite = false)
282282
if (true !== @rename($origin, $target)) {
283283
if (is_dir($origin)) {
284284
// See https://bugs.php.net/bug.php?id=54097 & http://php.net/manual/en/function.rename.php#113943
285-
$this->mirror($origin, $target, null, array('override' => $overwrite, 'delete' => $overwrite));
285+
$this->mirror($origin, $target, null, ['override' => $overwrite, 'delete' => $overwrite]);
286286
$this->remove($origin);
287287

288288
return;
@@ -476,7 +476,7 @@ public function makePathRelative($endPath, $startPath)
476476
$endPathArr = explode('/', trim($endPath, '/'));
477477

478478
$normalizePathArray = function ($pathSegments) {
479-
$result = array();
479+
$result = [];
480480

481481
foreach ($pathSegments as $segment) {
482482
if ('..' === $segment) {
@@ -535,7 +535,7 @@ public function makePathRelative($endPath, $startPath)
535535
*
536536
* @throws IOException When file type is unknown
537537
*/
538-
public function mirror($originDir, $targetDir, \Traversable $iterator = null, $options = array())
538+
public function mirror($originDir, $targetDir, \Traversable $iterator = null, $options = [])
539539
{
540540
$targetDir = rtrim($targetDir, '/\\');
541541
$originDir = rtrim($originDir, '/\\');
@@ -727,17 +727,17 @@ public function appendToFile($filename, $content)
727727

728728
private function toIterable($files): iterable
729729
{
730-
return \is_array($files) || $files instanceof \Traversable ? $files : array($files);
730+
return \is_array($files) || $files instanceof \Traversable ? $files : [$files];
731731
}
732732

733733
/**
734-
* Gets a 2-tuple of scheme (may be null) and hierarchical part of a filename (e.g. file:///tmp -> array(file, tmp)).
734+
* Gets a 2-tuple of scheme (may be null) and hierarchical part of a filename (e.g. file:///tmp -> [file, tmp]).
735735
*/
736736
private function getSchemeAndHierarchy(string $filename): array
737737
{
738738
$components = explode('://', $filename, 2);
739739

740-
return 2 === \count($components) ? array($components[0], $components[1]) : array(null, $components[0]);
740+
return 2 === \count($components) ? [$components[0], $components[1]] : [null, $components[0]];
741741
}
742742

743743
private static function box($func)

0 commit comments

Comments
 (0)