Skip to content

Commit

Permalink
chore: linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
christyjacob4 committed Jan 27, 2023
1 parent 077bdbb commit 3e7a78d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
3 changes: 2 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 5 additions & 7 deletions src/Storage/Compression/Algorithms/Brotli.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function useFontMode(): void
*
* Allow values from 0 up to a current max of 11.
*
* @param int $level
* @param int $level
* @return void
*/
public function setLevel(int $level): void
Expand All @@ -83,23 +83,21 @@ public function setLevel(int $level): void
/**
* Compress.
*
* @param string $data
*
* @param string $data
* @return string
*/
public function compress(string $data):string
public function compress(string $data): string
{
return \brotli_compress($data, $this->getLevel(), $this->mode);
}

/**
* Decompress.
*
* @param string $data
*
* @param string $data
* @return string
*/
public function decompress(string $data):string
public function decompress(string $data): string
{
return \brotli_uncompress($data);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/Storage/Compression/Algorithms/BrotliTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Utopia\Tests\Storage\Compression\Algorithms;

use InvalidArgumentException;
use Utopia\Storage\Compression\Algorithms\Brotli;
use PHPUnit\Framework\TestCase;
use Utopia\Storage\Compression\Algorithms\Brotli;

class BrotliTest extends TestCase
{
Expand Down Expand Up @@ -49,7 +49,7 @@ public function testCompressDecompressWithText()

public function testCompressDecompressWithLargeText()
{
$demo = \file_get_contents(__DIR__ . '/../../../resources/disk-a/lorem.txt');
$demo = \file_get_contents(__DIR__.'/../../../resources/disk-a/lorem.txt');
$demoSize = mb_strlen($demo, '8bit');

$this->object->setLevel(8);
Expand All @@ -70,7 +70,7 @@ public function testCompressDecompressWithLargeText()

public function testCompressDecompressWithJPGImage()
{
$demo = \file_get_contents(__DIR__ . '/../../../resources/disk-a/kitten-1.jpg');
$demo = \file_get_contents(__DIR__.'/../../../resources/disk-a/kitten-1.jpg');
$demoSize = mb_strlen($demo, '8bit');

$this->object->setLevel(8);
Expand All @@ -89,7 +89,7 @@ public function testCompressDecompressWithJPGImage()

public function testCompressDecompressWithPNGImage()
{
$demo = \file_get_contents(__DIR__ . '/../../../resources/disk-b/kitten-1.png');
$demo = \file_get_contents(__DIR__.'/../../../resources/disk-b/kitten-1.png');
$demoSize = mb_strlen($demo, '8bit');

$this->object->setLevel(8);
Expand Down
2 changes: 1 addition & 1 deletion tests/Storage/Compression/Algorithms/GZIPTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function testCompressDecompressWithText()

public function testCompressDecompressWithLargeText()
{
$demo = \file_get_contents(__DIR__ . '/../../../resources/disk-a/lorem.txt');
$demo = \file_get_contents(__DIR__.'/../../../resources/disk-a/lorem.txt');
$demoSize = mb_strlen($demo, '8bit');

$data = $this->object->compress($demo);
Expand Down
5 changes: 1 addition & 4 deletions tests/Storage/Compression/Algorithms/ZstdTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ public function testCompressDecompressWithText()
$this->assertEquals($demo, $this->object->decompress($data));
}

<<<<<<< HEAD
=======
public function testCompressDecompressWithLargeText()
{
$demo = \file_get_contents(__DIR__ . '/../../../resources/disk-a/lorem.txt');
$demo = \file_get_contents(__DIR__.'/../../../resources/disk-a/lorem.txt');
$demoSize = mb_strlen($demo, '8bit');

$data = $this->object->compress($demo);
Expand All @@ -58,7 +56,6 @@ public function testCompressDecompressWithLargeText()
$this->assertEquals($dataSize, 386795);
}

>>>>>>> a77f526be68c8ac6b6d6b8fe11d4fb7fa713837f
public function testCompressDecompressWithJPGImage()
{
$demo = \file_get_contents(__DIR__.'/../../../resources/disk-a/kitten-1.jpg');
Expand Down

0 comments on commit 3e7a78d

Please sign in to comment.