mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-09 04:52:42 +00:00
type hinting controllers and views
This commit is contained in:
parent
38c3e30a1e
commit
22452f61f8
22 changed files with 50 additions and 50 deletions
|
@ -61,7 +61,7 @@ class JsonView extends View {
|
|||
*
|
||||
* @param Controller $controller
|
||||
*/
|
||||
public function __construct($controller) {
|
||||
public function __construct(Controller $controller = null) {
|
||||
parent::__construct($controller);
|
||||
if (isset($controller->response) && $controller->response instanceof CakeResponse) {
|
||||
$controller->response->type('json');
|
||||
|
|
|
@ -70,7 +70,7 @@ class MediaView extends View {
|
|||
*
|
||||
* @param Controller $controller The controller with viewVars
|
||||
*/
|
||||
public function __construct($controller = null) {
|
||||
public function __construct(Controller $controller = null) {
|
||||
parent::__construct($controller);
|
||||
}
|
||||
|
||||
|
|
|
@ -305,7 +305,7 @@ class View extends Object {
|
|||
*
|
||||
* @param Controller $controller A controller object to pull View::_passedVars from.
|
||||
*/
|
||||
public function __construct($controller) {
|
||||
public function __construct(Controller $controller = null) {
|
||||
if (is_object($controller)) {
|
||||
$count = count($this->_passedVars);
|
||||
for ($j = 0; $j < $count; $j++) {
|
||||
|
|
|
@ -63,7 +63,7 @@ class XmlView extends View {
|
|||
*
|
||||
* @param Controller $controller
|
||||
*/
|
||||
public function __construct($controller) {
|
||||
public function __construct(Controller $controller = null) {
|
||||
parent::__construct($controller);
|
||||
|
||||
if (isset($controller->response) && $controller->response instanceof CakeResponse) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue