Skip to content

Commit d6d83f2

Browse files
committed
Merge branch '6.x' into 7.x
# Conflicts: # README.md
2 parents 8b84cf5 + aec6bc8 commit d6d83f2

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<p align="center"><a href="https://laravel.com" target="_blank" rel="noopener"><img src="https://res.cloudinary.com/dtfbvvkyp/image/upload/v1566331377/laravel-logolockup-cmyk-red.svg" width="400"></a></p>
1+
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400"></a></p>
22

33
<p align="center">
44
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>

src/Illuminate/Database/Eloquent/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ public function intersect($items)
357357
*
358358
* @param string|callable|null $key
359359
* @param bool $strict
360-
* @return static|\Illuminate\Support\Collection
360+
* @return static
361361
*/
362362
public function unique($key = null, $strict = false)
363363
{

src/Illuminate/Translation/Translator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function get($key, array $replace = [], $locale = null, $fallback = true)
122122
$locales = $fallback ? $this->localeArray($locale) : [$locale];
123123

124124
foreach ($locales as $locale) {
125-
if (! is_null($line = $this->getLine(
125+
if (! empty($line = $this->getLine(
126126
$namespace, $group, $locale, $item, $replace
127127
))) {
128128
return $line ?? $key;

tests/Translation/TranslationTranslatorTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,17 @@ public function testGetMethodProperlyLoadsAndRetrievesItemForFallback()
104104
$this->assertSame('foo', $t->get('foo::bar.foo'));
105105
}
106106

107+
public function testGetMethodProperlyLoadsAndRetrievesItemForFallbackWhenLineIsEmpty()
108+
{
109+
$t = new Translator($this->getLoader(), 'en');
110+
$t->setFallback('lv');
111+
$t->getLoader()->shouldReceive('load')->once()->with('en', '*', '*')->andReturn([]);
112+
$t->getLoader()->shouldReceive('load')->once()->with('en', 'bar', 'foo')->andReturn(['baz' => '']);
113+
$t->getLoader()->shouldReceive('load')->once()->with('lv', 'bar', 'foo')->andReturn(['foo' => 'foo', 'baz' => 'breeze :foo']);
114+
$this->assertSame('breeze bar', $t->get('foo::bar.baz', ['foo' => 'bar'], 'en'));
115+
$this->assertSame('foo', $t->get('foo::bar.foo'));
116+
}
117+
107118
public function testGetMethodProperlyLoadsAndRetrievesItemForGlobalNamespace()
108119
{
109120
$t = new Translator($this->getLoader(), 'en');

0 commit comments

Comments
 (0)