Skip to content

Commit 2ce11ab

Browse files
author
Roelof
authored
[8.x] Correct return type on View facade's first() (#35750)
* Fixed docblock in View facade * Added test assertion to make sure View facade docblock is correct
1 parent 13546a7 commit 2ce11ab

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Illuminate/Support/Facades/View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/**
66
* @method static \Illuminate\Contracts\View\Factory addNamespace(string $namespace, string|array $hints)
7-
* @method static \Illuminate\Contracts\View\Factory first(array $views, \Illuminate\Contracts\Support\Arrayable|array $data = [], array $mergeData = [])
7+
* @method static \Illuminate\Contracts\View\View first(array $views, \Illuminate\Contracts\Support\Arrayable|array $data = [], array $mergeData = [])
88
* @method static \Illuminate\Contracts\View\Factory replaceNamespace(string $namespace, string|array $hints)
99
* @method static \Illuminate\Contracts\View\View file(string $path, array $data = [], array $mergeData = [])
1010
* @method static \Illuminate\Contracts\View\View make(string $view, array $data = [], array $mergeData = [])

tests/View/ViewFactoryTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Container\Container;
88
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
99
use Illuminate\Contracts\View\Engine;
10+
use Illuminate\Contracts\View\View as ViewContract;
1011
use Illuminate\Events\Dispatcher;
1112
use Illuminate\Filesystem\Filesystem;
1213
use Illuminate\Support\HtmlString;
@@ -87,6 +88,7 @@ public function testFirstCreatesNewViewInstanceWithProperPath()
8788
$factory->addExtension('php', 'php');
8889
$view = $factory->first(['bar', 'view'], ['foo' => 'bar'], ['baz' => 'boom']);
8990

91+
$this->assertInstanceOf(ViewContract::class, $view);
9092
$this->assertSame($engine, $view->getEngine());
9193
$this->assertSame($_SERVER['__test.view'], $view);
9294

0 commit comments

Comments
 (0)