8000 Merge branch '5.1' into 5.2 · symfony/symfony@e23aae3 · GitHub
[go: up one dir, main page]

Skip to content

Commit e23aae3

Browse files
Merge branch '5.1' into 5.2
* 5.1: Changed private static array-properties to const static properties newly introduced in 5.1
2 parents 00f99bd + ac61623 commit e23aae3

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/RegisterGlobalSecurityEventListenersPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*/
3737
class RegisterGlobalSecurityEventListenersPass implements CompilerPassInterface
3838
{
39-
private static $eventBubblingEvents = [
39+
private const EVENT_BUBBLING_EVENTS = [
4040
CheckPassportEvent::class,
4141
LoginFailureEvent::class,
4242
LoginSuccessEvent::class,
@@ -75,7 +75,7 @@ public function process(ContainerBuilder $container)
7575
}
7676

7777
$methodCallArguments = $methodCall[1];
78-
if (!\in_array($methodCallArguments[0], self::$eventBubblingEvents, true)) {
78+
if (!\in_array($methodCallArguments[0], self::EVENT_BUBBLING_EVENTS, true)) {
7979
continue;
8080
}
8181

src/Symfony/Component/Cache/Adapter/MemcachedAdapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MemcachedAdapter extends AbstractAdapter
3333

3434
protected $maxIdLength = 250;
3535

36-
private static $defaultClientOptions = [
36+
private const DEFAULT_CLIENT_OPTIONS = [
3737
'persistent_id' => null,
3838
'username' => null,
3939
'password' => null,
@@ -108,7 +108,7 @@ public static function createConnection($servers, array $options = [])
108108
}
109109
set_error_handler(function ($type, $msg, $file, $line) { throw new \ErrorException($msg, 0, $type, $file, $line); });
110110
try {
111-
$options += static::$defaultClientOptions;
111+
$options += static::DEFAULT_CLIENT_OPTIONS;
112112
$client = new \Memcached($options['persistent_id']);
113113
$username = $options['username'];
114114
$password = $options['password'];

src/Symfony/Component/String/Inflector/EnglishInflector.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ final class EnglishInflector implements InflectorInterface
138138
*
139139
* @see http://english-zone.com/spelling/plurals.html
140140
*/
141-
private static $singularMap = [
141+
private const SINGULAR_MAP = [
142142
// First entry: singular suffix, reversed
143143
// Second entry: length of singular suffix
144144
// Third entry: Whether the suffix may succeed a vocal
@@ -304,7 +304,7 @@ final class EnglishInflector implements InflectorInterface
304304
/**
305305
* A list of words which should not be inflected, reversed.
306306
*/
307-
private static $uninflected = [
307+
private const UNINFLECTED = [
308308
'',
309309
'atad',
310310
'reed',
@@ -327,7 +327,7 @@ public function singularize(string $plural): array
327327
$pluralLength = \strlen($lowerPluralRev);
328328

329329
// Check if the word is one which is not inflected, return early if so
330-
if (\in_array($lowerPluralRev, self::$uninflected, true)) {
330+
if (\in_array($lowerPluralRev, self::UNINFLECTED, true)) {
331331
return [$plural];
332332
}
333333

@@ -406,15 +406,15 @@ public function pluralize(string $singular): array
406406
$singularLength = \strlen($lowerSingularRev);
407407

408408
// Check if the word is one which is not inflected, return early if so
409-
if (\in_array($lowerSingularRev, self::$uninflected, true)) {
409+
if (\in_array($lowerSingularRev, self::UNINFLECTED, true)) {
410410
return [$singular];
411411
}
412412

413413
// The outer loop iterates over the entries of the singular table
414414
// The inner loop $j iterates over the characters of the singular suffix
415415
// in the singular table to compare them with the characters of the actual
416416
// given singular suffix
417-
foreach (self::$singularMap as $map) {
417+
foreach (self::SINGULAR_MAP as $map) {
418418
$suffix = $map[0];
419419
$suffixLength = $map[1];
420420
$j = 0;

0 commit comments

Comments
 (0)
0