11<?php
22
3- namespace ImageConverter ;
3+ namespace Jens \ ImageConverter ;
44
55class ImageConverter
66{
@@ -86,8 +86,8 @@ private function saveImage($to, $image, $quality)
8686 }
8787
8888
89- if (isset ($ quality ) && !is_int ($ quality )) {
90- throw new \InvalidArgumentException (sprintf ('The %s quality has to be an integer ' , $ quality ));
89+ if (isset ($ quality ) && !is_int ($ quality )) {
90+ throw new \InvalidArgumentException (sprintf ('The %s quality has to be an integer ' , $ quality ));
9191 }
9292
9393 switch ($ extension ) {
@@ -100,7 +100,7 @@ private function saveImage($to, $image, $quality)
100100 throw new \InvalidArgumentException (sprintf ('The %s quality is out of range ' , $ quality ));
101101 }
102102 $ image = imagejpeg ($ image , $ to , $ quality );
103- break ;
103+ break ;
104104 case 'png ' :
105105 if ($ quality < -1 && $ quality > 9 ) {
106106 throw new \InvalidArgumentException (sprintf ('The %s quality is out of range ' , $ quality ));
@@ -169,17 +169,3 @@ private function makeDirectory($to)
169169 return $ result ;
170170 }
171171}
172-
173- /**
174- * Helper function
175- *
176- * @param string $from
177- * @param string $to
178- *
179- * @return resource
180- * @throws \InvalidArgumentException
181- */
182- function convert ($ from , $ to , $ quality = null ) {
183- $ converter = new ImageConverter ();
184- return $ converter ->convert ($ from , $ to , $ quality );
185- }
0 commit comments