Passed
Pull Request — master (#56)
by Matthieu
07:03
created

StubbedTenant::getUserIdentifier()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types = 1);
2
3
namespace AtlassianConnectBundle\Tests\Security;
4
5
use AtlassianConnectBundle\Entity\TenantInterface;
6
use Symfony\Component\Security\Core\Role\Role;
7
8
/**
9
 * Class StubbedTenant
10
 */
11
class StubbedTenant implements TenantInterface
12
{
13
    /**
14
     * @return array<string>|array<Role>
15
     */
16
    public function getRoles(): array
17
    {
18
        return ['ROLE_USER'];
19
    }
20
21
    /**
22
     * @return string|null
23
     */
24
    public function getSharedSecret(): ?string
25
    {
26
    }
27
28
    /**
29
     * @return string|null
30
     */
31
    public function getOauthClientId(): ?string
32
    {
33
    }
34
35
    /**
36
     * @return string|null
37
     */
38
    public function getBaseUrl(): ?string
39
    {
40
    }
41
42
    /**
43
     * @return string|null
44
     */
45
    public function getAddonKey(): ?string
46
    {
47
    }
48
49
    /**
50
     * @param string $name
51
     *
52
     * @return TenantInterface
53
     */
54
    public function setUsername(string $name): TenantInterface
55
    {
56
    }
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 AtlassianConnectBundle\Entity\TenantInterface. 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...
57
58
    /**
59
     * @param string $addonKey
60
     *
61
     * @return TenantInterface
62
     */
63
    public function setAddonKey(string $addonKey): TenantInterface
64
    {
65
    }
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 AtlassianConnectBundle\Entity\TenantInterface. 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...
66
67
    /**
68
     * @param string $clientKey
69
     *
70
     * @return TenantInterface
71
     */
72
    public function setClientKey(string $clientKey): TenantInterface
73
    {
74
    }
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 AtlassianConnectBundle\Entity\TenantInterface. 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...
75
76
    /**
77
     * @param string $publicKey
78
     *
79
     * @return TenantInterface
80
     */
81
    public function setPublicKey(string $publicKey): TenantInterface
82
    {
83
    }
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 AtlassianConnectBundle\Entity\TenantInterface. 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...
84
85
    /**
86
     * @param string $sharedSecret
87
     *
88
     * @return TenantInterface
89
     */
90
    public function setSharedSecret(string $sharedSecret): TenantInterface
91
    {
92
    }
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 AtlassianConnectBundle\Entity\TenantInterface. 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...
93
94
    /**
95
     * @param string $serverVersion
96
     *
97
     * @return TenantInterface
98
     */
99
    public function setServerVersion(string $serverVersion): TenantInterface
100
    {
101
    }
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 AtlassianConnectBundle\Entity\TenantInterface. 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...
102
103
    /**
104
     * @param string $pluginsVersion
105
     *
106
     * @return TenantInterface
107
     */
108
    public function setPluginsVersion(string $pluginsVersion): TenantInterface
109
    {
110
    }
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 AtlassianConnectBundle\Entity\TenantInterface. 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...
111
112
    /**
113
     * @param string $baseUrl
114
     *
115
     * @return TenantInterface
116
     */
117
    public function setBaseUrl(string $baseUrl): TenantInterface
118
    {
119
    }
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 AtlassianConnectBundle\Entity\TenantInterface. 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...
120
121
    /**
122
     * @param string $productType
123
     *
124
     * @return TenantInterface
125
     */
126
    public function setProductType(string $productType): TenantInterface
127
    {
128
    }
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 AtlassianConnectBundle\Entity\TenantInterface. 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...
129
130
    /**
131
     * @param string $description
132
     *
133
     * @return TenantInterface
134
     */
135
    public function setDescription(string $description): TenantInterface
136
    {
137
    }
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 AtlassianConnectBundle\Entity\TenantInterface. 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...
138
139
    /**
140
     * @param string $eventType
141
     *
142
     * @return TenantInterface
143
     */
144
    public function setEventType(string $eventType): TenantInterface
145
    {
146
    }
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 AtlassianConnectBundle\Entity\TenantInterface. 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...
147
148
    /**
149
     * @param string|null $oauthClientId
150
     *
151
     * @return TenantInterface
152
     */
153
    public function setOauthClientId(?string $oauthClientId): TenantInterface
154
    {
155
    }
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 AtlassianConnectBundle\Entity\TenantInterface. 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...
156
157
    /**
158
     * @return string|void
159
     */
160
    public function getPassword(): ?string
161
    {
162
    }
163
164
    /**
165
     * @return string|null
166
     */
167
    public function getSalt(): ?string
168
    {
169
    }
170
171
    /**
172
     * @return string|null
173
     */
174
    public function getUsername(): ?string
175
    {
176
    }
177
178
    /**
179
     * @return string
180
     */
181
    public function getUserIdentifier(): string
182
    {
183
        return 'tenant';
184
    }
185
186
    /**
187
     * @return void
188
     */
189
    public function eraseCredentials(): void
190
    {
191
    }
192
}
193