-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add interface for GenericData & EncodedImage
- Loading branch information
1 parent
aae6d35
commit 8f73dd8
Showing
4 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Intervention\Image\Interfaces; | ||
|
||
interface EncodedImageInterface extends GenericDataInterface | ||
{ | ||
/** | ||
* Return Media (MIME) Type of encoded image | ||
* | ||
* @return string | ||
*/ | ||
public function mimetype(): string; | ||
|
||
/** | ||
* Turn encoded image into DataUri format | ||
* | ||
* @return string | ||
*/ | ||
public function toDataUri(): string; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace Intervention\Image\Interfaces; | ||
|
||
interface GenericDataInterface | ||
{ | ||
/** | ||
* Save data in given path in file system | ||
* | ||
* @param string $filepath | ||
* @return void | ||
*/ | ||
public function save(string $filepath): void; | ||
|
||
/** | ||
* Create file pointer from encoded data | ||
* | ||
* @return resource | ||
*/ | ||
public function toFilePointer(); | ||
|
||
/** | ||
* Return size in bytes | ||
* | ||
* @return int | ||
*/ | ||
public function size(): int; | ||
|
||
/** | ||
* Turn encoded data into string | ||
* | ||
* @return string | ||
*/ | ||
public function toString(): string; | ||
|
||
/** | ||
* Cast encoded data into string | ||
* | ||
* @return string | ||
*/ | ||
public function __toString(): string; | ||
} |