Created
February 7, 2014 21:04
-
-
Save douglaslinsmeyer/8871817 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* File plugin.php | |
* | |
* @author Douglas Linsmeyer <douglas.linsmeyer@nerdery.com> | |
*/ | |
$mapFactory = new MapFactory(); | |
class Map | |
{ | |
private $addresses = array(); | |
private $zoomLevel = 1; | |
private $center = '123434324,23423423'; | |
} | |
class Address | |
{ | |
private $street; | |
private $state; | |
} | |
class MapFactory | |
{ | |
public function make(array $addresses) | |
{ | |
$map = new Map(); | |
foreach ($addresses as $address) { | |
$map->addAddress($address); | |
} | |
return $map; | |
} | |
} | |
class AddressProvider | |
{ | |
public function __construct(NetworkAddressProvider $networkProvider, CustomAddressProvider $customAddressProvider) | |
{ | |
} | |
public function fetchAddresses() | |
{ | |
$address = array(); | |
$address += $this->networkProvider->fetchAddresses(); | |
$address += $this->customProvider->fetchAddresses(); | |
return $address; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment