forked from cakephp/cakephp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cakephp#17348 from cakephp/5.x-merge
merge 4.next => 5.x
- Loading branch information
Showing
6 changed files
with
174 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
parameters: | ||
ignoreErrors: | ||
|
36 changes: 36 additions & 0 deletions
36
tests/test_app/TestApp/Controller/UnionDependenciesController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace TestApp\Controller; | ||
|
||
use Cake\Controller\ComponentRegistry; | ||
use Cake\Controller\Controller; | ||
use Cake\Event\EventManagerInterface; | ||
use Cake\Http\Response; | ||
use Cake\Http\ServerRequest; | ||
use stdClass; | ||
|
||
/** | ||
* UnionDependenciesController class | ||
* | ||
* Separate from Dependencies Controller because unions are not supported in PHP 7.4 | ||
*/ | ||
class UnionDependenciesController extends Controller | ||
{ | ||
public function __construct( | ||
?ServerRequest $request = null, | ||
?Response $response = null, | ||
?string $name = null, | ||
?EventManagerInterface $eventManager = null, | ||
?ComponentRegistry $components = null, | ||
?stdClass $inject = null | ||
) { | ||
parent::__construct($request, $response, $name, $eventManager, $components); | ||
$this->inject = $inject; | ||
} | ||
|
||
public function typedUnion(string|int $one) | ||
{ | ||
return $this->response->withStringBody(json_encode(compact('one'))); | ||
} | ||
} |