@@ -30,7 +30,7 @@ |
||
| 30 | 30 | $limit = null; |
| 31 | 31 | } |
| 32 | 32 | if (empty($limit)) { |
| 33 | - $result = (!empty($offset)) ? substr($what, $offset) : $what ; |
|
| 33 | + $result = (!empty($offset)) ? substr($what, $offset) : $what; |
|
| 34 | 34 | } else { |
| 35 | 35 | $result = (!empty($offset)) ? substr($what, $offset, $limit) : substr($what, 0, $limit); |
| 36 | 36 | } |
@@ -135,7 +135,7 @@ |
||
| 135 | 135 | |
| 136 | 136 | public function load(string $key) |
| 137 | 137 | { |
| 138 | - return $this->exists($key) ? $this->data[$key] : null ; |
|
| 138 | + return $this->exists($key) ? $this->data[$key] : null; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | public function save(string $key, $data, ?int $timeout = null): bool |
@@ -17,18 +17,18 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function testStrings(): void |
| 19 | 19 | { |
| 20 | - $this->assertEquals('bcdef', substr('abcdef', 1)); |
|
| 21 | - $this->assertEquals('bcd', substr('abcdef', 1, 3)); |
|
| 22 | - $this->assertEquals('abcd', substr('abcdef', 0, 4)); |
|
| 20 | + $this->assertEquals('bcdef', substr('abcdef', 1)); |
|
| 21 | + $this->assertEquals('bcd', substr('abcdef', 1, 3)); |
|
| 22 | + $this->assertEquals('abcd', substr('abcdef', 0, 4)); |
|
| 23 | 23 | $this->assertEquals('abcdef', substr('abcdef', 0, 8)); |
| 24 | - $this->assertEquals('f', substr('abcdef', -1, 1)); |
|
| 24 | + $this->assertEquals('f', substr('abcdef', -1, 1)); |
|
| 25 | 25 | |
| 26 | 26 | // now with lib |
| 27 | - $this->assertEquals('bcdef', Support\Strings::substr('abcdef', 1, null, '')); |
|
| 28 | - $this->assertEquals('bcd', Support\Strings::substr('abcdef', 1, 3, '')); |
|
| 29 | - $this->assertEquals('abcd', Support\Strings::substr('abcdef', 0, 4, '')); |
|
| 27 | + $this->assertEquals('bcdef', Support\Strings::substr('abcdef', 1, null, '')); |
|
| 28 | + $this->assertEquals('bcd', Support\Strings::substr('abcdef', 1, 3, '')); |
|
| 29 | + $this->assertEquals('abcd', Support\Strings::substr('abcdef', 0, 4, '')); |
|
| 30 | 30 | $this->assertEquals('abcdef', Support\Strings::substr('abcdef', 0, 8, '')); |
| 31 | - $this->assertEquals('f', Support\Strings::substr('abcdef', -1, 1, '')); |
|
| 31 | + $this->assertEquals('f', Support\Strings::substr('abcdef', -1, 1, '')); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | */ |
| 67 | 67 | public function testRandom(): void |
| 68 | 68 | { |
| 69 | - $this->assertEquals('aaaaaaa', Keys\Random::generateRandomText(7, ['a','a','a','a'])); |
|
| 69 | + $this->assertEquals('aaaaaaa', Keys\Random::generateRandomText(7, ['a', 'a', 'a', 'a'])); |
|
| 70 | 70 | |
| 71 | 71 | $lang = new Translations(); |
| 72 | 72 | $lib = new Keys\Random($lang, new TargetSearch($lang, new Support\InfoRam($lang), new Support\DataRam($lang))); |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | protected $keyLength = 64; |
| 18 | 18 | |
| 19 | 19 | /** @var string[] */ |
| 20 | - public static $possibilities = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']; |
|
| 20 | + public static $possibilities = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']; |
|
| 21 | 21 | |
| 22 | 22 | public function fromSharedKey(string $key): string |
| 23 | 23 | { |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | public function getTemporaryTargetLocation(): string |
| 124 | 124 | { |
| 125 | 125 | $this->checkFileBase(); |
| 126 | - return $this->targetDir . $this->fileBase . $this->addExt(). static::FILE_UPLOAD_SUFF; |
|
| 126 | + return $this->targetDir . $this->fileBase . $this->addExt() . static::FILE_UPLOAD_SUFF; |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | do { |
| 169 | 169 | $location = $this->fileBase . static::FILE_VER_SEP . $i; |
| 170 | 170 | $i++; |
| 171 | - } while ( $this->dataStorage->exists($this->targetDir . $location . $ext) ); |
|
| 171 | + } while ($this->dataStorage->exists($this->targetDir . $location . $ext)); |
|
| 172 | 172 | $this->fileBase = $location; |
| 173 | 173 | } |
| 174 | 174 | } |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | |
| 209 | 209 | protected function addExt(): string |
| 210 | 210 | { |
| 211 | - return ($this->hasExt() ? static::FILE_EXT_SEP . $this->fileExt : '' ); |
|
| 211 | + return ($this->hasExt() ? static::FILE_EXT_SEP . $this->fileExt : ''); |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | protected function hasExt(): bool |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | |
| 18 | 18 | public function __construct(int $bytesPerPart = null) |
| 19 | 19 | { |
| 20 | - $this->bytesPerPart = empty($bytesPerPart) ? static::DEFAULT_BYTES_PER_PART : $bytesPerPart ; |
|
| 20 | + $this->bytesPerPart = empty($bytesPerPart) ? static::DEFAULT_BYTES_PER_PART : $bytesPerPart; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | public function getBytesPerPart(): int |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | if (false === @$file->ftell()) { |
| 32 | 32 | throw new UploadException($this->lang->uppCannotOpenFile($location)); |
| 33 | 33 | } |
| 34 | - $position = is_null($seek) ? @$file->fseek(0, SEEK_END) : @$file->fseek($seek) ; |
|
| 34 | + $position = is_null($seek) ? @$file->fseek(0, SEEK_END) : @$file->fseek($seek); |
|
| 35 | 35 | if (-1 == $position) { |
| 36 | 36 | unset($file); |
| 37 | 37 | throw new UploadException($this->lang->uppCannotSeekFile($location)); |