Skip to content

Commit 14ebed9

Browse files
committed
8.5 compatibility
1 parent ee4427d commit 14ebed9

44 files changed

Lines changed: 230 additions & 108 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,9 @@ $monolog->critical('all your base are belong to them');
104104

105105
## Tests / Quality
106106

107-
![Supported PHP versions](https://img.shields.io/static/v1?label=PHP&message=5.4%20-%208.4&color=blue)
107+
![Supported PHP versions](https://img.shields.io/static/v1?label=PHP&message=5.4%20-%208.5&color=blue)
108108
![Build Status](https://img.shields.io/github/actions/workflow/status/bkdotcom/PHPDebugConsole/phpunit.yml.svg?branch=master&logo=github)
109109
[![Codacy Score](https://img.shields.io/codacy/grade/e950849edfd9463b993386080d39875e/master.svg?logo=codacy)](https://app.codacy.com/gh/bkdotcom/PHPDebugConsole/dashboard)
110-
[![Maintainability](https://img.shields.io/codeclimate/maintainability/bkdotcom/PHPDebugConsole.svg?logo=codeclimate)](https://codeclimate.com/github/bkdotcom/PHPDebugConsole)
111-
[![Coverage](https://img.shields.io/codeclimate/coverage-letter/bkdotcom/PHPDebugConsole.svg?logo=codeclimate)](https://codeclimate.com/github/bkdotcom/PHPDebugConsole)
112110

113111
## Changelog
114112

src/Container/Container.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public function extend($name, $callable)
192192
public function factory($invokable)
193193
{
194194
Utility::assertInvokable($invokable);
195-
$this->factories->attach($invokable);
195+
$this->factories->offsetSet($invokable);
196196
return $invokable;
197197
}
198198

@@ -393,7 +393,7 @@ public function offsetUnset($name)
393393
public function protect($invokable)
394394
{
395395
Utility::assertInvokable($invokable);
396-
$this->protected->attach($invokable);
396+
$this->protected->offsetSet($invokable);
397397
return $invokable;
398398
}
399399

src/CurlHttpMessage/CurlReqRes.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ public function __destruct()
8080
// ignore error
8181
});
8282
try {
83-
\curl_close($this->curlHandle);
83+
if (PHP_VERSION_ID < 80000) {
84+
\curl_close($this->curlHandle);
85+
}
8486
} catch (ErrorException $e) {
8587
// ignore exception
8688
}
@@ -163,7 +165,7 @@ public function setCurlHandle($curlHandle)
163165
{
164166
if ($curlHandle === null) {
165167
$this->unsetOptions();
166-
if ($this->curlHandleInternal) {
168+
if (PHP_VERSION_ID < 80000 && $this->curlHandleInternal) {
167169
\curl_close($this->curlHandle);
168170
}
169171
$this->curlHandle = null;

src/CurlHttpMessage/Handler/Curl.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ private function getCurlHandle()
4949
return $this->curlHandle;
5050
}
5151
if (\function_exists('curl_reset') === false) {
52-
\curl_close($this->curlHandle);
52+
if (PHP_VERSION_ID < 80000) {
53+
\curl_close($this->curlHandle);
54+
}
5355
$this->curlHandle = \curl_init();
5456
return $this->curlHandle;
5557
}

src/CurlHttpMessage/Handler/CurlMulti.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@ private function releaseHandle(CurlReqRes $curlReqRes)
216216
$curlHandle = $curlReqRes->getCurlHandle();
217217
$curlReqRes->setCurlHandle(null);
218218
if (\count($this->idleHandles) >= $this->options['maxIdleHandles']) {
219-
\curl_close($curlHandle);
219+
if (PHP_VERSION_ID < 80000) {
220+
\curl_close($curlHandle);
221+
}
220222
return;
221223
}
222224
if (\function_exists('curl_reset')) {

src/Debug/Abstraction/AbstractString.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ private function getMaxLen($cat, $strlen)
316316
$stringMaxLen = $this->cfg['brief']
317317
? $this->cfg['stringMaxLenBrief']
318318
: $this->cfg['stringMaxLen'];
319-
$maxLen = \array_key_exists($cat, $stringMaxLen)
319+
$maxLen = $cat && \array_key_exists($cat, $stringMaxLen)
320320
? $stringMaxLen[$cat]
321321
: $stringMaxLen['other'];
322322

src/Debug/Abstraction/Object/Properties.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ private function addViaRef(Abstraction $abs)
151151
if ($refProperty->isDefault() === false) {
152152
continue;
153153
}
154+
if (PHP_VERSION_ID < 80100) {
155+
$refProperty->setAccessible(true); // only accessible via reflection
156+
}
154157
$name = $refProperty->getName();
155158
$info = isset($properties[$name])
156159
? $properties[$name]
@@ -179,7 +182,6 @@ private function addViaRef(Abstraction $abs)
179182
protected function buildViaRef(Abstraction $abs, ReflectionProperty $refProperty, $isDynamic = false)
180183
{
181184
$phpDoc = $this->helper->getPhpDocVar($refProperty, $abs['fullyQualifyPhpDocType']);
182-
$refProperty->setAccessible(true); // only accessible via reflection
183185
return static::buildValues(array(
184186
'attributes' => $abs['cfgFlags'] & AbstractObject::PROP_ATTRIBUTE_COLLECT
185187
? $this->helper->getAttributes($refProperty)

src/Debug/Abstraction/Object/PropertiesInstance.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ private function mergeOverrideValue(array $propInfo, $overrideValue)
261261
*/
262262
private function valueFromReflection(array $propInfo, Abstraction $abs, ReflectionProperty $refProperty)
263263
{
264-
$refProperty->setAccessible(true); // only accessible via reflection
264+
if (PHP_VERSION_ID < 80100) {
265+
$refProperty->setAccessible(true); // only accessible via reflection
266+
}
265267
if ($propInfo['isVirtual']) {
266268
return $this->valueFromReflectionVirtual($propInfo, $abs, $refProperty);
267269
}

src/Debug/Collector/PhpCurlClass.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,11 @@ private function setReflection()
292292
{
293293
$classRef = (new ReflectionObject($this))->getParentClass();
294294
$optionsRef = $classRef->getProperty('options');
295-
$optionsRef->setAccessible(true);
296295
$parseReqHeadersRef = $classRef->getMethod('parseRequestHeaders');
297-
$parseReqHeadersRef->setAccessible(true);
296+
if (PHP_VERSION_ID < 80100) {
297+
$optionsRef->setAccessible(true);
298+
$parseReqHeadersRef->setAccessible(true);
299+
}
298300
$this->reflection = array(
299301
'options' => $optionsRef,
300302
'parseReqHeaders' => $parseReqHeadersRef,

src/Debug/Collector/SoapClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ public function __call($name, $args)
105105
* {@inheritDoc}
106106
*/
107107
#[\ReturnTypeWillChange]
108-
public function __doRequest($request, $location, $action, $version, $oneWay = 0)
108+
public function __doRequest($request, $location, $action, $version, $oneWay = 0, $uriParserClass = null)
109109
{
110110
$exception = null;
111111
try {
112-
$xmlResponse = parent::__doRequest($request, $location, $action, $version, $oneWay);
112+
$xmlResponse = parent::__doRequest($request, $location, $action, $version, $oneWay, $uriParserClass);
113113
} catch (SoapFault $e) {
114114
// we'll rethrow bellow
115115
}

0 commit comments

Comments
 (0)