Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8e20e04

Browse filesBrowse files
committed
Fixed CS
1 parent db12c2c commit 8e20e04
Copy full SHA for 8e20e04

File tree

Expand file treeCollapse file tree

3 files changed

+29
-33
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+29
-33
lines changed

‎src/Symfony/Component/Finder/Finder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Finder.php
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,19 +578,15 @@ private function searchInDirectory($dir)
578578
}
579579

580580
if (Iterator\RecursiveDirectoryFtpIterator::isValidFtpUrl($dir)) {
581-
582581
$iterator = new \RecursiveIteratorIterator(
583582
new Iterator\RecursiveDirectoryFtpIterator($dir),
584583
\RecursiveIteratorIterator::SELF_FIRST
585584
);
586-
587585
} else {
588-
589586
$iterator = new \RecursiveIteratorIterator(
590587
new Iterator\RecursiveDirectoryIterator($dir, $flags),
591588
\RecursiveIteratorIterator::SELF_FIRST
592589
);
593-
594590
}
595591

596592
if ($this->depths) {

‎src/Symfony/Component/Finder/FtpSplFileInfo.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/FtpSplFileInfo.php
+27-26Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919
*/
2020
class FtpSplFileInfo extends \SplFileInfo
2121
{
22-
const TYPE_UNKNOWN = 1;
22+
23+
const TYPE_UNKNOWN = 1;
2324
const TYPE_DIRECTORY = 2;
24-
const TYPE_FILE = 3;
25-
const TYPE_LINK = 4;
25+
const TYPE_FILE = 3;
26+
const TYPE_LINK = 4;
2627

27-
private $type = self::TYPE_DIRECTORY;
28+
private $type = self::TYPE_DIRECTORY;
2829

2930
/**
3031
* The name of a directory is always .:
@@ -39,7 +40,7 @@ class FtpSplFileInfo extends \SplFileInfo
3940
* Filename: sit.txt
4041
*
4142
*/
42-
private $path = '/';
43+
private $path = '/';
4344
private $filename = '.';
4445

4546
/**
@@ -59,11 +60,11 @@ public function __construct($item = '/', $type = self::TYPE_DIRECTORY)
5960

6061
if ($type === self::TYPE_DIRECTORY) {
6162
$this->filename = '.';
62-
$this->path = $item;
63+
$this->path = $item;
6364
} else if ($type === self::TYPE_FILE) {
6465
$tmp = self::parseFile($item);
6566
$this->filename = $tmp['filename'];
66-
$this->path = $tmp['path'];
67+
$this->path = $tmp['path'];
6768
}
6869
parent::__construct($this->getFullFilename());
6970
}
@@ -76,7 +77,7 @@ public function __construct($item = '/', $type = self::TYPE_DIRECTORY)
7677
*/
7778
public function isDir()
7879
{
79-
return $this->type === self::TYPE_DIRECTORY;
80+
return self::TYPE_DIRECTORY === $this->type;
8081
}
8182

8283
/**
@@ -87,7 +88,7 @@ public function isDir()
8788
*/
8889
public function isFile()
8990
{
90-
return $this->type === self::TYPE_FILE;
91+
return self::TYPE_FILE === $this->type;
9192
}
9293

9394
/**
@@ -107,16 +108,15 @@ public function getFullFilename()
107108
{
108109
if ($this->isDir()) {
109110
return $this->getPath();
110-
} else {
111-
if ($this->path === '/' && $this->filename === '.') {
112-
return '/';
113-
}
114-
if ($this->path === '/') {
115-
return '/' . $this->filename;
116-
} else {
117-
return $this->path . '/' . $this->filename;
118-
}
119111
}
112+
if ($this->path === '/' && $this->filename === '.') {
113+
return '/';
114+
}
115+
if ($this->path === '/') {
116+
return '/' . $this->filename;
117+
}
118+
119+
return $this->path . '/' . $this->filename;
120120
}
121121

122122
/**
@@ -142,9 +142,9 @@ public function getItemname($item)
142142
{
143143
if ($this->path === '/') {
144144
return '/' . $item;
145-
} else {
146-
return $this->path . '/' . $item;
147145
}
146+
147+
return $this->path . '/' . $item;
148148
}
149149

150150
/**
@@ -165,7 +165,7 @@ public function getFilename()
165165
*/
166166
public function setType($type)
167167
{
168-
$this->type = $type;
168+
$this->type = $type;
169169
}
170170

171171
/**
@@ -175,7 +175,7 @@ public function setType($type)
175175
*/
176176
public function getType()
177177
{
178-
return $this->type;
178+
return $this->type;
179179
}
180180

181181
/**
@@ -185,14 +185,15 @@ public function getType()
185185
*/
186186
public function getPath()
187187
{
188-
return $this->path;
188+
return $this->path;
189189
}
190190

191191
/**
192192
* Parses the output of ftp_rawlist to get the type:
193193
* d (directory), - (file), l (link)
194194
*
195195
* @param string $item the output of ftp raw list
196+
*
196197
* @return type
197198
*/
198199
public static function parseRawListItem($item)
@@ -244,15 +245,15 @@ public static function parseFile($file = '/')
244245
throw new \InvalidArgumentException(sprintf('The name must contain at least two characters. It doesnt: "%s"', $file));
245246
}
246247

247-
$found = strrpos($file, '/');
248+
$found = strrpos($file, '/');
248249
$tmpPath = substr($file, 0, $found);
249250
$tmpName = substr($file, $found + 1);
250251
if ($tmpPath === '') {
251252
$tmpPath = '/';
252253
}
253254
return array(
254-
'filename' => $tmpName,
255-
'path' => $tmpPath
255+
'filename' => $tmpName,
256+
'path' => $tmpPath
256257
);
257258
}
258259

‎src/Symfony/Component/Finder/Iterator/Ftp.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Iterator/Ftp.php
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ public function connectAndLogin()
4545

4646
if ((!$ftpConnId) || (!$loginResult)) {
4747
throw new \RuntimeException('Cannnot ftp_connect() or ftp_login()');
48-
} else {
49-
$this->ftpResource = $ftpConnId;
50-
ftp_pasv($this->ftpResource, true);
5148
}
49+
$this->ftpResource = $ftpConnId;
50+
ftp_pasv($this->ftpResource, true);
5251
}
5352
}
5453

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.