Skip to content

Commit 4012fac

Browse files
Merge branch '3.4' into 4.4
* 3.4: Enable "native_constant_invocation" CS rule Make AbstractPhpFileCacheWarmer public
2 parents f533106 + 2084c70 commit 4012fac

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

Client.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function getCookieJar()
199199
public function getCrawler()
200200
{
201201
if (null === $this->crawler) {
202-
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', static::class.'::'.__FUNCTION__), E_USER_DEPRECATED);
202+
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', static::class.'::'.__FUNCTION__), \E_USER_DEPRECATED);
203203
// throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
204204
}
205205

@@ -214,7 +214,7 @@ public function getCrawler()
214214
public function getInternalResponse()
215215
{
216216
if (null === $this->internalResponse) {
217-
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', static::class.'::'.__FUNCTION__), E_USER_DEPRECATED);
217+
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', static::class.'::'.__FUNCTION__), \E_USER_DEPRECATED);
218218
// throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
219219
}
220220

@@ -234,7 +234,7 @@ public function getInternalResponse()
234234
public function getResponse()
235235
{
236236
if (null === $this->response) {
237-
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', static::class.'::'.__FUNCTION__), E_USER_DEPRECATED);
237+
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', static::class.'::'.__FUNCTION__), \E_USER_DEPRECATED);
238238
// throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
239239
}
240240

@@ -249,7 +249,7 @@ public function getResponse()
249249
public function getInternalRequest()
250250
{
251251
if (null === $this->internalRequest) {
252-
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', static::class.'::'.__FUNCTION__), E_USER_DEPRECATED);
252+
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', static::class.'::'.__FUNCTION__), \E_USER_DEPRECATED);
253253
// throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
254254
}
255255

@@ -269,7 +269,7 @@ public function getInternalRequest()
269269
public function getRequest()
270270
{
271271
if (null === $this->request) {
272-
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', static::class.'::'.__FUNCTION__), E_USER_DEPRECATED);
272+
@trigger_error(sprintf('Calling the "%s()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.', static::class.'::'.__FUNCTION__), \E_USER_DEPRECATED);
273273
// throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
274274
}
275275

@@ -315,7 +315,7 @@ public function clickLink(string $linkText): Crawler
315315
public function submit(Form $form, array $values = []/*, array $serverParameters = []*/)
316316
{
317317
if (\func_num_args() < 3 && __CLASS__ !== static::class && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prophecy\ProphecySubjectInterface) {
318-
@trigger_error(sprintf('The "%s()" method will have a new "array $serverParameters = []" argument in version 5.0, not defining it is deprecated since Symfony 4.2.', static::class.'::'.__FUNCTION__), E_USER_DEPRECATED);
318+
@trigger_error(sprintf('The "%s()" method will have a new "array $serverParameters = []" argument in version 5.0, not defining it is deprecated since Symfony 4.2.', static::class.'::'.__FUNCTION__), \E_USER_DEPRECATED);
319319
}
320320

321321
$form->setValues($values);
@@ -372,12 +372,12 @@ public function request(string $method, string $uri, array $parameters = [], arr
372372

373373
$server = array_merge($this->server, $server);
374374

375-
if (!empty($server['HTTP_HOST']) && null === parse_url($originalUri, PHP_URL_HOST)) {
375+
if (!empty($server['HTTP_HOST']) && null === parse_url($originalUri, \PHP_URL_HOST)) {
376376
$uri = preg_replace('{^(https?\://)'.preg_quote($this->extractHost($uri)).'}', '${1}'.$server['HTTP_HOST'], $uri);
377377
}
378378

379-
if (isset($server['HTTPS']) && null === parse_url($originalUri, PHP_URL_SCHEME)) {
380-
$uri = preg_replace('{^'.parse_url($uri, PHP_URL_SCHEME).'}', $server['HTTPS'] ? 'https' : 'http', $uri);
379+
if (isset($server['HTTPS']) && null === parse_url($originalUri, \PHP_URL_SCHEME)) {
380+
$uri = preg_replace('{^'.parse_url($uri, \PHP_URL_SCHEME).'}', $server['HTTPS'] ? 'https' : 'http', $uri);
381381
}
382382

383383
if (!isset($server['HTTP_REFERER']) && !$this->history->isEmpty()) {
@@ -388,7 +388,7 @@ public function request(string $method, string $uri, array $parameters = [], arr
388388
$server['HTTP_HOST'] = $this->extractHost($uri);
389389
}
390390

391-
$server['HTTPS'] = 'https' == parse_url($uri, PHP_URL_SCHEME);
391+
$server['HTTPS'] = 'https' == parse_url($uri, \PHP_URL_SCHEME);
392392

393393
$this->internalRequest = new Request($uri, $method, $parameters, $files, $this->cookieJar->allValues($uri), $server, $content);
394394

@@ -457,9 +457,9 @@ protected function doRequestInProcess($request)
457457
foreach ($deprecations ? unserialize($deprecations) : [] as $deprecation) {
458458
if ($deprecation[0]) {
459459
// unsilenced on purpose
460-
trigger_error($deprecation[1], E_USER_DEPRECATED);
460+
trigger_error($deprecation[1], \E_USER_DEPRECATED);
461461
} else {
462-
@trigger_error($deprecation[1], E_USER_DEPRECATED);
462+
@trigger_error($deprecation[1], \E_USER_DEPRECATED);
463463
}
464464
}
465465
}
@@ -677,7 +677,7 @@ protected function getAbsoluteUri($uri)
677677

678678
// protocol relative URL
679679
if (0 === strpos($uri, '//')) {
680-
return parse_url($currentUri, PHP_URL_SCHEME).':'.$uri;
680+
return parse_url($currentUri, \PHP_URL_SCHEME).':'.$uri;
681681
}
682682

683683
// anchor or query string parameters?
@@ -686,7 +686,7 @@ protected function getAbsoluteUri($uri)
686686
}
687687

688688
if ('/' !== $uri[0]) {
689-
$path = parse_url($currentUri, PHP_URL_PATH);
689+
$path = parse_url($currentUri, \PHP_URL_PATH);
690690

691691
if ('/' !== substr($path, -1)) {
692692
$path = substr($path, 0, strrpos($path, '/') + 1);
@@ -713,7 +713,7 @@ protected function requestFromRequest(Request $request, $changeHistory = true)
713713
private function updateServerFromUri(array $server, string $uri): array
714714
{
715715
$server['HTTP_HOST'] = $this->extractHost($uri);
716-
$scheme = parse_url($uri, PHP_URL_SCHEME);
716+
$scheme = parse_url($uri, \PHP_URL_SCHEME);
717717
$server['HTTPS'] = null === $scheme ? $server['HTTPS'] : 'https' == $scheme;
718718
unset($server['HTTP_IF_NONE_MATCH'], $server['HTTP_IF_MODIFIED_SINCE']);
719719

@@ -722,9 +722,9 @@ private function updateServerFromUri(array $server, string $uri): array
722722

723723
private function extractHost(string $uri): ?string
724724
{
725-
$host = parse_url($uri, PHP_URL_HOST);
725+
$host = parse_url($uri, \PHP_URL_HOST);
726726

727-
if ($port = parse_url($uri, PHP_URL_PORT)) {
727+
if ($port = parse_url($uri, \PHP_URL_PORT)) {
728728
return $host.':'.$port;
729729
}
730730

HttpBrowser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private function getBodyAndExtraHeaders(Request $request, array $headers): array
9191
return ['', []];
9292
}
9393

94-
return [http_build_query($fields, '', '&', PHP_QUERY_RFC1738), ['Content-Type' => 'application/x-www-form-urlencoded']];
94+
return [http_build_query($fields, '', '&', \PHP_QUERY_RFC1738), ['Content-Type' => 'application/x-www-form-urlencoded']];
9595
}
9696

9797
private function getHeaders(Request $request): array

Response.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function __toString()
7373
*/
7474
protected function buildHeader($name, $value)
7575
{
76-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.3.', __METHOD__), E_USER_DEPRECATED);
76+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.3.', __METHOD__), \E_USER_DEPRECATED);
7777

7878
return sprintf("%s: %s\n", $name, $value);
7979
}
@@ -97,7 +97,7 @@ public function getContent()
9797
*/
9898
public function getStatus()
9999
{
100-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.3, use getStatusCode() instead.', __METHOD__), E_USER_DEPRECATED);
100+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.3, use getStatusCode() instead.', __METHOD__), \E_USER_DEPRECATED);
101101

102102
return $this->status;
103103
}

0 commit comments

Comments
 (0)