<?php
require_once 'IPhrases.php';
require_once 'EnglishPhrases.php';
require_once 'FrenchPhrases.php';
require_once 'Translator.php';

use \Main\InterfaceStuff\Translator;
use \Main\InterfaceStuff\IPhrases;
use \Main\InterfaceStuff\FrenchPhrases;
use \Main\InterfaceStuff\EnglishPhrases;

// Interfaces example
$english = new EnglishPhrases();
$english->Hello();

// Polymorphism
// Do multiple translations storing a number
// of different languages.
$translator = new Translator();

// Add objects that play the role of phrase generators
// to the Translator
$translator->AddLanguage(new EnglishPhrases());
$translator->AddLanguage(new FrenchPhrases());

$translator->SayHelloToEverybody();

$french = $translator->FindFrenchPhrases();

//if($french !== false)   // If returning boolean false, !== checks type and value i.e. Boolean and false
//{
//	echo $french->SomeExtraText();
//}

if(isset($french) == true)  // Check that an object (i.e. not undefined) is returned.
{
	echo $french->SomeExtraText();
}

?>