Skip to content

Commit ca5abf2

Browse files
committed
Add StyleCI to check PSR-2 coding style
1 parent 9e90d32 commit ca5abf2

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Diff for: .styleci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
preset: psr2

Diff for: src/ImageConverter.php

+8-7
Original file line numberDiff line numberDiff line change
@@ -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));
@@ -179,7 +179,8 @@ private function makeDirectory($to)
179179
* @return resource
180180
* @throws \InvalidArgumentException
181181
*/
182-
function convert($from, $to, $quality = null) {
183-
$converter = new ImageConverter();
184-
return $converter->convert($from, $to, $quality);
185-
}
182+
function convert($from, $to, $quality = null)
183+
{
184+
$converter = new ImageConverter();
185+
return $converter->convert($from, $to, $quality);
186+
}

0 commit comments

Comments
 (0)