Skip to content

Commit 9189e6a

Browse files
author
Mitch
committed
Drop loadFromFile() and do main instantiation through constructor
1 parent a3c572d commit 9189e6a

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

src/ImageResize.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,15 @@ public static function createFromString($image_data)
5050
$resize = new self('data://application/octet-stream;base64,' . base64_encode($image_data));
5151
return $resize;
5252
}
53-
54-
/**
55-
* Constructor
56-
*
57-
* @param string|null $filename
58-
* @throws \Exception
59-
*/
60-
public function __construct($filename)
61-
{
62-
$this->loadFromFile($filename);
63-
}
6453

6554
/**
6655
* Loads image source and its properties to the instanciated object
6756
*
6857
* @param string $filename
69-
* @return \static
70-
* @throws Exception
58+
* @return ImageResize
59+
* @throws \Exception
7160
*/
72-
public function loadFromFile($filename)
61+
public function __construct($filename)
7362
{
7463
$image_info = @getimagesize($filename);
7564

0 commit comments

Comments
 (0)