Skip to content

Commit 160ebb8

Browse files
committed
Pull request #117: NETCURL-347
Merge in LIB/tornelib-php-netcurl from NETCURL-347 to master * commit '22f41949c220146cd422c9440ace67db74dc6556': NETCURL-347
2 parents 680afa6 + 22f4194 commit 160ebb8

File tree

5 files changed

+1
-69
lines changed

5 files changed

+1
-69
lines changed

src/Module/Config/WrapperConfig.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -533,23 +533,6 @@ public function resetStreamData()
533533
return $this;
534534
}
535535

536-
/**
537-
* Returns compatibility functions from for example NetCurl 6.0.
538-
* @return array
539-
* @since 6.1.2
540-
* @noinspection PhpFullyQualifiedNameUsageInspection
541-
*/
542-
public function getCompatibilityMethods()
543-
{
544-
$return = [];
545-
if (class_exists('\TorneLIB\Compatibility\NetCurl\Methods')) {
546-
/** @noinspection PhpUndefinedClassInspection */
547-
$return = \TorneLIB\Compatibility\NetCurl\Methods::getCompatibilityMethods();
548-
}
549-
550-
return $return;
551-
}
552-
553536
/**
554537
* Throw on any code that matches the store throwableHttpCode (use with setThrowableHttpCodes())
555538
*

src/Module/Network/NetWrapper.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,6 @@ public function getCurrentWrapperClass($short = false)
384384
*/
385385
public function __call($name, $arguments)
386386
{
387-
$compatibilityMethods = $this->CONFIG->getCompatibilityMethods();
388-
if (isset($compatibilityMethods[$name])) {
389-
$name = $compatibilityMethods[$name];
390-
}
391-
392387
if ($name === 'setAuth') {
393388
// Abbreviation for setAuthentication.
394389
return call_user_func_array([$this, 'setAuthentication'], $arguments);

src/Module/Network/Wrappers/CurlWrapper.php

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,32 +1239,6 @@ public function getTimeout()
12391239
return $this->CONFIG->getTimeout();
12401240
}
12411241

1242-
/**
1243-
* @param $name
1244-
* @param $arguments
1245-
* @return mixed
1246-
* @throws ExceptionHandler
1247-
* @since 6.1.2
1248-
*/
1249-
public function __call($name, $arguments)
1250-
{
1251-
$return = null;
1252-
1253-
$compatibilityMethods = $this->CONFIG->getCompatibilityMethods();
1254-
if (isset($compatibilityMethods[$name])) {
1255-
$name = $compatibilityMethods[$name];
1256-
$return = call_user_func_array([$this, $name], $arguments);
1257-
}
1258-
1259-
if (!is_null($return)) {
1260-
return $return;
1261-
}
1262-
throw new ExceptionHandler(
1263-
sprintf('Function "%s" not available.', $name),
1264-
Constants::LIB_METHOD_OR_LIBRARY_UNAVAILABLE
1265-
);
1266-
}
1267-
12681242
/**
12691243
* @param $curlHandle
12701244
* @param $header

src/Module/Network/Wrappers/SimpleStreamWrapper.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -562,11 +562,7 @@ public function __call($name, $arguments)
562562
{
563563
$return = null;
564564

565-
$compatibilityMethods = $this->CONFIG->getCompatibilityMethods();
566-
if (isset($compatibilityMethods[$name])) {
567-
$name = $compatibilityMethods[$name];
568-
$return = call_user_func_array([$this, $name], $arguments);
569-
} elseif (method_exists($this->CONFIG, $name)) {
565+
if (method_exists($this->CONFIG, $name)) {
570566
/**
571567
* Makeing sure setSsl and other configuration is callable from the StreamWrapper.
572568
* @since 6.1.5

tests/curlWrapperTest.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -435,22 +435,6 @@ public function basicGetHeaderUserAgent()
435435
static::assertSame($curlRequest->getHeader('content-type'), 'application/json');
436436
}
437437

438-
/**
439-
* @test
440-
* @throws ExceptionHandler
441-
* @since 6.1.2
442-
*/
443-
public function getParsedResponse()
444-
{
445-
static::expectException(ExceptionHandler::class);
446-
447-
$curlWrapperRequest = new CurlWrapper();
448-
$curlWrapperRequest->request('https://ipv4.netcurl.org');
449-
/** @noinspection ForgottenDebugOutputInspection */
450-
$p = $curlWrapperRequest->getParsedResponse();
451-
static::assertTrue(isset($p->ip));
452-
}
453-
454438
/**
455439
* @test
456440
* Ask for multiple urls.

0 commit comments

Comments
 (0)