Skip to content

Commit ab1b43c

Browse files
Merge branch '3.4' into 4.0
* 3.4: 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 08c9e34 + 91f18ae commit ab1b43c

36 files changed

+96
-96
lines changed

AcceptHeaderItem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static function fromString($itemValue)
5353
$attributes[$bit] = null;
5454
} else {
5555
$parts = explode('=', $bit);
56-
$attributes[$parts[0]] = isset($parts[1]) && strlen($parts[1]) > 0 ? $parts[1] : '';
56+
$attributes[$parts[0]] = isset($parts[1]) && \strlen($parts[1]) > 0 ? $parts[1] : '';
5757
}
5858
}
5959

@@ -68,7 +68,7 @@ public static function fromString($itemValue)
6868
public function __toString()
6969
{
7070
$string = $this->value.($this->quality < 1 ? ';q='.$this->quality : '');
71-
if (count($this->attributes) > 0) {
71+
if (\count($this->attributes) > 0) {
7272
$string .= ';'.implode(';', array_map(function ($name, $value) {
7373
return sprintf(preg_match('/[,;=]/', $value) ? '%s="%s"' : '%s=%s', $name, $value);
7474
}, array_keys($this->attributes), $this->attributes));

ApacheRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function prepareBaseUrl()
3535

3636
if (false === strpos($this->server->get('REQUEST_URI'), $baseUrl)) {
3737
// assume mod_rewrite
38-
return rtrim(dirname($baseUrl), '/\\');
38+
return rtrim(\dirname($baseUrl), '/\\');
3939
}
4040

4141
return $baseUrl;

BinaryFileResponse.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public function setContentDisposition($disposition, $filename = '', $filenameFal
165165
for ($i = 0, $filenameLength = mb_strlen($filename, $encoding); $i < $filenameLength; ++$i) {
166166
$char = mb_substr($filename, $i, 1, $encoding);
167167

168-
if ('%' === $char || ord($char) < 32 || ord($char) > 126) {
168+
if ('%' === $char || \ord($char) < 32 || \ord($char) > 126) {
169169
$filenameFallback .= '_';
170170
} else {
171171
$filenameFallback .= $char;
@@ -221,12 +221,12 @@ public function prepare(Request $request)
221221
foreach (explode(',', $request->headers->get('X-Accel-Mapping', '')) as $mapping) {
222222
$mapping = explode('=', $mapping, 2);
223223

224-
if (2 === count($mapping)) {
224+
if (2 === \count($mapping)) {
225225
$pathPrefix = trim($mapping[0]);
226226
$location = trim($mapping[1]);
227227

228-
if (substr($path, 0, strlen($pathPrefix)) === $pathPrefix) {
229-
$path = $location.substr($path, strlen($pathPrefix));
228+
if (substr($path, 0, \strlen($pathPrefix)) === $pathPrefix) {
229+
$path = $location.substr($path, \strlen($pathPrefix));
230230
break;
231231
}
232232
}

Cookie.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function __construct(string $name, string $value = null, $expire = 0, ?st
128128
$sameSite = strtolower($sameSite);
129129
}
130130

131-
if (!in_array($sameSite, array(self::SAMESITE_LAX, self::SAMESITE_STRICT, null), true)) {
131+
if (!\in_array($sameSite, array(self::SAMESITE_LAX, self::SAMESITE_STRICT, null), true)) {
132132
throw new \InvalidArgumentException('The "sameSite" parameter value is not valid.');
133133
}
134134

File/Exception/UnexpectedTypeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ class UnexpectedTypeException extends FileException
1515
{
1616
public function __construct($value, string $expectedType)
1717
{
18-
parent::__construct(sprintf('Expected argument of type %s, %s given', $expectedType, is_object($value) ? get_class($value) : gettype($value)));
18+
parent::__construct(sprintf('Expected argument of type %s, %s given', $expectedType, \is_object($value) ? \get_class($value) : \gettype($value)));
1919
}
2020
}

File/MimeType/FileBinaryMimeTypeGuesser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static function isSupported()
4949
return $supported;
5050
}
5151

52-
if ('\\' === DIRECTORY_SEPARATOR || !function_exists('passthru') || !function_exists('escapeshellarg')) {
52+
if ('\\' === DIRECTORY_SEPARATOR || !\function_exists('passthru') || !\function_exists('escapeshellarg')) {
5353
return $supported = false;
5454
}
5555

File/MimeType/FileinfoMimeTypeGuesser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(string $magicFile = null)
4040
*/
4141
public static function isSupported()
4242
{
43-
return function_exists('finfo_open');
43+
return \function_exists('finfo_open');
4444
}
4545

4646
/**

File/UploadedFile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ public static function getMaxFilesize()
222222

223223
$max = ltrim($iniMax, '+');
224224
if (0 === strpos($max, '0x')) {
225-
$max = intval($max, 16);
225+
$max = \intval($max, 16);
226226
} elseif (0 === strpos($max, '0')) {
227-
$max = intval($max, 8);
227+
$max = \intval($max, 8);
228228
} else {
229229
$max = (int) $max;
230230
}

FileBag.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function replace(array $files = array())
4545
*/
4646
public function set($key, $value)
4747
{
48-
if (!is_array($value) && !$value instanceof UploadedFile) {
48+
if (!\is_array($value) && !$value instanceof UploadedFile) {
4949
throw new \InvalidArgumentException('An uploaded file must be an array or an instance of UploadedFile.');
5050
}
5151

@@ -76,7 +76,7 @@ protected function convertFileInformation($file)
7676
}
7777

7878
$file = $this->fixPhpFilesArray($file);
79-
if (is_array($file)) {
79+
if (\is_array($file)) {
8080
$keys = array_keys($file);
8181
sort($keys);
8282

@@ -113,14 +113,14 @@ protected function convertFileInformation($file)
113113
*/
114114
protected function fixPhpFilesArray($data)
115115
{
116-
if (!is_array($data)) {
116+
if (!\is_array($data)) {
117117
return $data;
118118
}
119119

120120
$keys = array_keys($data);
121121
sort($keys);
122122

123-
if (self::$fileKeys != $keys || !isset($data['name']) || !is_array($data['name'])) {
123+
if (self::$fileKeys != $keys || !isset($data['name']) || !\is_array($data['name'])) {
124124
return $data;
125125
}
126126

HeaderBag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function has($key)
181181
*/
182182
public function contains($key, $value)
183183
{
184-
return in_array($value, $this->get($key, null, false));
184+
return \in_array($value, $this->get($key, null, false));
185185
}
186186

187187
/**
@@ -289,7 +289,7 @@ public function getIterator()
289289
*/
290290
public function count()
291291
{
292-
return count($this->headers);
292+
return \count($this->headers);
293293
}
294294

295295
protected function getCacheControlHeader()

IpUtils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private function __construct()
3737
*/
3838
public static function checkIp($requestIp, $ips)
3939
{
40-
if (!is_array($ips)) {
40+
if (!\is_array($ips)) {
4141
$ips = array($ips);
4242
}
4343

@@ -116,7 +116,7 @@ public static function checkIp6($requestIp, $ip)
116116
return self::$checkedIps[$cacheKey];
117117
}
118118

119-
if (!((extension_loaded('sockets') && defined('AF_INET6')) || @inet_pton('::1'))) {
119+
if (!((\extension_loaded('sockets') && \defined('AF_INET6')) || @inet_pton('::1'))) {
120120
throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".');
121121
}
122122

JsonResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function setCallback($callback = null)
101101
);
102102
$parts = explode('.', $callback);
103103
foreach ($parts as $part) {
104-
if (!preg_match($pattern, $part) || in_array($part, $reserved, true)) {
104+
if (!preg_match($pattern, $part) || \in_array($part, $reserved, true)) {
105105
throw new \InvalidArgumentException('The callback name is not valid.');
106106
}
107107
}
@@ -142,7 +142,7 @@ public function setData($data = array())
142142
try {
143143
$data = json_encode($data, $this->encodingOptions);
144144
} catch (\Exception $e) {
145-
if ('Exception' === get_class($e) && 0 === strpos($e->getMessage(), 'Failed calling ')) {
145+
if ('Exception' === \get_class($e) && 0 === strpos($e->getMessage(), 'Failed calling ')) {
146146
throw $e->getPrevious() ?: $e;
147147
}
148148
throw $e;

ParameterBag.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,12 @@ public function filter($key, $default = null, $filter = FILTER_DEFAULT, $options
200200
$value = $this->get($key, $default);
201201

202202
// Always turn $options into an array - this allows filter_var option shortcuts.
203-
if (!is_array($options) && $options) {
203+
if (!\is_array($options) && $options) {
204204
$options = array('flags' => $options);
205205
}
206206

207207
// Add a convenience check for arrays.
208-
if (is_array($value) && !isset($options['flags'])) {
208+
if (\is_array($value) && !isset($options['flags'])) {
209209
$options['flags'] = FILTER_REQUIRE_ARRAY;
210210
}
211211

@@ -229,6 +229,6 @@ public function getIterator()
229229
*/
230230
public function count()
231231
{
232-
return count($this->parameters);
232+
return \count($this->parameters);
233233
}
234234
}

0 commit comments

Comments
 (0)