MongoDbStorage::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 2
rs 10
1
<?php
2
3
/**
4
 * This file is part of the bugloos/fault-tolerance-bundle project.
5
 * (c) Bugloos <https://bugloos.com/>
6
 * For the full copyright and license information, please view
7
 * the LICENSE file that was distributed with this source code.
8
 */
9
10
namespace Bugloos\FaultToleranceBundle\RequestCache\Storage;
11
12
use Symfony\Component\Cache\Adapter\RedisAdapter;
13
use Symfony\Component\Cache\Adapter\RedisTagAwareAdapter;
14
15
/**
16
 * @author Mojtaba Gheytasi <[email protected]>
17
 */
18
class MongoDbStorage implements StorageInterface
19
{
20
    public function __construct(string $mongodbUrl)
0 ignored issues
show
Unused Code introduced by
The parameter $mongodbUrl is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

20
    public function __construct(/** @scrutinizer ignore-unused */ string $mongodbUrl)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
21
    {
22
    }
23
24
    public function get(string $bucket, string $key)
25
    {
26
        // TODO: Implement get() method.
27
    }
28
29
    public function set(string $bucket, string $key, $value, int $expiresAfterSeconds): void
30
    {
31
        // TODO: Implement set() method.
32
    }
33
34
    public function exists(string $bucket, string $key): bool
35
    {
36
        // TODO: Implement exists() method.
37
    }
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return boolean. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
38
39
    public function remove(string $bucket, string $key): void
40
    {
41
        // TODO: Implement remove() method.
42
    }
43
44
    public function removeBucket(string $bucket): void
45
    {
46
        // TODO: Implement removeBucket() method.
47
    }
48
}
49