1919use Cake \Core \Configure ;
2020use Cake \Core \Plugin ;
2121use Cake \Event \Event ;
22- use Cake \Network \Exception \NotFoundException ;
22+ use Cake \Http \Exception \NotFoundException ;
2323use Cake \Utility \Inflector ;
2424use DebugKit \Mailer \AbstractResult ;
2525use DebugKit \Mailer \PreviewResult ;
@@ -39,7 +39,7 @@ class MailPreviewController extends Controller
3939 *
4040 * @param \Cake\Event\Event $event The beforeFilter event.
4141 * @return void
42- * @throws \Cake\Network \Exception\NotFoundException
42+ * @throws \Cake\Http \Exception\NotFoundException
4343 */
4444 public function beforeFilter (Event $ event )
4545 {
@@ -93,15 +93,15 @@ public function sent($panelId, $number)
9393 $ email = $ content ['emails ' ][$ number ];
9494 $ email = new SentMailResult (array_filter ($ email ['headers ' ]), $ email ['message ' ]);
9595
96- $ partType = $ this ->request ->query ('part ' );
96+ $ partType = $ this ->request ->getQuery ('part ' );
9797 if ($ partType ) {
9898 return $ this ->respondWithPart ($ email , $ partType );
9999 }
100100
101101 $ this ->set ('noHeader ' , true );
102102 $ this ->set ('email ' , $ email );
103103 $ this ->set ('plugin ' , '' );
104- $ this ->set ('part ' , $ this ->findPreferredPart ($ email , $ this ->request ->query ('part ' )));
104+ $ this ->set ('part ' , $ this ->findPreferredPart ($ email , $ this ->request ->getQuery ('part ' )));
105105 $ this ->viewBuilder ()->template ('email ' );
106106 }
107107
@@ -114,9 +114,9 @@ public function sent($panelId, $number)
114114 */
115115 public function email ($ name , $ method )
116116 {
117- $ plugin = $ this ->request ->query ('plugin ' );
117+ $ plugin = $ this ->request ->getQuery ('plugin ' );
118118 $ email = $ this ->findPreview ($ name , $ method , $ plugin );
119- $ partType = $ this ->request ->query ('part ' );
119+ $ partType = $ this ->request ->getQuery ('part ' );
120120
121121 $ this ->viewBuilder ()->layout (false );
122122
@@ -128,7 +128,7 @@ public function email($name, $method)
128128 $ this ->set ('title ' , $ humanName );
129129 $ this ->set ('email ' , $ email );
130130 $ this ->set ('plugin ' , $ plugin );
131- $ this ->set ('part ' , $ this ->findPreferredPart ($ email , $ this ->request ->query ('part ' )));
131+ $ this ->set ('part ' , $ this ->findPreferredPart ($ email , $ this ->request ->getQuery ('part ' )));
132132 }
133133
134134 /**
@@ -147,13 +147,13 @@ protected function respondWithPart($email, $partType)
147147 throw new NotFoundException (__d ('debug_kit ' , "Email part '{0}' not found in email " , $ partType ));
148148 }
149149
150- $ this ->response ->type ($ partType );
150+ $ response = $ this ->response ->withType ($ partType );
151151 if ($ part === 'text ' ) {
152152 $ part = '<pre> ' . $ part . "</pre> " ;
153153 }
154- $ this -> response -> body ($ part );
154+ $ response = $ response -> withStringBody ($ part );
155155
156- return $ this -> response ;
156+ return $ response ;
157157 }
158158
159159 /**
@@ -251,7 +251,7 @@ protected function findPreferredPart(AbstractResult $email, $partType)
251251 * @param string $emailName The mailer preview method
252252 * @param string|null $plugin The plugin where the mailer preview should be found
253253 * @return \DebugKit\Mailer\PreviewResult The result of the email preview
254- * @throws \Cake\Network \Exception\NotFoundException
254+ * @throws \Cake\Http \Exception\NotFoundException
255255 */
256256 protected function findPreview ($ previewName , $ emailName , $ plugin = null )
257257 {
0 commit comments