Skip to content

Commit 55d3f78

Browse files
authored
fix: doctype of View::render violates contract (#38789)
The Illuminate\View\View class is implementing the Illuminate\Contracts\View\View contract which extends the Illuminate\Contracts\Support\Renderable contract. The renderable contract is ensuring a contract for the render method always return a string: ```php /** * Get the evaluated contents of the object. * * @return string */ public function render(); ``` But the View class implementing the contract is specifying a return type violating the contract: ```php /** * Get the string contents of the view. * * @param callable|null $callback * @return array|string * * @throws \Throwable */ public function render(callable $callback = null) {} ```
1 parent 7d3151c commit 55d3f78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/View/View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function __construct(Factory $factory, Engine $engine, $view, $path, $dat
8181
* Get the string contents of the view.
8282
*
8383
* @param callable|null $callback
84-
* @return array|string
84+
* @return string
8585
*
8686
* @throws \Throwable
8787
*/

0 commit comments

Comments
 (0)