Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions templates/Error/error400.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
*/
use Cake\Core\Configure;

$this->layout = 'error';
$this->setLayout('error');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protected means outside $this context.
But all of the template are running inside, see also the docblock above :)

So none of those changes are necessary.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes... You're right. :-)

I followed the advice given by the code analyzer (VSCode + DEVSENSE PHP) without thinking about the context.
Sorry.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If they report this despite the docblock at the top, maybe you can open a bug ticket with them instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeap.
You should close this pull request.
Thanks for your replies.


if (Configure::read('debug')) :
$this->layout = 'dev_error';
$this->setLayout('dev_error');

$this->assign('title', $message);
$this->assign('templateName', 'error400.php');
Expand Down
4 changes: 2 additions & 2 deletions templates/Error/error500.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use Cake\Core\Configure;
use Cake\Error\Debugger;

$this->layout = 'error';
$this->setLayout('error');

if (Configure::read('debug')) :
$this->layout = 'dev_error';
$this->setLayout('dev_error');

$this->assign('title', $message);
$this->assign('templateName', 'error500.php');
Expand Down