Skip to content

Instantly share code, notes, and snippets.

@caironm
Created September 30, 2019 11:36
Show Gist options
  • Save caironm/d0e9a9ae122da771153d91d094b45e51 to your computer and use it in GitHub Desktop.
Save caironm/d0e9a9ae122da771153d91d094b45e51 to your computer and use it in GitHub Desktop.
<?php
class Saveimg
{
private $save;
public function __construct(Save $save)
{
$this-save = $save;
}
public function save($file)
{
$this-save->save($file);
}
}
interface Save
{
public function save($file);
}
class Original implements Save
{
public function save($file)
{
//lógica
}
}
class Thumb implements Save
{
public function save($file)
{
//lógica
}
}
class Medium implements Save
{
public function save($file)
{
//lógica
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment