Skip to content

Commit

Permalink
Sample PHPDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielfs7 committed Aug 4, 2014
1 parent c13587e commit 9c93418
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/GSoares/DesignPatterns/Structural/Adapter/Sample.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?php
namespace GSoares\DesignPatterns\Structural\Adapter;

/**
* Sample 1
*
* Adapt an old phone number class to a new one that provides separate phone number codes.
*/

class LegacyPhoneNumber
{
private $number;
Expand Down Expand Up @@ -43,6 +49,8 @@ public function getNumber()

function runAdapter()
{
echo "Sample 1 - PhoneNumberAdapter\n\n";

$legacyNumber = new LegacyPhoneNumber('+55 (48) 3222-2222');

echo "Set legacy phone number " . $legacyNumber->getNumber() . "\n";
Expand All @@ -53,4 +61,6 @@ function runAdapter()
echo "Country code: " . $newNumber->getCountryCode() . "\n";
echo "Area code: " . $newNumber->getAreaCode() . "\n";
echo "Number: " . $newNumber->getNumber();

echo "Sample 2 - PhoneNumberAdapter\n\n";
}

0 comments on commit 9c93418

Please sign in to comment.