Skip to content

Commit 31713b3

Browse files
committed
Merge branch '10.x' of github.com:laravel/framework into 10.x
2 parents 56962e7 + 087bf14 commit 31713b3

File tree

6 files changed

+31
-13
lines changed

6 files changed

+31
-13
lines changed

src/Illuminate/Database/Query/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,7 @@ public function addNestedWhereQuery($query, $boolean = 'and')
17041704
*
17051705
* @param \Illuminate\Contracts\Database\Query\Expression|string $column
17061706
* @param string $operator
1707-
* @param \Closure||\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder $callback
1707+
* @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder $callback
17081708
* @param string $boolean
17091709
* @return $this
17101710
*/

src/Illuminate/Mail/Transport/SesV2Transport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected function doSend(SentMessage $message): void
5151
if ($message->getOriginalMessage() instanceof Message) {
5252
foreach ($message->getOriginalMessage()->getHeaders()->all() as $header) {
5353
if ($header instanceof MetadataHeader) {
54-
$options['Tags'][] = ['Name' => $header->getKey(), 'Value' => $header->getValue()];
54+
$options['EmailTags'][] = ['Name' => $header->getKey(), 'Value' => $header->getValue()];
5555
}
5656
}
5757
}

src/Illuminate/Support/Str.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,22 +1305,23 @@ public static function apa($value)
13051305
$minorWords = [
13061306
'and', 'as', 'but', 'for', 'if', 'nor', 'or', 'so', 'yet', 'a', 'an',
13071307
'the', 'at', 'by', 'for', 'in', 'of', 'off', 'on', 'per', 'to', 'up', 'via',
1308+
'et', 'ou', 'un', 'une', 'la', 'le', 'les', 'de', 'du', 'des', 'par', 'à',
13081309
];
13091310

13101311
$endPunctuation = ['.', '!', '?', ':', '', ','];
13111312

13121313
$words = preg_split('/\s+/', $value, -1, PREG_SPLIT_NO_EMPTY);
13131314

1314-
$words[0] = ucfirst(mb_strtolower($words[0]));
1315-
13161315
for ($i = 0; $i < count($words); $i++) {
13171316
$lowercaseWord = mb_strtolower($words[$i]);
13181317

13191318
if (str_contains($lowercaseWord, '-')) {
13201319
$hyphenatedWords = explode('-', $lowercaseWord);
13211320

13221321
$hyphenatedWords = array_map(function ($part) use ($minorWords) {
1323-
return (in_array($part, $minorWords) && mb_strlen($part) <= 3) ? $part : ucfirst($part);
1322+
return (in_array($part, $minorWords) && mb_strlen($part) <= 3)
1323+
? $part
1324+
: mb_strtoupper(mb_substr($part, 0, 1)).mb_substr($part, 1);
13241325
}, $hyphenatedWords);
13251326

13261327
$words[$i] = implode('-', $hyphenatedWords);
@@ -1330,7 +1331,7 @@ public static function apa($value)
13301331
! ($i === 0 || in_array(mb_substr($words[$i - 1], -1), $endPunctuation))) {
13311332
$words[$i] = $lowercaseWord;
13321333
} else {
1333-
$words[$i] = ucfirst($lowercaseWord);
1334+
$words[$i] = mb_strtoupper(mb_substr($lowercaseWord, 0, 1)).mb_substr($lowercaseWord, 1);
13341335
}
13351336
}
13361337
}

src/Illuminate/View/ViewServiceProvider.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function registerEngineResolver()
135135
public function registerFileEngine($resolver)
136136
{
137137
$resolver->register('file', function () {
138-
return new FileEngine($this->app['files']);
138+
return new FileEngine(app()->make('files'));
139139
});
140140
}
141141

@@ -148,7 +148,7 @@ public function registerFileEngine($resolver)
148148
public function registerPhpEngine($resolver)
149149
{
150150
$resolver->register('php', function () {
151-
return new PhpEngine($this->app['files']);
151+
return new PhpEngine(app()->make('files'));
152152
});
153153
}
154154

@@ -161,9 +161,14 @@ public function registerPhpEngine($resolver)
161161
public function registerBladeEngine($resolver)
162162
{
163163
$resolver->register('blade', function () {
164-
$compiler = new CompilerEngine($this->app['blade.compiler'], $this->app['files']);
164+
$app = app();
165165

166-
$this->app->terminating(static function () use ($compiler) {
166+
$compiler = new CompilerEngine(
167+
$app->make('blade.compiler'),
168+
$app->make('files'),
169+
);
170+
171+
$app->terminating(static function () use ($compiler) {
167172
$compiler->forgetCompiledOrNotExpired();
168173
});
169174

tests/Mail/MailSesV2TransportTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function testSend()
7373
->with(m::on(function ($arg) {
7474
return $arg['Source'] === '[email protected]' &&
7575
$arg['Destination']['ToAddresses'] === ['[email protected]', '[email protected]'] &&
76-
$arg['Tags'] === [['Name' => 'FooTag', 'Value' => 'TagValue']] &&
76+
$arg['EmailTags'] === [['Name' => 'FooTag', 'Value' => 'TagValue']] &&
7777
strpos($arg['Content']['Raw']['Data'], 'Reply-To: Taylor Otwell <[email protected]>') !== false;
7878
}))
7979
->andReturn($sesResult);
@@ -111,7 +111,7 @@ public function testSesV2LocalConfiguration()
111111
'region' => 'eu-west-1',
112112
'options' => [
113113
'ConfigurationSetName' => 'Laravel',
114-
'Tags' => [
114+
'EmailTags' => [
115115
['Name' => 'Laravel', 'Value' => 'Framework'],
116116
],
117117
],
@@ -144,7 +144,7 @@ public function testSesV2LocalConfiguration()
144144

145145
$this->assertSame([
146146
'ConfigurationSetName' => 'Laravel',
147-
'Tags' => [
147+
'EmailTags' => [
148148
['Name' => 'Laravel', 'Value' => 'Framework'],
149149
],
150150
], $transport->getOptions());

tests/Support/SupportStrTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,18 @@ public function testStringApa()
9797
$this->assertSame('To Kill a Mockingbird', Str::apa('TO KILL A MOCKINGBIRD'));
9898
$this->assertSame('To Kill a Mockingbird', Str::apa('To Kill A Mockingbird'));
9999

100+
$this->assertSame('Être Écrivain Commence par Être un Lecteur.', Str::apa('Être écrivain commence par être un lecteur.'));
101+
$this->assertSame('Être Écrivain Commence par Être un Lecteur.', Str::apa('Être Écrivain Commence par Être un Lecteur.'));
102+
$this->assertSame('Être Écrivain Commence par Être un Lecteur.', Str::apa('ÊTRE ÉCRIVAIN COMMENCE PAR ÊTRE UN LECTEUR.'));
103+
104+
$this->assertSame("C'est-à-Dire.", Str::apa("c'est-à-dire."));
105+
$this->assertSame("C'est-à-Dire.", Str::apa("C'est-à-Dire."));
106+
$this->assertSame("C'est-à-Dire.", Str::apa("C'EsT-À-DIRE."));
107+
108+
$this->assertSame('Устное Слово – Не Воробей. Как Только Он Вылетит, Его Не Поймаешь.', Str::apa('устное слово – не воробей. как только он вылетит, его не поймаешь.'));
109+
$this->assertSame('Устное Слово – Не Воробей. Как Только Он Вылетит, Его Не Поймаешь.', Str::apa('Устное Слово – Не Воробей. Как Только Он Вылетит, Его Не Поймаешь.'));
110+
$this->assertSame('Устное Слово – Не Воробей. Как Только Он Вылетит, Его Не Поймаешь.', Str::apa('УСТНОЕ СЛОВО – НЕ ВОРОБЕЙ. КАК ТОЛЬКО ОН ВЫЛЕТИТ, ЕГО НЕ ПОЙМАЕШЬ.'));
111+
100112
$this->assertSame('', Str::apa(''));
101113
$this->assertSame(' ', Str::apa(' '));
102114
}

0 commit comments

Comments
 (0)