@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | throw new FilesException($targetFileExistsErr); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - return $this->dataOverwriteCopy( $source, $target, $unlinkErr, $copyErr); |
|
| 83 | + return $this->dataOverwriteCopy($source, $target, $unlinkErr, $copyErr); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | throw new FilesException($targetFileExistsErr); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - return $this->dataOverwriteRename( $source, $target, $unlinkErr, $copyErr); |
|
| 134 | + return $this->dataOverwriteRename($source, $target, $unlinkErr, $copyErr); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | $this->checkResource(); |
| 87 | 87 | $fromWidth = $this->width(); |
| 88 | 88 | $fromHeight = $this->height(); |
| 89 | - $width = (!is_null($width) && ($width > 0)) ? (int)$width : $fromWidth; |
|
| 90 | - $height = (!is_null($height) && ($height > 0)) ? (int)$height : $fromHeight; |
|
| 89 | + $width = (!is_null($width) && ($width > 0)) ? (int) $width : $fromWidth; |
|
| 90 | + $height = (!is_null($height) && ($height > 0)) ? (int) $height : $fromHeight; |
|
| 91 | 91 | $resource = $this->create($width, $height); |
| 92 | 92 | if (false === imagecopyresized($resource, $this->resource, 0, 0, 0, 0, $width, $height, $fromWidth, $fromHeight)) { |
| 93 | 93 | // @codeCoverageIgnoreStart |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | $this->checkResource(); |
| 113 | 113 | $fromWidth = $this->width(); |
| 114 | 114 | $fromHeight = $this->height(); |
| 115 | - $width = ($width && is_numeric($width) && ($width > 0)) ? (int)$width : $fromWidth; |
|
| 116 | - $height = ($height && is_numeric($height) && ($height > 0)) ? (int)$height : $fromHeight; |
|
| 115 | + $width = ($width && is_numeric($width) && ($width > 0)) ? (int) $width : $fromWidth; |
|
| 116 | + $height = ($height && is_numeric($height) && ($height > 0)) ? (int) $height : $fromHeight; |
|
| 117 | 117 | $resource = $this->create($width, $height); |
| 118 | 118 | if (false === imagecopyresampled($resource, $this->resource, 0, 0, 0, 0, $width, $height, $fromWidth, $fromHeight)) { |
| 119 | 119 | // @codeCoverageIgnoreStart |
@@ -23,8 +23,8 @@ |
||
| 23 | 23 | $newHeight = $currentHeight / $maxHeight; |
| 24 | 24 | $ratio = max($newWidth, $newHeight); // due this it's necessary to pass all |
| 25 | 25 | $ratio = max($ratio, 1.0); |
| 26 | - $newWidth = (int)($currentWidth / $ratio); |
|
| 27 | - $newHeight = (int)($currentHeight / $ratio); |
|
| 26 | + $newWidth = (int) ($currentWidth / $ratio); |
|
| 27 | + $newHeight = (int) ($currentHeight / $ratio); |
|
| 28 | 28 | return ['width' => $newWidth, 'height' => $newHeight]; |
| 29 | 29 | } |
| 30 | 30 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | $this->assertEquals(static::TEST_STRING, $lib->get(['testtree', 'testimage.png'])); |
| 32 | 32 | |
| 33 | 33 | $this->assertTrue($lib->copy('testimage.png', ['testtree'], ['dumptree'])); |
| 34 | - $this->assertTrue($lib->move('testimage.png', ['testtree'], ['dumptree'] ,true)); |
|
| 34 | + $this->assertTrue($lib->move('testimage.png', ['testtree'], ['dumptree'], true)); |
|
| 35 | 35 | $this->assertFalse($lib->isHere(['testtree', 'testimage.png'])); |
| 36 | 36 | $this->assertTrue($lib->isHere(['dumptree', 'testimage.png'])); |
| 37 | 37 | |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | $this->assertTrue($lib->copy('testimage.png', ['testtree'], ['dumptree'])); |
| 33 | 33 | $this->assertEquals(static::TEST_STRING, $lib->get(['dumptree', 'testimage.png'])); |
| 34 | 34 | |
| 35 | - $this->assertTrue($lib->move('testimage.png', ['testtree'], ['dumptree'] ,true)); |
|
| 35 | + $this->assertTrue($lib->move('testimage.png', ['testtree'], ['dumptree'], true)); |
|
| 36 | 36 | $this->assertFalse($lib->isHere(['testtree', 'testimage.png'])); |
| 37 | 37 | $this->assertEmpty($lib->get(['testtree', 'testimage.png'])); |
| 38 | 38 | |
@@ -53,10 +53,10 @@ |
||
| 53 | 53 | public function testFreeName(): void |
| 54 | 54 | { |
| 55 | 55 | $memory = new Target\Memory(); |
| 56 | - $memory->save(DIRECTORY_SEPARATOR . 'testtree' . DIRECTORY_SEPARATOR . 'testimage.png' , static::TEST_STRING); |
|
| 57 | - $memory->save(DIRECTORY_SEPARATOR . 'testtree' . DIRECTORY_SEPARATOR . 'tstimg.png' , static::TEST_STRING); |
|
| 58 | - $memory->save(DIRECTORY_SEPARATOR . 'testtree' . DIRECTORY_SEPARATOR . 'tstimg_0.png' , static::TEST_STRING); |
|
| 59 | - $memory->save(DIRECTORY_SEPARATOR . 'testtree' . DIRECTORY_SEPARATOR . 'tstimg_1.png' , static::TEST_STRING); |
|
| 56 | + $memory->save(DIRECTORY_SEPARATOR . 'testtree' . DIRECTORY_SEPARATOR . 'testimage.png', static::TEST_STRING); |
|
| 57 | + $memory->save(DIRECTORY_SEPARATOR . 'testtree' . DIRECTORY_SEPARATOR . 'tstimg.png', static::TEST_STRING); |
|
| 58 | + $memory->save(DIRECTORY_SEPARATOR . 'testtree' . DIRECTORY_SEPARATOR . 'tstimg_0.png', static::TEST_STRING); |
|
| 59 | + $memory->save(DIRECTORY_SEPARATOR . 'testtree' . DIRECTORY_SEPARATOR . 'tstimg_1.png', static::TEST_STRING); |
|
| 60 | 60 | |
| 61 | 61 | $lib = $this->getLib([], $memory); |
| 62 | 62 | $this->assertEquals('solo.png', $lib->findFreeName(['testtree'], 'solo.png')); |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | $tgt0 = $this->targetPath() . DIRECTORY_SEPARATOR . 'tstimg.png'; |
| 99 | 99 | copy($src, $tgt0); // directly |
| 100 | 100 | $conf = new Graphics\ImageConfig(); |
| 101 | - $conf->setData(['max_width' => 120, 'max_height' => 80,]); |
|
| 101 | + $conf->setData(['max_width' => 120, 'max_height' => 80, ]); |
|
| 102 | 102 | $lib = $this->getGraphics(); |
| 103 | 103 | $lib->setSizes($conf); |
| 104 | 104 | $lib->resize($tgt0, $tgt0); |
@@ -32,8 +32,8 @@ |
||
| 32 | 32 | [20, 20, 35, 35, 20, 20], // sizes inside the limit |
| 33 | 33 | [35, 35, 20, 20, 20, 20], // smaller! |
| 34 | 34 | [55, 20, 30, 50, 30, 10], // one size larger - new sizes by ratio |
| 35 | - [80, 15, 40, 40, 40, 7], |
|
| 36 | - [15, 80, 40, 40, 7, 40], |
|
| 35 | + [80, 15, 40, 40, 40, 7], |
|
| 36 | + [15, 80, 40, 40, 7, 40], |
|
| 37 | 37 | ]; |
| 38 | 38 | } |
| 39 | 39 | } |