8000 fixed CS · symfony/security-acl@a1180fe · GitHub
[go: up one dir, main page]

Skip to content

Commit a1180fe

Browse files
committed
fixed CS
1 parent 8e155de commit a1180fe

File tree

5 files changed

+28
-29
lines changed

5 files changed

+28
-29
lines changed

Dbal/AclProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function findAcls(array $oids, array $sids = array())
104104
$currentBatch = array();
105105
$oidLookup = array();
106106

107-
for ($i=0,$c=count($oids); $i<$c; $i++) {
107+
for ($i = 0,$c = count($oids); $i<$c; $i++) {
108108
$oid = $oids[$i];
109109
$oidLookupKey = $oid->getIdentifier().$oid->getType();
110110
$oidLookup[$oidLookupKey] = $oid;
@@ -500,8 +500,8 @@ private function hydrateObjectIdentities(Statement $stmt, array $oidLookup, arra
500500
$acls = $aces = $emptyArray = array();
501501
$oidCache = $oidLookup;
502502
$result = new \SplObjectStorage();
503-
$loadedAces =& $this->loadedAces;
504-
$loadedAcls =& $this->loadedAcls;
503+
$loadedAces = & $this->loadedAces;
504+
$loadedAcls = & $this->loadedAcls;
505505
$permissionGrantingStrategy = $this->permissionGrantingStrategy;
506506

507507
// we need these to set protected properties on hydrated objects
@@ -593,7 +593,7 @@ private function hydrateObjectIdentities(Statement $stmt, array $oidLookup, arra
593593
// It is important to only ever have one ACE instance per actual row since
594594
// some ACEs are shared between ACL instances
595595
if (!isset($loadedAces[$aceId])) {
596-
if (!isset($sids[$key = ($username?'1':'0').$securityIdentifier])) {
596+
if (!isset($sids[$key = ($username ? '1' : '0').$securityIdentifier])) {
597597
if ($username) {
598598
$sids[$key] = new UserSecurityIdentity(
599599
substr($securityIdentifier, 1 + $pos = strpos($securityIdentifier, '-')),

Dbal/MutableAclProvider.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public function propertyChanged($sender, $propertyName, $oldValue, $newValue)
188188
$propertyChanges['aces'] = new \SplObjectStorage();
189189
}
190190

191-
$acePropertyChanges = $propertyChanges['aces']->contains($ace)? $propertyChanges['aces']->offsetGet($ace) : array();
191+
$acePropertyChanges = $propertyChanges['aces']->contains($ace) ? $propertyChanges['aces']->offsetGet($ace) : array();
192192

193193
if (isset($acePropertyChanges[$propertyName])) {
194194
$oldValue = $acePropertyChanges[$propertyName][0];
@@ -448,8 +448,8 @@ class_id,
448448
$query,
449449
$this->options['entry_table_name'],
450450
$classId,
451-
null === $objectIdentityId? 'NULL' : intval($objectIdentityId),
452-
null === $field? 'NULL' : $this->connection->quote($field),
451+
null === $objectIdentityId ? 'NULL' : intval($objectIdentityId),
452+
null === $field ? 'NULL' : $this->connection->quote($field),
453453
$aceOrder,
454454
$securityIdentityId,
455455
$mask,
@@ -767,7 +767,7 @@ private function updateNewFieldAceProperty($name, array $changes)
767767
$classIds = new \SplObjectStorage();
768768
$currentIds = array();
769769
foreach ($changes[1] as $field => $new) {
770-
for ($i=0,$c=count($new); $i<$c; $i++) {
770+
for ($i = 0,$c = count($new); $i<$c; $i++) {
771771
$ace = $new[$i];
772772

773773
if (null === $ace->getId()) {
@@ -844,7 +844,7 @@ private function updateNewAceProperty($name, array $changes)
844844
$sids = new \SplObjectStorage();
845845
$classIds = new \SplObjectStorage();
846846
$currentIds = array();
847-
for ($i=0,$c=count($new); $i<$c; $i++) {
847+
for ($i = 0,$c = count($new); $i<$c; $i++) {
848848
$ace = $new[$i];
849849

850850
if (null === $ace->getId()) {
@@ -887,7 +887,7 @@ private function updateOldAceProperty($name, array $changes)
887887
list($old, $new) = $changes;
888888
$currentIds = array();
889889

890-
for ($i=0,$c=count($new); $i<$c; $i++) {
890+
for ($i = 0,$c = count($new); $i<$c; $i++) {
891891
$ace = $new[$i];
892892

893893
if (null !== $ace->getId()) {
@@ -925,11 +925,11 @@ private function updateAce(\SplObjectStorage $aces, $ace)
925925
if (isset($propertyChanges['aceOrder'])
926926
&& $propertyChanges['aceOrder'][1] > $propertyChanges['aceOrder'][0]
927927
&& $propertyChanges == $aces->offsetGet($ace)) {
928-
$aces->next();
929-
if ($aces->valid()) {
930-
$this->updateAce($aces, $aces->current());
931-
}
928+
$aces->next();
929+
if ($aces->valid()) {
930+
$this->updateAce($aces, $aces->current());
932931
}
932+
}
933933

934934
if (isset($propertyChanges['mask'])) {
935935
$sets[] = sprintf('mask = %d', $propertyChanges['mask'][1]);
@@ -949,5 +949,4 @@ private function updateAce(\SplObjectStorage $aces, $ace)
949949

950950
$this->connection->executeQuery($this->getUpdateAccessControlEntrySql($ace->getId(), $sets));
951951
}
952-
953952
}

Domain/Acl.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function getClassAces()
125125
*/
126126
public function getClassFieldAces($field)
127127
{
128-
return isset($this->classFieldAces[$field])? $this->classFieldAces[$field] : array();
128+
return isset($this->classFieldAces[$field]) ? $this->classFieldAces[$field] : array();
129129
}
130130

131131
/**
@@ -403,7 +403,7 @@ public function updateObjectFieldAuditing($index, $field, $auditSuccess, $auditF
403403
*/
404404
private function deleteAce($property, $index)
405405
{
406-
$aces =& $this->$property;
406+
$aces = & $this->$property;
407407
if (!isset($aces[$index])) {
408408
throw new \OutOfBoundsException(sprintf('The index "%d" does not exist.', $index));
409409
}
@@ -413,7 +413,7 @@ private function deleteAce($property, $index)
413413
$this->$property = array_values($this->$property);
414414
$this->onPropertyChanged($property, $oldValue, $this->$property);
415415

416-
for ($i=$index,$c=count($this->$property); $i<$c; $i++) {
416+
for ($i = $index,$c = count($this->$property); $i<$c; $i++) {
417417
$this->onEntryPropertyChanged($aces[$i], 'aceOrder', $i+1, $i);
418418
}
419419
}
@@ -428,7 +428,7 @@ private function deleteAce($property, $index)
428428
*/
429429
private function deleteFieldAce($property, $index, $field)
430430
{
431-
$aces =& $this->$property;
431+
$aces = & $this->$property;
432432
if (!isset($aces[$field][$index])) {
433433
throw new \OutOfBoundsException(sprintf('The index "%d" does not exist.', $index));
434434
}
@@ -438,7 +438,7 @@ private function deleteFieldAce($property, $index, $field)
438438
$aces[$field] = array_values($aces[$field]);
439439
$this->onPropertyChanged($property, $oldValue, $this->$property);
440440

441-
for ($i=$index,$c=count($aces[$field]); $i<$c; $i++) {
441+
for ($i = $index,$c = count($aces[$field]); $i<$c; $i++) {
442442
$this->onEntryPropertyChanged($aces[$field][$i], 'aceOrder', $i+1, $i);
443443
}
444444
}
@@ -473,7 +473,7 @@ private function insertAce($property, $index, $mask, SecurityIdentityInterface $
473473
}
474474
}
475475

476-
$aces =& $this->$property;
476+
$aces = & $this->$property;
477477
$oldValue = $this->$property;
478478
if (isset($aces[$index])) {
479479
$this->$property = array_merge(
@@ -482,7 +482,7 @@ private function insertAce($property, $index, $mask, SecurityIdentityInterface $
482482
array_slice($this->$property, $index)
483483
);
484484

485-
for ($i=$index,$c=count($this->$property)-1; $i<$c; $i++) {
485+
for ($i = $index,$c = count($this->$property)-1; $i<$c; $i++) {
486486
$this->onEntryPropertyChanged($aces[$i+1], 'aceOrder', $i, $i+1);
487487
}
488488
}
@@ -522,7 +522,7 @@ private function insertFieldAce($property, $index, $field, $mask, SecurityIdenti
522522
}
523523
}
524524

525-
$aces =& $this->$property;
525+
$aces = & $this->$property;
526526
if (!isset($aces[$field])) {
527527
$aces[$field] = array();
528528
}
@@ -539,7 +539,7 @@ private function insertFieldAce($property, $index, $field, $mask, SecurityIdenti
539539
array_slice($aces[$field], $index)
540540
);
541541

542-
for ($i=$index,$c=count($aces[$field])-1; $i<$c; $i++) {
542+
for ($i = $index,$c = count($aces[$field])-1; $i<$c; $i++) {
543543
$this->onEntryPropertyChanged($aces[$field][$i+1], 'aceOrder', $i, $i+1);
544544
}
545545
}
@@ -559,7 +559,7 @@ private function insertFieldAce($property, $index, $field, $mask, SecurityIdenti
559559
*/
560560
private function updateAce($property, $index, $mask, $strategy = null)
561561
{
562-
$aces =& $this->$property;
562+
$aces = & $this->$property;
563563
if (!isset($aces[$index])) {
564564
throw new \OutOfBoundsException(sprintf('The index "%d" does not exist.', $index));
565565
}
@@ -618,7 +618,7 @@ private function updateFieldAce($property, $index, $field, $mask, $strategy = nu
618618
throw new \InvalidArgumentException('$field cannot be empty.');
619619
}
620620

621-
$aces =& $this->$property;
621+
$aces = & $this->$property;
622622
if (!isset($aces[$field][$index])) {
623623
throw new \OutOfBoundsException(sprintf('The index "%d" does not exist.', $index));
624624
}

Permission/MaskBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function getPattern()
128128
$length = strlen($pattern);
129129
$bitmask = str_pad(decbin($this->mask), $length, '0', STR_PAD_LEFT);
130130

131-
for ($i=$length-1; $i>=0; $i--) {
131+
for ($i = $length-1; $i >= 0; $i--) {
132132
if ('1' === $bitmask[$i]) {
133133
try {
134134
$pattern[$i] = self::getCode(1 << ($length - $i - 1));

Voter/AclVoter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function vote(TokenInterface $token, $object, array $attributes)
6464

6565
if (null === $object) {
6666
if (null !== $this->logger) {
67-
$this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain'));
67+
$this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable ? 'grant access' : 'abstain'));
6868
}
6969

7070
return $this->allowIfObjectIdentityUnavailable ? self::ACCESS_GRANTED : self::ACCESS_ABSTAIN;
@@ -79,7 +79,7 @@ public function vote(TokenInterface $token, $object, array $attributes)
7979
$oid = $object;
8080
} elseif (null === $oid = $this->objectIdentityRetrievalStrategy->getObjectIdentity($object)) {
8181
if (null !== $this->logger) {
82-
$this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain'));
82+
$this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable ? 'grant access' : 'abstain'));
8383
}
8484

8585
return $this->allowIfObjectIdentityUnavailable ? self::ACCESS_GRANTED : self::ACCESS_ABSTAIN;

0 commit comments

Comments
 (0)
0