Exemplo n.º 1
0
<?php

require 'TV.php';
require 'Watcher.php';
$tv = new TV('TF1');
$tim = new Watcher('Tim');
$berners = new Watcher('Berners');
$lee = new Watcher('Lee');
$tv->attach($tim);
$tv->attach($berners);
$tv->attach($lee);
$tv->detach($tim);
$tv->movie('Match France-Italie');
Exemplo n.º 2
0
<?php

require 'ThingInterface.php';
require 'VisitorInterface.php';
require 'TV.php';
require 'Keyboard.php';
$tv = new TV();
$tv->accept(new Keyboard());
Exemplo n.º 3
0
 /**
  * @param array $options Class instances / Echo to cli.
  */
 public function __construct(array $options = [])
 {
     parent::__construct($options);
     $this->rageqty = $this->pdo->getSetting('maxrageprocessed') != '' ? $this->pdo->getSetting('maxrageprocessed') : 75;
     $this->xmlEpisodeInfoUrl = "http://services.tvrage.com/myfeeds/episodeinfo.php?key=" . TvRage::APIKEY;
 }
 public function undo()
 {
     $this->tv->on();
 }
Exemplo n.º 5
0
{
    public function switchOn()
    {
        echo "TVのスイッチをつけました\n";
    }
}
class Cleaner
{
    public function turnOn()
    {
        echo "掃除機の電源を入れました\n";
    }
}
class PC
{
    public function logIn()
    {
        echo "PCにログインしました\n";
    }
}
$electronics = new TV();
$electronics->switchOn();
$electronics = new Cleaner();
$electronics->turnOn();
$electronics = new PC();
$electronics->logIn();
/*
TVのスイッチをつけました
掃除機の電源を入れました
PCにログインしました
*/