Skip to content

Commit 05a902c

Browse files
committed
Fixes issues according to insights.
1 parent b2d63c1 commit 05a902c

File tree

8 files changed

+4
-31
lines changed

8 files changed

+4
-31
lines changed

src/VCR/LibraryHooks/CurlRunkit.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace VCR\LibraryHooks;
44

5-
use VCR\Configuration;
65
use VCR\Request;
76
use VCR\Response;
87
use VCR\Assertion;
@@ -132,15 +131,13 @@ public static function multiAddHandle($mh, $ch)
132131
} else {
133132
self::$multiHandles[(int) $mh] = array((int) $ch);
134133
}
135-
// return \curl_multi_add_handle_original($mh, $ch);
136134
}
137135

138136
public static function multiRemoveHandle($mh, $ch)
139137
{
140138
if (isset(self::$multiHandles[(int) $mh][(int) $ch])) {
141139
unset(self::$multiHandles[(int) $mh][(int) $ch]);
142140
}
143-
// return \curl_multi_remove_handle_original($mh, $ch);
144141
}
145142

146143
public static function multiExec($mh, &$still_running)
@@ -153,7 +150,6 @@ public static function multiExec($mh, &$still_running)
153150
}
154151
}
155152
}
156-
// return \curl_multi_exec($mh, $still_running);
157153
return CURLM_OK;
158154
}
159155

src/VCR/LibraryHooks/Soap.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
namespace VCR\LibraryHooks;
44

55
use VCR\Assertion;
6-
use VCR\Configuration;
76
use VCR\LibraryHooks\LibraryHooksException;
87
use VCR\Request;
9-
use VCR\Response;
108
use VCR\Util\StreamProcessor;
119

1210
/**

src/VCR/LibraryHooks/StreamWrapper.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace VCR\LibraryHooks;
44

5-
use VCR\Configuration;
65
use VCR\Request;
76
use VCR\Response;
87
use VCR\Assertion;

src/VCR/Storage/Json.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class Json implements StorageInterface
1616

1717
public function __construct($filePath)
1818
{
19-
// Todo: should this be automatically created?
2019
if (!file_exists($filePath)) {
2120
file_put_contents($filePath, '[]');
2221
}
@@ -42,10 +41,6 @@ public function storeRecording(array $recording)
4241
public function current()
4342
{
4443
return $this->currentJson;
45-
// $firstChar = fgetc($this->handle);
46-
// if ($firstChar !== '[') {
47-
// throw new \InvalidArgumentException('File has to start with [, like a json array.');
48-
// }
4944
}
5045

5146
public function key()

src/VCR/Util/CurlHelper.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function ($curlInfo) use (&$info, $response) {
8383

8484
$constants = get_defined_constants(true);
8585
$constantNames = array_flip($constants['curl']);
86-
die("Todo: {$constantNames[$option]} ({$option}) ");
86+
throw new \BadMethodCallException("Not implemented: {$constantNames[$option]} ({$option}) ");
8787
}
8888

8989
public static function setCurlOptionOnRequest(Request $request, $option, $value)
@@ -122,18 +122,11 @@ public static function setCurlOptionOnRequest(Request $request, $option, $value)
122122
}
123123
$request->addHeaders($headers);
124124
break;
125-
case CURLOPT_FILE:
126-
$additionalCurlOpts[CURLOPT_FILE] = $value;
127-
break;
128125
case CURLOPT_WRITEFUNCTION:
129126
case CURLOPT_HEADERFUNCTION:
130127
// Ignore writer and header functions
131128
break;
132129
default:
133-
$constants = get_defined_constants(true);
134-
$constantNames = array_flip($constants['curl']);
135-
// TODO: Handle all missing curl options
136-
// var_dump("Todo: {$constantNames[$option]} ({$option}): {$value}");
137130
$request->getCurlOptions()->set($option, $value);
138131
break;
139132
}

src/VCR/Util/Soap/SoapClient.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
namespace VCR\Util\Soap;
44

5-
65
use VCR\LibraryHooks\LibraryHookInterface;
76
use VCR\LibraryHooks\LibraryHooksException;
8-
use VCR\Request;
97
use VCR\VCRFactory;
108

119
class SoapClient extends \SoapClient

src/VCR/Util/StreamProcessor.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,6 @@ protected function isBlacklisted($uri)
109109
/**
110110
* Determines that the provided uri leads to a PHP file.
111111
*
112-
* @todo What about PHP files with extensions:
113-
* - .inc
114-
* - .php(\d)*
115-
* - ...
116-
*
117112
* @param string $uri
118113
*
119114
* @return bool
@@ -187,7 +182,7 @@ public function stream_tell()
187182
return ftell($this->resource);
188183
}
189184

190-
public function url_stat($path, $flags)
185+
public function url_stat($path)
191186
{
192187
$this->restore();
193188
try {
@@ -210,7 +205,7 @@ public function dir_closedir()
210205
return true;
211206
}
212207

213-
public function dir_opendir($path, $options)
208+
public function dir_opendir($path)
214209
{
215210
$this->restore();
216211
if (isset($this->context)) {
@@ -257,7 +252,7 @@ public function rename($path_from, $path_to)
257252
return $result;
258253
}
259254

260-
public function rmdir($path, $options)
255+
public function rmdir($path)
261256
{
262257
$this->restore();
263258
if (isset($this->context)) {

src/VCR/VCRFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace VCR;
44

55
use VCR\LibraryHooks\CurlRewrite;
6-
use VCR\LibraryHooks\CurlRewrite\Filter as CurlRewriteFilter;
76
use VCR\LibraryHooks\Soap;
87
use VCR\Util\StreamProcessor;
98

0 commit comments

Comments
 (0)