<?php
interface SocialNetwork {
public function getInformation(string $str=null);
public function getTimeline(string $str=null);
public function write(string $str);
.
.
.
}
class Twitter implements SocialNetwork {
public function getInformation(string $str=null) {
// user code
}
public function getTimeline(string $str=null) {
// user code
}
public function write(string $str) {
// user code
}
.
.
.
}
class SNSController extends CI_Controller {
public function write() {
$this->load->library('Twitter', $params);
if($this->Twitter instanceof SocialNetwork)
throw new Exception("do not implements SocialNetwork");
.
.
.
}
}
이런 글이 있군요... ㅋㅋㅋㅋ 이건 구글링 전에 봤어야 하는 ~~