Skip to content

Commit 432122a

Browse files
minor #29009 SCA: simplify some ifs in favour of null coalescing operator (kalessil, vladimir.reznichenko)
This PR was merged into the 4.1 branch. Discussion ---------- SCA: simplify some ifs in favour of null coalescing operator | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Some of ifs were replaced with null coalescing operator in order to simplify control flow. Commits ------- 636a872389 SCA: reverted code style changes c926b1abd3 SCA: reverted code style changes 300b31fa75 SCA: applied requested code style changes 0180cb936f SCA: simplify some ifs in favour of null coalescing operator
2 parents e918045 + 7b975b5 commit 432122a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Helper/Table.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,7 @@ public function setColumnStyle($columnIndex, $name)
180180
*/
181181
public function getColumnStyle($columnIndex)
182182
{
183-
if (isset($this->columnStyles[$columnIndex])) {
184-
return $this->columnStyles[$columnIndex];
185-
}
186-
187-
return $this->getStyle();
183+
return $this->columnStyles[$columnIndex] ?? $this->getStyle();
188184
}
189185

190186
/**

0 commit comments

Comments
 (0)