Skip to content

Commit 6851356

Browse files
Merge branch '4.0' into 4.1
* 4.0: Fix Clidumper tests Enable the fixer enforcing fully-qualified calls for compiler-optimized functions Apply fixers Disable the native_constant_invocation fixer until it can be scoped Update the list of excluded files for the CS fixer
2 parents ff9ac5d + cc86e81 commit 6851356

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ protected function doRequestInProcess($request)
394394
unlink($deprecationsFile);
395395
foreach ($deprecations ? unserialize($deprecations) : array() as $deprecation) {
396396
if ($deprecation[0]) {
397-
trigger_error($deprecation[1], E_USER_DEPRECATED);
397+
@trigger_error($deprecation[1], E_USER_DEPRECATED);
398398
} else {
399399
@trigger_error($deprecation[1], E_USER_DEPRECATED);
400400
}
@@ -536,7 +536,7 @@ public function followRedirect()
536536

537537
$request = $this->internalRequest;
538538

539-
if (in_array($this->internalResponse->getStatus(), array(301, 302, 303))) {
539+
if (\in_array($this->internalResponse->getStatus(), array(301, 302, 303))) {
540540
$method = 'GET';
541541
$files = array();
542542
$content = null;

Cookie.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public static function fromString($cookie, $url = null)
169169
continue;
170170
}
171171

172-
if (2 === count($elements = explode('=', $part, 2))) {
172+
if (2 === \count($elements = explode('=', $part, 2))) {
173173
if ('expires' === strtolower($elements[0])) {
174174
$elements[1] = self::parseDate($elements[1]);
175175
}
@@ -193,7 +193,7 @@ public static function fromString($cookie, $url = null)
193193
private static function parseDate($dateValue)
194194
{
195195
// trim single quotes around date if present
196-
if (($length = strlen($dateValue)) > 1 && "'" === $dateValue[0] && "'" === $dateValue[$length - 1]) {
196+
if (($length = \strlen($dateValue)) > 1 && "'" === $dateValue[0] && "'" === $dateValue[$length - 1]) {
197197
$dateValue = substr($dateValue, 1, -1);
198198
}
199199

CookieJar.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function updateFromSetCookie(array $setCookies, $uri = null)
123123
if (0 === $i || preg_match('/^(?P<token>\s*[0-9A-Za-z!#\$%\&\'\*\+\-\.^_`\|~]+)=/', $part)) {
124124
$cookies[] = ltrim($part);
125125
} else {
126-
$cookies[count($cookies) - 1] .= ','.$part;
126+
$cookies[\count($cookies) - 1] .= ','.$part;
127127
}
128128
}
129129
}
@@ -186,13 +186,13 @@ public function allValues($uri, $returnsRawValue = false)
186186
foreach ($this->cookieJar as $domain => $pathCookies) {
187187
if ($domain) {
188188
$domain = '.'.ltrim($domain, '.');
189-
if ($domain != substr('.'.$parts['host'], -strlen($domain))) {
189+
if ($domain != substr('.'.$parts['host'], -\strlen($domain))) {
190190
continue;
191191
}
192192
}
193193

194194
foreach ($pathCookies as $path => $namedCookies) {
195-
if ($path != substr($parts['path'], 0, strlen($path))) {
195+
if ($path != substr($parts['path'], 0, \strlen($path))) {
196196
continue;
197197
}
198198

History.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public function clear()
3535
*/
3636
public function add(Request $request)
3737
{
38-
$this->stack = array_slice($this->stack, 0, $this->position + 1);
38+
$this->stack = \array_slice($this->stack, 0, $this->position + 1);
3939
$this->stack[] = clone $request;
40-
$this->position = count($this->stack) - 1;
40+
$this->position = \count($this->stack) - 1;
4141
}
4242

4343
/**
@@ -47,7 +47,7 @@ public function add(Request $request)
4747
*/
4848
public function isEmpty()
4949
{
50-
return 0 == count($this->stack);
50+
return 0 == \count($this->stack);
5151
}
5252

5353
/**
@@ -75,7 +75,7 @@ public function back()
7575
*/
7676
public function forward()
7777
{
78-
if ($this->position > count($this->stack) - 2) {
78+
if ($this->position > \count($this->stack) - 2) {
7979
throw new \LogicException('You are already on the last page.');
8080
}
8181

Response.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __toString()
4444
{
4545
$headers = '';
4646
foreach ($this->headers as $name => $value) {
47-
if (is_string($value)) {
47+
if (\is_string($value)) {
4848
$headers .= $this->buildHeader($name, $value);
4949
} else {
5050
foreach ($value as $headerValue) {
@@ -113,10 +113,10 @@ public function getHeader($header, $first = true)
113113
foreach ($this->headers as $key => $value) {
114114
if (str_replace('-', '_', strtolower($key)) === $normalizedHeader) {
115115
if ($first) {
116-
return is_array($value) ? (count($value) ? $value[0] : '') : $value;
116+
return \is_array($value) ? (\count($value) ? $value[0] : '') : $value;
117117
}
118118

119-
return is_array($value) ? $value : array($value);
119+
return \is_array($value) ? $value : array($value);
120120
}
121121
}
122122

0 commit comments

Comments
 (0)