Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 787e71d

Browse files
committed
Merge pull request #281 from voku/small-fixes
fixed some small code-smells (reported by PhpStorm)
2 parents 00c235a + 017bf3b commit 787e71d

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

lib/Firefox/FirefoxProfile.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ public function encode() {
131131
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($extension_datas, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST);
132132
foreach ($iterator as $item) {
133133
if ($item->isDir()) {
134-
mkdir($temp_dir . DIRECTORY_SEPARATOR . $dirname . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
135-
} else {
136-
copy($item, $temp_dir . DIRECTORY_SEPARATOR . $dirname . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
137-
}
134+
mkdir($temp_dir . DIRECTORY_SEPARATOR . $dirname . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
135+
} else {
136+
copy($item, $temp_dir . DIRECTORY_SEPARATOR . $dirname . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
137+
}
138138
}
139139
}
140140

@@ -150,15 +150,18 @@ public function encode() {
150150

151151
$dir = new RecursiveDirectoryIterator($temp_dir);
152152
$files = new RecursiveIteratorIterator($dir);
153+
154+
$dir_prefix = preg_replace(
155+
'#\\\\#',
156+
'\\\\\\\\',
157+
$temp_dir.DIRECTORY_SEPARATOR
158+
);
159+
153160
foreach ($files as $name => $object) {
154161
if (is_dir($name)) {
155162
continue;
156163
}
157-
$dir_prefix = preg_replace(
158-
'#\\\\#',
159-
'\\\\\\\\',
160-
$temp_dir.DIRECTORY_SEPARATOR
161-
);
164+
162165
$path = preg_replace("#^{$dir_prefix}#", "", $name);
163166
$zip->addFile($name, $path);
164167
}

lib/Remote/Service/DriverService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function stop() {
109109
$this->process = null;
110110

111111
$checker = new URLChecker();
112-
$checker->waitUntilUnAvailable(3 * 1000, $this->url.'/shutdown');
112+
$checker->waitUntilUnavailable(3 * 1000, $this->url.'/shutdown');
113113

114114
return $this;
115115
}

tests/functional/WebDriverTestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ protected function setUp() {
4040

4141
protected function tearDown() {
4242
if ($this->driver) {
43-
$this->driver->quit();
44-
}
43+
$this->driver->quit();
44+
}
4545
}
4646

4747
/**
@@ -51,6 +51,6 @@ protected function tearDown() {
5151
* @return string
5252
*/
5353
protected function getTestPath($path) {
54-
return 'file:///'.dirname(__FILE__).'/html/'.$path;
54+
return 'file:///'.__DIR__.'/html/'.$path;
5555
}
5656
}

tests/functional/html/upload.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</head>
55
<body>
66
<form method="post" enctype="multipart/form-data">
7-
<input type="file" id="upload"></input>
7+
<input type="file" id="upload" />
88
</form>
99
</body>
1010
</html>

0 commit comments

Comments
 (0)