Skip to content

Instantly share code, notes, and snippets.

@chasepeeler
Created August 24, 2016 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chasepeeler/4be2ce1eff0d8e04ec98baa8a0101141 to your computer and use it in GitHub Desktop.
Save chasepeeler/4be2ce1eff0d8e04ec98baa8a0101141 to your computer and use it in GitHub Desktop.
<?php
interface PdfAdapterInterface {
public function combinePdf($pdf1,$pdf2);
}
<?php
class PdfLibAdapter implements PdfAdapterInterface {
//implementation
}
<?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