no message
This commit is contained in:
35
Question14-AdvancedInheritance/Ex04.php
Normal file
35
Question14-AdvancedInheritance/Ex04.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* インタフェースの基本: 通知システム
|
||||
*
|
||||
* NotificationInterface.php、EmailNotification.php、SmsNotification.php を実装してください
|
||||
*
|
||||
* 【課題】
|
||||
* 通知を送信するシステムを作成します。
|
||||
* メール通知とSMS通知の2種類があり、どちらも同じインタフェースを実装します。
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/common/NotificationInterface.php';
|
||||
require_once __DIR__ . '/common/EmailNotification.php';
|
||||
require_once __DIR__ . '/common/SmsNotification.php';
|
||||
|
||||
use Common\EmailNotification;
|
||||
use Common\SmsNotification;
|
||||
|
||||
// TODO: EmailNotificationのインスタンスを生成してください
|
||||
// コンストラクタには "user@example.com" を渡してください
|
||||
// 変数名は $email
|
||||
|
||||
// TODO: $email の send メソッドを呼び出してください
|
||||
// 第1引数: "システムアラート"
|
||||
// 第2引数: "サーバーの負荷が高まっています。"
|
||||
|
||||
echo "<br>";
|
||||
|
||||
// TODO: SmsNotificationのインスタンスを生成してください
|
||||
// コンストラクタには "090-1234-5678" を渡してください
|
||||
// 変数名は $sms
|
||||
|
||||
// TODO: $sms の send メソッドを呼び出してください
|
||||
// 第1引数: "緊急連絡"
|
||||
// 第2引数: "サーバーダウンが発生しました。"
|
||||
Reference in New Issue
Block a user