mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°6934 - Symfony 6.4 - upgrade Symfony bundles to 6.4 (#580)
* Update Symfony lib to version ~6.4.0 * Update code missing return type * Add an iTop general configuration entry to store application secret (Symfony mandatory parameter) * Use dependency injection in ExceptionListener & UserProvider classes
This commit is contained in:
@@ -21,7 +21,7 @@ final class EnglishInflector implements InflectorInterface
|
||||
private const PLURAL_MAP = [
|
||||
// First entry: plural suffix, reversed
|
||||
// Second entry: length of plural suffix
|
||||
// Third entry: Whether the suffix may succeed a vocal
|
||||
// Third entry: Whether the suffix may succeed a vowel
|
||||
// Fourth entry: Whether the suffix may succeed a consonant
|
||||
// Fifth entry: singular suffix, normal
|
||||
|
||||
@@ -55,6 +55,9 @@ final class EnglishInflector implements InflectorInterface
|
||||
// indices (index), appendices (appendix), prices (price)
|
||||
['seci', 4, false, true, ['ex', 'ix', 'ice']],
|
||||
|
||||
// codes (code)
|
||||
['sedoc', 5, false, true, 'code'],
|
||||
|
||||
// selfies (selfie)
|
||||
['seifles', 7, true, true, 'selfie'],
|
||||
|
||||
@@ -64,6 +67,9 @@ final class EnglishInflector implements InflectorInterface
|
||||
// movies (movie)
|
||||
['seivom', 6, true, true, 'movie'],
|
||||
|
||||
// names (name)
|
||||
['seman', 5, true, false, 'name'],
|
||||
|
||||
// conspectuses (conspectus), prospectuses (prospectus)
|
||||
['sesutcep', 8, true, true, 'pectus'],
|
||||
|
||||
@@ -88,6 +94,9 @@ final class EnglishInflector implements InflectorInterface
|
||||
// accesses (access), addresses (address), kisses (kiss)
|
||||
['sess', 4, true, false, 'ss'],
|
||||
|
||||
// statuses (status)
|
||||
['sesutats', 8, true, true, 'status'],
|
||||
|
||||
// analyses (analysis), ellipses (ellipsis), fungi (fungus),
|
||||
// neuroses (neurosis), theses (thesis), emphases (emphasis),
|
||||
// oases (oasis), crises (crisis), houses (house), bases (base),
|
||||
@@ -132,6 +141,9 @@ final class EnglishInflector implements InflectorInterface
|
||||
// shoes (shoe)
|
||||
['se', 2, true, true, ['', 'e']],
|
||||
|
||||
// status (status)
|
||||
['sutats', 6, true, true, 'status'],
|
||||
|
||||
// tags (tag)
|
||||
['s', 1, true, true, ''],
|
||||
|
||||
@@ -150,7 +162,7 @@ final class EnglishInflector implements InflectorInterface
|
||||
private const SINGULAR_MAP = [
|
||||
// First entry: singular suffix, reversed
|
||||
// Second entry: length of singular suffix
|
||||
// Third entry: Whether the suffix may succeed a vocal
|
||||
// Third entry: Whether the suffix may succeed a vowel
|
||||
// Fourth entry: Whether the suffix may succeed a consonant
|
||||
// Fifth entry: plural suffix, normal
|
||||
|
||||
@@ -241,6 +253,9 @@ final class EnglishInflector implements InflectorInterface
|
||||
// seasons (season), treasons (treason), poisons (poison), lessons (lesson)
|
||||
['nos', 3, true, true, 'sons'],
|
||||
|
||||
// icons (icon)
|
||||
['noc', 3, true, true, 'cons'],
|
||||
|
||||
// bacteria (bacterium), criteria (criterion), phenomena (phenomenon)
|
||||
['no', 2, true, true, 'a'],
|
||||
|
||||
@@ -273,6 +288,9 @@ final class EnglishInflector implements InflectorInterface
|
||||
// circuses (circus)
|
||||
['suc', 3, true, true, 'cuses'],
|
||||
|
||||
// status (status)
|
||||
['sutats', 6, true, true, ['status', 'statuses']],
|
||||
|
||||
// conspectuses (conspectus), prospectuses (prospectus)
|
||||
['sutcep', 6, true, true, 'pectuses'],
|
||||
|
||||
@@ -328,15 +346,30 @@ final class EnglishInflector implements InflectorInterface
|
||||
// deer
|
||||
'reed',
|
||||
|
||||
// equipment
|
||||
'tnempiuqe',
|
||||
|
||||
// feedback
|
||||
'kcabdeef',
|
||||
|
||||
// fish
|
||||
'hsif',
|
||||
|
||||
// health
|
||||
'htlaeh',
|
||||
|
||||
// history
|
||||
'yrotsih',
|
||||
|
||||
// info
|
||||
'ofni',
|
||||
|
||||
// information
|
||||
'noitamrofni',
|
||||
|
||||
// money
|
||||
'yenom',
|
||||
|
||||
// moose
|
||||
'esoom',
|
||||
|
||||
@@ -348,11 +381,11 @@ final class EnglishInflector implements InflectorInterface
|
||||
|
||||
// species
|
||||
'seiceps',
|
||||
|
||||
// traffic
|
||||
'ciffart',
|
||||
];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function singularize(string $plural): array
|
||||
{
|
||||
$pluralRev = strrev($plural);
|
||||
@@ -384,14 +417,14 @@ final class EnglishInflector implements InflectorInterface
|
||||
if ($j === $suffixLength) {
|
||||
// Is there any character preceding the suffix in the plural string?
|
||||
if ($j < $pluralLength) {
|
||||
$nextIsVocal = false !== strpos('aeiou', $lowerPluralRev[$j]);
|
||||
$nextIsVowel = str_contains('aeiou', $lowerPluralRev[$j]);
|
||||
|
||||
if (!$map[2] && $nextIsVocal) {
|
||||
// suffix may not succeed a vocal but next char is one
|
||||
if (!$map[2] && $nextIsVowel) {
|
||||
// suffix may not succeed a vowel but next char is one
|
||||
break;
|
||||
}
|
||||
|
||||
if (!$map[3] && !$nextIsVocal) {
|
||||
if (!$map[3] && !$nextIsVowel) {
|
||||
// suffix may not succeed a consonant but next char is one
|
||||
break;
|
||||
}
|
||||
@@ -429,9 +462,6 @@ final class EnglishInflector implements InflectorInterface
|
||||
return [$plural];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function pluralize(string $singular): array
|
||||
{
|
||||
$singularRev = strrev($singular);
|
||||
@@ -464,14 +494,14 @@ final class EnglishInflector implements InflectorInterface
|
||||
if ($j === $suffixLength) {
|
||||
// Is there any character preceding the suffix in the plural string?
|
||||
if ($j < $singularLength) {
|
||||
$nextIsVocal = false !== strpos('aeiou', $lowerSingularRev[$j]);
|
||||
$nextIsVowel = str_contains('aeiou', $lowerSingularRev[$j]);
|
||||
|
||||
if (!$map[2] && $nextIsVocal) {
|
||||
// suffix may not succeed a vocal but next char is one
|
||||
if (!$map[2] && $nextIsVowel) {
|
||||
// suffix may not succeed a vowel but next char is one
|
||||
break;
|
||||
}
|
||||
|
||||
if (!$map[3] && !$nextIsVocal) {
|
||||
if (!$map[3] && !$nextIsVowel) {
|
||||
// suffix may not succeed a consonant but next char is one
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user