From 5ab3f673990dd04ca0174eab299b6c65aa0372ce Mon Sep 17 00:00:00 2001 From: chinpei215 Date: Wed, 28 Dec 2016 10:24:55 +0900 Subject: [PATCH] Change method visibility from public to protected --- src/Mailer/MailerAwareTrait.php | 2 +- src/View/CellTrait.php | 2 +- src/View/View.php | 4 +++- tests/TestCase/Mailer/MailerAwareTraitTest.php | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Mailer/MailerAwareTrait.php b/src/Mailer/MailerAwareTrait.php index 563d31566c1..c0d65f78f32 100644 --- a/src/Mailer/MailerAwareTrait.php +++ b/src/Mailer/MailerAwareTrait.php @@ -35,7 +35,7 @@ trait MailerAwareTrait * @return \Cake\Mailer\Mailer * @throws \Cake\Mailer\Exception\MissingMailerException if undefined mailer class. */ - public function getMailer($name, Email $email = null) + protected function getMailer($name, Email $email = null) { if ($email === null) { $email = new Email(); diff --git a/src/View/CellTrait.php b/src/View/CellTrait.php index de89386518a..f31815a72fb 100644 --- a/src/View/CellTrait.php +++ b/src/View/CellTrait.php @@ -55,7 +55,7 @@ trait CellTrait * @throws \Cake\View\Exception\MissingCellException If Cell class was not found. * @throws \BadMethodCallException If Cell class does not specified cell action. */ - public function cell($cell, array $data = [], array $options = []) + protected function cell($cell, array $data = [], array $options = []) { $parts = explode('::', $cell); diff --git a/src/View/View.php b/src/View/View.php index 0e0071777e9..237fcf33155 100644 --- a/src/View/View.php +++ b/src/View/View.php @@ -73,7 +73,9 @@ class View implements EventDispatcherInterface { - use CellTrait; + use CellTrait { + cell as public; + } use EventDispatcherTrait; use LogTrait; use RequestActionTrait; diff --git a/tests/TestCase/Mailer/MailerAwareTraitTest.php b/tests/TestCase/Mailer/MailerAwareTraitTest.php index 1d7c6c697c4..09736fb5fba 100644 --- a/tests/TestCase/Mailer/MailerAwareTraitTest.php +++ b/tests/TestCase/Mailer/MailerAwareTraitTest.php @@ -23,7 +23,9 @@ class Stub { - use MailerAwareTrait; + use MailerAwareTrait { + getMailer as public; + } } /**