no message
This commit is contained in:
44
Question14-AdvancedInheritance/common/EmailNotification.php
Normal file
44
Question14-AdvancedInheritance/common/EmailNotification.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Common;
|
||||
|
||||
require_once __DIR__ . '/NotificationInterface.php';
|
||||
|
||||
/**
|
||||
* メール通知を行うクラス
|
||||
*/
|
||||
// TODO: EmailNotification クラスを作成し、NotificationInterface を実装してください
|
||||
// ヒント: class EmailNotification implements NotificationInterface
|
||||
|
||||
// TODO: private プロパティ $emailAddress を定義してください
|
||||
|
||||
/**
|
||||
* コンストラクタ
|
||||
*
|
||||
* @param string $emailAddress 送信先のメールアドレス
|
||||
*/
|
||||
// TODO: コンストラクタを実装してください
|
||||
// 引数で受け取った $emailAddress を $this->emailAddress に設定
|
||||
|
||||
/**
|
||||
* メールで通知を送信する
|
||||
*
|
||||
* @param string $title 通知のタイトル
|
||||
* @param string $message 通知の本文
|
||||
* @return void
|
||||
*/
|
||||
// TODO: send メソッドを実装してください
|
||||
// 以下の内容を表示(各行の最後に <br> を付ける):
|
||||
// - "📧 メール送信"
|
||||
// - "宛先: " . $this->emailAddress
|
||||
// - "件名: " . $title
|
||||
// - "本文: " . $message
|
||||
// - "メールを送信しました。"
|
||||
|
||||
/**
|
||||
* 送信先のメールアドレスを取得する
|
||||
*
|
||||
* @return string メールアドレス
|
||||
*/
|
||||
// TODO: getDestination メソッドを実装してください
|
||||
// $this->emailAddress を返す
|
||||
Reference in New Issue
Block a user