@@ -39,6 +39,6 @@ |
||
39 | 39 | { |
40 | 40 | $bits = $this->persister->getBulk($this->getBits($value)); |
41 | 41 | |
42 | - return !in_array(0, $bits); |
|
42 | + return ! in_array(0, $bits); |
|
43 | 43 | } |
44 | 44 | } |
@@ -39,6 +39,6 @@ |
||
39 | 39 | { |
40 | 40 | $bits = $this->persister->getBulk($this->getBits($value)); |
41 | 41 | |
42 | - return !in_array(0, $bits); |
|
42 | + return ! in_array(0, $bits); |
|
43 | 43 | } |
44 | 44 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | $byte++; |
36 | 36 | |
37 | 37 | if ($byte > self::MAX_AMOUNT_PER_BIT) { |
38 | - throw new MaxLimitPerBitReached('max amount per bit should not be higher than ' . self::MAX_AMOUNT_PER_BIT); |
|
38 | + throw new MaxLimitPerBitReached('max amount per bit should not be higher than '.self::MAX_AMOUNT_PER_BIT); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | $this->bytes[$offsetByte] = chr($byte); |
@@ -42,7 +42,7 @@ |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | if ($low > self::MAX_AMOUNT_PER_BIT || $high > self::MAX_AMOUNT_PER_BIT) { |
45 | - throw new MaxLimitPerBitReached('max amount per bit should not be higher than ' . self::MAX_AMOUNT_PER_BIT); |
|
45 | + throw new MaxLimitPerBitReached('max amount per bit should not be higher than '.self::MAX_AMOUNT_PER_BIT); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | $this->bytes[$offsetByte] = chr($low | ($high << 4)); |
@@ -207,8 +207,8 @@ discard block |
||
207 | 207 | |
208 | 208 | protected function assertInit() |
209 | 209 | { |
210 | - if (!isset($this->setSize) || !isset($this->falsePositiveProbability)) { |
|
211 | - throw new NotInitialized(static::class . ' should be initialized'); |
|
210 | + if ( ! isset($this->setSize) || ! isset($this->falsePositiveProbability)) { |
|
211 | + throw new NotInitialized(static::class.' should be initialized'); |
|
212 | 212 | } |
213 | 213 | } |
214 | 214 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | return $bits; |
230 | 230 | } else { |
231 | 231 | return array_map( |
232 | - function ($bit) use ($offset) { |
|
232 | + function($bit) use ($offset) { |
|
233 | 233 | return $bit + ($offset * $this->bitSize); |
234 | 234 | }, |
235 | 235 | $bits |
@@ -275,6 +275,6 @@ discard block |
||
275 | 275 | */ |
276 | 276 | private function hash(string $value, int $index) |
277 | 277 | { |
278 | - return $this->hash->generate($value . $index) % $this->bitSize; |
|
278 | + return $this->hash->generate($value.$index) % $this->bitSize; |
|
279 | 279 | } |
280 | 280 | } |
@@ -43,10 +43,10 @@ |
||
43 | 43 | $bits = $this->getBits($value); |
44 | 44 | |
45 | 45 | for ($i = 0; $i <= $bloomFilterCount; ++$i) { |
46 | - $result = !in_array( |
|
46 | + $result = ! in_array( |
|
47 | 47 | 0, |
48 | 48 | $this->persister->getBulk(array_map( |
49 | - function ($bit) use ($i) { |
|
49 | + function($bit) use ($i) { |
|
50 | 50 | return $bit + ($i * $this->bitSize); |
51 | 51 | }, |
52 | 52 | $bits |
@@ -12,10 +12,10 @@ |
||
12 | 12 | */ |
13 | 13 | public function generate(string $value): string |
14 | 14 | { |
15 | - $value = array_values(unpack('C*',(string) $value)); |
|
15 | + $value = array_values(unpack('C*', (string) $value)); |
|
16 | 16 | $klen = count($value); |
17 | 17 | $h1 = 0; |
18 | - for ($i = 0, $bytes = $klen-($remainder = $klen & 3); $i < $bytes;) { |
|
18 | + for ($i = 0, $bytes = $klen - ($remainder = $klen & 3); $i < $bytes;) { |
|
19 | 19 | $k1 = $value[$i] |
20 | 20 | | ($value[++$i] << 8) |
21 | 21 | | ($value[++$i] << 16) |
@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | protected function doFetch($id) |
51 | 51 | { |
52 | - if (!$this->bloomFilter->has($id)) { |
|
52 | + if ( ! $this->bloomFilter->has($id)) { |
|
53 | 53 | return false; |
54 | 54 | } |
55 | 55 |