Created
August 24, 2016 13:55
-
-
Save chasepeeler/4be2ce1eff0d8e04ec98baa8a0101141 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 | |
interface PdfAdapterInterface { | |
public function combinePdf($pdf1,$pdf2); | |
} |
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 | |
class PdfLibAdapter implements PdfAdapterInterface { | |
//implementation | |
} |
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 | |
class PdfService implements PdfAdapterInterface { | |
protected $adapter; | |
public function __construct(PdfAdapterInterface $adapter){ | |
$this->adapter = $adapter; | |
} | |
public function combinePdf($pdf1,$pdf2){ | |
return $this->adapter->combinePdf($pdf1,$pdf2); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment