Controller   A
last analyzed

Complexity

Total Complexity 39

Size/Duplication

Total Lines 286
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 39
eloc 105
dl 0
loc 286
rs 9.28
c 0
b 0
f 0

13 Methods

Rating   Name   Duplication   Size   Complexity  
B updateAceProperty() 0 44 8
A createObjectIdentity() 0 5 1
B updateFieldAceProperty() 0 45 10
A contactAction() 0 14 2
A deleteAccessControlEntries() 0 3 1
A deleteObjectIdentity() 0 3 1
A indexAction() 0 3 1
A deleteObjectIdentityRelations() 0 3 1
A helloAction() 0 3 1
B updateAces() 0 23 7
A createOrRetrieveClassId() 0 9 2
A createOrRetrieveSecurityIdentityId() 0 9 2
A regenerateAncestorRelations() 0 11 2
1
<?php
2
3
namespace Doctrine\Tests\Annotations\Fixtures;
4
5
use Doctrine\Tests\Annotations\Fixtures\Annotation\Template;
6
use Doctrine\Tests\Annotations\Fixtures\Annotation\Route;
7
8
/**
9
 * @Route("/someprefix")
10
 * @author Johannes M. Schmitt <[email protected]>
11
 */
12
class Controller
13
{
14
    /**
15
     * @Route("/", name="_demo")
16
     * @Template()
17
     */
18
    public function indexAction()
19
    {
20
        return [];
21
    }
22
23
    /**
24
     * @Route("/hello/{name}", name="_demo_hello")
25
     * @Template()
26
     */
27
    public function helloAction($name)
28
    {
29
        return ['name' => $name];
30
    }
31
32
    /**
33
     * @Route("/contact", name="_demo_contact")
34
     * @Template()
35
     */
36
    public function contactAction()
37
    {
38
        $form = ContactForm::create($this->get('form.context'), 'contact');
0 ignored issues
show
Bug introduced by
The method get() does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. ( Ignorable by Annotation )

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

38
        $form = ContactForm::create($this->/** @scrutinizer ignore-call */ get('form.context'), 'contact');

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The type Doctrine\Tests\Annotations\Fixtures\ContactForm was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
39
40
        $form->bind($this->container->get('request'), $form);
0 ignored issues
show
Bug Best Practice introduced by
The property container does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. Did you maybe forget to declare it?
Loading history...
41
        if ($form->isValid()) {
42
            $form->send($this->get('mailer'));
43
44
            $this->get('session')->setFlash('notice', 'Message sent!');
45
46
            return new RedirectResponse($this->generateUrl('_demo'));
0 ignored issues
show
Bug introduced by
The method generateUrl() does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. ( Ignorable by Annotation )

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

46
            return new RedirectResponse($this->/** @scrutinizer ignore-call */ generateUrl('_demo'));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The type Doctrine\Tests\Annotatio...xtures\RedirectResponse was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
47
        }
48
49
        return ['form' => $form];
50
    }
51
52
    /**
53
     * Creates the ACL for the passed object identity
54
     *
55
     * @param ObjectIdentityInterface $oid
56
     * @return void
57
     */
58
    private function createObjectIdentity(ObjectIdentityInterface $oid)
0 ignored issues
show
Bug introduced by
The type Doctrine\Tests\Annotatio...ObjectIdentityInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
Unused Code introduced by
The method createObjectIdentity() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
59
    {
60
        $classId = $this->createOrRetrieveClassId($oid->getType());
61
62
        $this->connection->executeQuery($this->getInsertObjectIdentitySql($oid->getIdentifier(), $classId, true));
0 ignored issues
show
Bug Best Practice introduced by
The property connection does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. Did you maybe forget to declare it?
Loading history...
Bug introduced by
The method getInsertObjectIdentitySql() does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. ( Ignorable by Annotation )

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

62
        $this->connection->executeQuery($this->/** @scrutinizer ignore-call */ getInsertObjectIdentitySql($oid->getIdentifier(), $classId, true));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
63
    }
64
65
    /**
66
     * Returns the primary key for the passed class type.
67
     *
68
     * If the type does not yet exist in the database, it will be created.
69
     *
70
     * @param string $classType
71
     * @return integer
72
     */
73
    private function createOrRetrieveClassId($classType)
74
    {
75
        if (false !== $id = $this->connection->executeQuery($this->getSelectClassIdSql($classType))->fetchColumn()) {
0 ignored issues
show
Bug introduced by
The method getSelectClassIdSql() does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. ( Ignorable by Annotation )

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

75
        if (false !== $id = $this->connection->executeQuery($this->/** @scrutinizer ignore-call */ getSelectClassIdSql($classType))->fetchColumn()) {

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug Best Practice introduced by
The property connection does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. Did you maybe forget to declare it?
Loading history...
76
            return $id;
77
        }
78
79
        $this->connection->executeQuery($this->getInsertClassSql($classType));
0 ignored issues
show
Bug introduced by
The method getInsertClassSql() does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. ( Ignorable by Annotation )

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

79
        $this->connection->executeQuery($this->/** @scrutinizer ignore-call */ getInsertClassSql($classType));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
80
81
        return $this->connection->executeQuery($this->getSelectClassIdSql($classType))->fetchColumn();
82
    }
83
84
    /**
85
     * Returns the primary key for the passed security identity.
86
     *
87
     * If the security identity does not yet exist in the database, it will be
88
     * created.
89
     *
90
     * @param SecurityIdentityInterface $sid
91
     * @return integer
92
     */
93
    private function createOrRetrieveSecurityIdentityId(SecurityIdentityInterface $sid)
0 ignored issues
show
Bug introduced by
The type Doctrine\Tests\Annotatio...curityIdentityInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
94
    {
95
        if (false !== $id = $this->connection->executeQuery($this->getSelectSecurityIdentityIdSql($sid))->fetchColumn()) {
0 ignored issues
show
Bug Best Practice introduced by
The property connection does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. Did you maybe forget to declare it?
Loading history...
Bug introduced by
The method getSelectSecurityIdentityIdSql() does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. ( Ignorable by Annotation )

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

95
        if (false !== $id = $this->connection->executeQuery($this->/** @scrutinizer ignore-call */ getSelectSecurityIdentityIdSql($sid))->fetchColumn()) {

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
96
            return $id;
97
        }
98
99
        $this->connection->executeQuery($this->getInsertSecurityIdentitySql($sid));
0 ignored issues
show
Bug introduced by
The method getInsertSecurityIdentitySql() does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. ( Ignorable by Annotation )

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

99
        $this->connection->executeQuery($this->/** @scrutinizer ignore-call */ getInsertSecurityIdentitySql($sid));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
100
101
        return $this->connection->executeQuery($this->getSelectSecurityIdentityIdSql($sid))->fetchColumn();
102
    }
103
104
    /**
105
     * Deletes all ACEs for the given object identity primary key.
106
     *
107
     * @param integer $oidPK
108
     * @return void
109
     */
110
    private function deleteAccessControlEntries($oidPK)
0 ignored issues
show
Unused Code introduced by
The method deleteAccessControlEntries() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
111
    {
112
        $this->connection->executeQuery($this->getDeleteAccessControlEntriesSql($oidPK));
0 ignored issues
show
Bug introduced by
The method getDeleteAccessControlEntriesSql() does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. ( Ignorable by Annotation )

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

112
        $this->connection->executeQuery($this->/** @scrutinizer ignore-call */ getDeleteAccessControlEntriesSql($oidPK));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug Best Practice introduced by
The property connection does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. Did you maybe forget to declare it?
Loading history...
113
    }
114
115
    /**
116
     * Deletes the object identity from the database.
117
     *
118
     * @param integer $pk
119
     * @return void
120
     */
121
    private function deleteObjectIdentity($pk)
0 ignored issues
show
Unused Code introduced by
The method deleteObjectIdentity() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
122
    {
123
        $this->connection->executeQuery($this->getDeleteObjectIdentitySql($pk));
0 ignored issues
show
Bug introduced by
The method getDeleteObjectIdentitySql() does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. ( Ignorable by Annotation )

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

123
        $this->connection->executeQuery($this->/** @scrutinizer ignore-call */ getDeleteObjectIdentitySql($pk));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug Best Practice introduced by
The property connection does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. Did you maybe forget to declare it?
Loading history...
124
    }
125
126
    /**
127
     * Deletes all entries from the relations table from the database.
128
     *
129
     * @param integer $pk
130
     * @return void
131
     */
132
    private function deleteObjectIdentityRelations($pk)
0 ignored issues
show
Unused Code introduced by
The method deleteObjectIdentityRelations() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
133
    {
134
        $this->connection->executeQuery($this->getDeleteObjectIdentityRelationsSql($pk));
0 ignored issues
show
Bug introduced by
The method getDeleteObjectIdentityRelationsSql() does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. ( Ignorable by Annotation )

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

134
        $this->connection->executeQuery($this->/** @scrutinizer ignore-call */ getDeleteObjectIdentityRelationsSql($pk));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug Best Practice introduced by
The property connection does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. Did you maybe forget to declare it?
Loading history...
135
    }
136
137
    /**
138
     * This regenerates the ancestor table which is used for fast read access.
139
     *
140
     * @param AclInterface $acl
141
     * @return void
142
     */
143
    private function regenerateAncestorRelations(AclInterface $acl)
0 ignored issues
show
Bug introduced by
The type Doctrine\Tests\Annotations\Fixtures\AclInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
Unused Code introduced by
The method regenerateAncestorRelations() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
144
    {
145
        $pk = $acl->getId();
146
        $this->connection->executeQuery($this->getDeleteObjectIdentityRelationsSql($pk));
0 ignored issues
show
Bug Best Practice introduced by
The property connection does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. Did you maybe forget to declare it?
Loading history...
147
        $this->connection->executeQuery($this->getInsertObjectIdentityRelationSql($pk, $pk));
0 ignored issues
show
Bug introduced by
The method getInsertObjectIdentityRelationSql() does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. ( Ignorable by Annotation )

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

147
        $this->connection->executeQuery($this->/** @scrutinizer ignore-call */ getInsertObjectIdentityRelationSql($pk, $pk));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
148
149
        $parentAcl = $acl->getParentAcl();
150
        while (null !== $parentAcl) {
151
            $this->connection->executeQuery($this->getInsertObjectIdentityRelationSql($pk, $parentAcl->getId()));
152
153
            $parentAcl = $parentAcl->getParentAcl();
154
        }
155
    }
156
157
    /**
158
     * This processes changes on an ACE related property (classFieldAces, or objectFieldAces).
159
     *
160
     * @param string $name
161
     * @param array $changes
162
     * @return void
163
     */
164
    private function updateFieldAceProperty($name, array $changes)
0 ignored issues
show
Unused Code introduced by
The method updateFieldAceProperty() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
165
    {
166
        $sids = new \SplObjectStorage();
167
        $classIds = new \SplObjectStorage();
168
        $currentIds = [];
169
        foreach ($changes[1] as $field => $new) {
170
            for ($i=0,$c=count($new); $i<$c; $i++) {
171
                $ace = $new[$i];
172
173
                if (null === $ace->getId()) {
174
                    if ($sids->contains($ace->getSecurityIdentity())) {
175
                        $sid = $sids->offsetGet($ace->getSecurityIdentity());
176
                    } else {
177
                        $sid = $this->createOrRetrieveSecurityIdentityId($ace->getSecurityIdentity());
178
                    }
179
180
                    $oid = $ace->getAcl()->getObjectIdentity();
181
                    if ($classIds->contains($oid)) {
182
                        $classId = $classIds->offsetGet($oid);
183
                    } else {
184
                        $classId = $this->createOrRetrieveClassId($oid->getType());
185
                    }
186
187
                    $objectIdentityId = $name === 'classFieldAces' ? null : $ace->getAcl()->getId();
188
189
                    $this->connection->executeQuery($this->getInsertAccessControlEntrySql($classId, $objectIdentityId, $field, $i, $sid, $ace->getStrategy(), $ace->getMask(), $ace->isGranting(), $ace->isAuditSuccess(), $ace->isAuditFailure()));
0 ignored issues
show
Bug Best Practice introduced by
The property connection does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. Did you maybe forget to declare it?
Loading history...
Bug introduced by
The method getInsertAccessControlEntrySql() does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. ( Ignorable by Annotation )

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

189
                    $this->connection->executeQuery($this->/** @scrutinizer ignore-call */ getInsertAccessControlEntrySql($classId, $objectIdentityId, $field, $i, $sid, $ace->getStrategy(), $ace->getMask(), $ace->isGranting(), $ace->isAuditSuccess(), $ace->isAuditFailure()));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
190
                    $aceId = $this->connection->executeQuery($this->getSelectAccessControlEntryIdSql($classId, $objectIdentityId, $field, $i))->fetchColumn();
0 ignored issues
show
Bug introduced by
The method getSelectAccessControlEntryIdSql() does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. ( Ignorable by Annotation )

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

190
                    $aceId = $this->connection->executeQuery($this->/** @scrutinizer ignore-call */ getSelectAccessControlEntryIdSql($classId, $objectIdentityId, $field, $i))->fetchColumn();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
191
                    $this->loadedAces[$aceId] = $ace;
0 ignored issues
show
Bug Best Practice introduced by
The property loadedAces does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
192
193
                    $aceIdProperty = new \ReflectionProperty('Symfony\Component\Security\Acl\Domain\Entry', 'id');
194
                    $aceIdProperty->setAccessible(true);
195
                    $aceIdProperty->setValue($ace, (int) $aceId);
196
                } else {
197
                    $currentIds[$ace->getId()] = true;
198
                }
199
            }
200
        }
201
202
        foreach ($changes[0] as $old) {
203
            for ($i=0,$c=count($old); $i<$c; $i++) {
204
                $ace = $old[$i];
205
206
                if (!isset($currentIds[$ace->getId()])) {
207
                    $this->connection->executeQuery($this->getDeleteAccessControlEntrySql($ace->getId()));
0 ignored issues
show
Bug introduced by
The method getDeleteAccessControlEntrySql() does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. ( Ignorable by Annotation )

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

207
                    $this->connection->executeQuery($this->/** @scrutinizer ignore-call */ getDeleteAccessControlEntrySql($ace->getId()));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
208
                    unset($this->loadedAces[$ace->getId()]);
209
                }
210
            }
211
        }
212
    }
213
214
    /**
215
     * This processes changes on an ACE related property (classAces, or objectAces).
216
     *
217
     * @param string $name
218
     * @param array $changes
219
     * @return void
220
     */
221
    private function updateAceProperty($name, array $changes)
0 ignored issues
show
Unused Code introduced by
The method updateAceProperty() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
222
    {
223
        list($old, $new) = $changes;
224
225
        $sids = new \SplObjectStorage();
226
        $classIds = new \SplObjectStorage();
227
        $currentIds = [];
228
        for ($i=0,$c=count($new); $i<$c; $i++) {
229
            $ace = $new[$i];
230
231
            if (null === $ace->getId()) {
232
                if ($sids->contains($ace->getSecurityIdentity())) {
233
                    $sid = $sids->offsetGet($ace->getSecurityIdentity());
234
                } else {
235
                    $sid = $this->createOrRetrieveSecurityIdentityId($ace->getSecurityIdentity());
236
                }
237
238
                $oid = $ace->getAcl()->getObjectIdentity();
239
                if ($classIds->contains($oid)) {
240
                    $classId = $classIds->offsetGet($oid);
241
                } else {
242
                    $classId = $this->createOrRetrieveClassId($oid->getType());
243
                }
244
245
                $objectIdentityId = $name === 'classAces' ? null : $ace->getAcl()->getId();
246
247
                $this->connection->executeQuery($this->getInsertAccessControlEntrySql($classId, $objectIdentityId, null, $i, $sid, $ace->getStrategy(), $ace->getMask(), $ace->isGranting(), $ace->isAuditSuccess(), $ace->isAuditFailure()));
0 ignored issues
show
Bug Best Practice introduced by
The property connection does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. Did you maybe forget to declare it?
Loading history...
248
                $aceId = $this->connection->executeQuery($this->getSelectAccessControlEntryIdSql($classId, $objectIdentityId, null, $i))->fetchColumn();
249
                $this->loadedAces[$aceId] = $ace;
0 ignored issues
show
Bug Best Practice introduced by
The property loadedAces does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
250
251
                $aceIdProperty = new \ReflectionProperty($ace, 'id');
252
                $aceIdProperty->setAccessible(true);
253
                $aceIdProperty->setValue($ace, (int) $aceId);
254
            } else {
255
                $currentIds[$ace->getId()] = true;
256
            }
257
        }
258
259
        for ($i=0,$c=count($old); $i<$c; $i++) {
260
            $ace = $old[$i];
261
262
            if (!isset($currentIds[$ace->getId()])) {
263
                $this->connection->executeQuery($this->getDeleteAccessControlEntrySql($ace->getId()));
264
                unset($this->loadedAces[$ace->getId()]);
265
            }
266
        }
267
    }
268
269
    /**
270
     * Persists the changes which were made to ACEs to the database.
271
     *
272
     * @param \SplObjectStorage $aces
273
     * @return void
274
     */
275
    private function updateAces(\SplObjectStorage $aces)
0 ignored issues
show
Unused Code introduced by
The method updateAces() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
276
    {
277
        foreach ($aces as $ace) {
278
            $propertyChanges = $aces->offsetGet($ace);
279
            $sets = [];
280
281
            if (isset($propertyChanges['mask'])) {
282
                $sets[] = sprintf('mask = %d', $propertyChanges['mask'][1]);
283
            }
284
            if (isset($propertyChanges['strategy'])) {
285
                $sets[] = sprintf('granting_strategy = %s', $this->connection->quote($propertyChanges['strategy']));
0 ignored issues
show
Bug Best Practice introduced by
The property connection does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. Did you maybe forget to declare it?
Loading history...
286
            }
287
            if (isset($propertyChanges['aceOrder'])) {
288
                $sets[] = sprintf('ace_order = %d', $propertyChanges['aceOrder'][1]);
289
            }
290
            if (isset($propertyChanges['auditSuccess'])) {
291
                $sets[] = sprintf('audit_success = %s', $this->connection->getDatabasePlatform()->convertBooleans($propertyChanges['auditSuccess'][1]));
292
            }
293
            if (isset($propertyChanges['auditFailure'])) {
294
                $sets[] = sprintf('audit_failure = %s', $this->connection->getDatabasePlatform()->convertBooleans($propertyChanges['auditFailure'][1]));
295
            }
296
297
            $this->connection->executeQuery($this->getUpdateAccessControlEntrySql($ace->getId(), $sets));
0 ignored issues
show
Bug introduced by
The method getUpdateAccessControlEntrySql() does not exist on Doctrine\Tests\Annotations\Fixtures\Controller. ( Ignorable by Annotation )

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

297
            $this->connection->executeQuery($this->/** @scrutinizer ignore-call */ getUpdateAccessControlEntrySql($ace->getId(), $sets));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
298
        }
299
    }
300
}
301