@@ -212,8 +212,8 @@ public function expandBorderShorthand(): void
212
212
if (!isset ($ aRules [$ sBorderRule ])) {
213
213
continue ;
214
214
}
215
- $ oRule = $ aRules [$ sBorderRule ];
216
- $ mRuleValue = $ oRule ->getValue ();
215
+ $ rule = $ aRules [$ sBorderRule ];
216
+ $ mRuleValue = $ rule ->getValue ();
217
217
$ aValues = [];
218
218
if (!$ mRuleValue instanceof RuleValueList) {
219
219
$ aValues [] = $ mRuleValue ;
@@ -237,8 +237,8 @@ public function expandBorderShorthand(): void
237
237
$ sNewRuleName = $ sBorderRule . '-style ' ;
238
238
}
239
239
}
240
- $ oNewRule = new Rule ($ sNewRuleName , $ oRule ->getLineNo (), $ oRule ->getColNo ());
241
- $ oNewRule ->setIsImportant ($ oRule ->getIsImportant ());
240
+ $ oNewRule = new Rule ($ sNewRuleName , $ rule ->getLineNo (), $ rule ->getColNo ());
241
+ $ oNewRule ->setIsImportant ($ rule ->getIsImportant ());
242
242
$ oNewRule ->addValue ([$ mNewValue ]);
243
243
$ this ->addRule ($ oNewRule );
244
244
}
@@ -268,8 +268,8 @@ public function expandDimensionsShorthand(): void
268
268
if (!isset ($ aRules [$ sProperty ])) {
269
269
continue ;
270
270
}
271
- $ oRule = $ aRules [$ sProperty ];
272
- $ mRuleValue = $ oRule ->getValue ();
271
+ $ rule = $ aRules [$ sProperty ];
272
+ $ mRuleValue = $ rule ->getValue ();
273
273
$ aValues = [];
274
274
if (!$ mRuleValue instanceof RuleValueList) {
275
275
$ aValues [] = $ mRuleValue ;
@@ -298,8 +298,8 @@ public function expandDimensionsShorthand(): void
298
298
break ;
299
299
}
300
300
foreach (['top ' , 'right ' , 'bottom ' , 'left ' ] as $ sPosition ) {
301
- $ oNewRule = new Rule (\sprintf ($ sExpanded , $ sPosition ), $ oRule ->getLineNo (), $ oRule ->getColNo ());
302
- $ oNewRule ->setIsImportant ($ oRule ->getIsImportant ());
301
+ $ oNewRule = new Rule (\sprintf ($ sExpanded , $ sPosition ), $ rule ->getLineNo (), $ rule ->getColNo ());
302
+ $ oNewRule ->setIsImportant ($ rule ->getIsImportant ());
303
303
$ oNewRule ->addValue ($ {$ sPosition });
304
304
$ this ->addRule ($ oNewRule );
305
305
}
@@ -320,7 +320,7 @@ public function expandFontShorthand(): void
320
320
if (!isset ($ aRules ['font ' ])) {
321
321
return ;
322
322
}
323
- $ oRule = $ aRules ['font ' ];
323
+ $ rule = $ aRules ['font ' ];
324
324
// reset properties to 'normal' per http://www.w3.org/TR/21/fonts.html#font-shorthand
325
325
$ aFontProperties = [
326
326
'font-style ' => 'normal ' ,
@@ -329,7 +329,7 @@ public function expandFontShorthand(): void
329
329
'font-size ' => 'normal ' ,
330
330
'line-height ' => 'normal ' ,
331
331
];
332
- $ mRuleValue = $ oRule ->getValue ();
332
+ $ mRuleValue = $ rule ->getValue ();
333
333
$ aValues = [];
334
334
if (!$ mRuleValue instanceof RuleValueList) {
335
335
$ aValues [] = $ mRuleValue ;
@@ -366,9 +366,9 @@ public function expandFontShorthand(): void
366
366
}
367
367
}
368
368
foreach ($ aFontProperties as $ sProperty => $ mValue ) {
369
- $ oNewRule = new Rule ($ sProperty , $ oRule ->getLineNo (), $ oRule ->getColNo ());
369
+ $ oNewRule = new Rule ($ sProperty , $ rule ->getLineNo (), $ rule ->getColNo ());
370
370
$ oNewRule ->addValue ($ mValue );
371
- $ oNewRule ->setIsImportant ($ oRule ->getIsImportant ());
371
+ $ oNewRule ->setIsImportant ($ rule ->getIsImportant ());
372
372
$ this ->addRule ($ oNewRule );
373
373
}
374
374
$ this ->removeRule ('font ' );
@@ -389,7 +389,7 @@ public function expandBackgroundShorthand(): void
389
389
if (!isset ($ aRules ['background ' ])) {
390
390
return ;
391
391
}
392
- $ oRule = $ aRules ['background ' ];
392
+ $ rule = $ aRules ['background ' ];
393
393
$ aBgProperties = [
394
394
'background-color ' => ['transparent ' ],
395
395
'background-image ' => ['none ' ],
@@ -400,7 +400,7 @@ public function expandBackgroundShorthand(): void
400
400
new Size (0 , '% ' , false , $ this ->lineNumber ),
401
401
],
402
402
];
403
- $ mRuleValue = $ oRule ->getValue ();
403
+ $ mRuleValue = $ rule ->getValue ();
404
404
$ aValues = [];
405
405
if (!$ mRuleValue instanceof RuleValueList) {
406
406
$ aValues [] = $ mRuleValue ;
@@ -409,9 +409,9 @@ public function expandBackgroundShorthand(): void
409
409
}
410
410
if (\count ($ aValues ) == 1 && $ aValues [0 ] == 'inherit ' ) {
411
411
foreach ($ aBgProperties as $ sProperty => $ mValue ) {
412
- $ oNewRule = new Rule ($ sProperty , $ oRule ->getLineNo (), $ oRule ->getColNo ());
412
+ $ oNewRule = new Rule ($ sProperty , $ rule ->getLineNo (), $ rule ->getColNo ());
413
413
$ oNewRule ->addValue ('inherit ' );
414
- $ oNewRule ->setIsImportant ($ oRule ->getIsImportant ());
414
+ $ oNewRule ->setIsImportant ($ rule ->getIsImportant ());
415
415
$ this ->addRule ($ oNewRule );
416
416
}
417
417
$ this ->removeRule ('background ' );
@@ -444,8 +444,8 @@ public function expandBackgroundShorthand(): void
444
444
}
445
445
}
446
446
foreach ($ aBgProperties as $ sProperty => $ mValue ) {
447
- $ oNewRule = new Rule ($ sProperty , $ oRule ->getLineNo (), $ oRule ->getColNo ());
448
- $ oNewRule ->setIsImportant ($ oRule ->getIsImportant ());
447
+ $ oNewRule = new Rule ($ sProperty , $ rule ->getLineNo (), $ rule ->getColNo ());
448
+ $ oNewRule ->setIsImportant ($ rule ->getIsImportant ());
449
449
$ oNewRule ->addValue ($ mValue );
450
450
$ this ->addRule ($ oNewRule );
451
451
}
@@ -493,8 +493,8 @@ public function expandListStyleShorthand(): void
493
493
if (!isset ($ aRules ['list-style ' ])) {
494
494
return ;
495
495
}
496
- $ oRule = $ aRules ['list-style ' ];
497
- $ mRuleValue = $ oRule ->getValue ();
496
+ $ rule = $ aRules ['list-style ' ];
497
+ $ mRuleValue = $ rule ->getValue ();
498
498
$ aValues = [];
499
499
if (!$ mRuleValue instanceof RuleValueList) {
500
500
$ aValues [] = $ mRuleValue ;
@@ -503,9 +503,9 @@ public function expandListStyleShorthand(): void
503
503
}
504
504
if (\count ($ aValues ) == 1 && $ aValues [0 ] == 'inherit ' ) {
505
505
foreach ($ aListProperties as $ sProperty => $ mValue ) {
506
- $ oNewRule = new Rule ($ sProperty , $ oRule ->getLineNo (), $ oRule ->getColNo ());
506
+ $ oNewRule = new Rule ($ sProperty , $ rule ->getLineNo (), $ rule ->getColNo ());
507
507
$ oNewRule ->addValue ('inherit ' );
508
- $ oNewRule ->setIsImportant ($ oRule ->getIsImportant ());
508
+ $ oNewRule ->setIsImportant ($ rule ->getIsImportant ());
509
509
$ this ->addRule ($ oNewRule );
510
510
}
511
511
$ this ->removeRule ('list-style ' );
@@ -524,8 +524,8 @@ public function expandListStyleShorthand(): void
524
524
}
525
525
}
526
526
foreach ($ aListProperties as $ sProperty => $ mValue ) {
527
- $ oNewRule = new Rule ($ sProperty , $ oRule ->getLineNo (), $ oRule ->getColNo ());
528
- $ oNewRule ->setIsImportant ($ oRule ->getIsImportant ());
527
+ $ oNewRule = new Rule ($ sProperty , $ rule ->getLineNo (), $ rule ->getColNo ());
528
+ $ oNewRule ->setIsImportant ($ rule ->getIsImportant ());
529
529
$ oNewRule ->addValue ($ mValue );
530
530
$ this ->addRule ($ oNewRule );
531
531
}
@@ -541,15 +541,15 @@ public function expandListStyleShorthand(): void
541
541
public function createShorthandProperties (array $ aProperties , $ sShorthand ): void
542
542
{
543
543
$ aRules = $ this ->getRulesAssoc ();
544
- $ oRule = null ;
544
+ $ rule = null ;
545
545
$ aNewValues = [];
546
546
foreach ($ aProperties as $ sProperty ) {
547
547
if (!isset ($ aRules [$ sProperty ])) {
548
548
continue ;
549
549
}
550
- $ oRule = $ aRules [$ sProperty ];
551
- if (!$ oRule ->getIsImportant ()) {
552
- $ mRuleValue = $ oRule ->getValue ();
550
+ $ rule = $ aRules [$ sProperty ];
551
+ if (!$ rule ->getIsImportant ()) {
552
+ $ mRuleValue = $ rule ->getValue ();
553
553
$ aValues = [];
554
554
if (!$ mRuleValue instanceof RuleValueList) {
555
555
$ aValues [] = $ mRuleValue ;
@@ -562,8 +562,8 @@ public function createShorthandProperties(array $aProperties, $sShorthand): void
562
562
$ this ->removeRule ($ sProperty );
563
563
}
564
564
}
565
- if ($ aNewValues !== [] && $ oRule instanceof Rule) {
566
- $ oNewRule = new Rule ($ sShorthand , $ oRule ->getLineNo (), $ oRule ->getColNo ());
565
+ if ($ aNewValues !== [] && $ rule instanceof Rule) {
566
+ $ oNewRule = new Rule ($ sShorthand , $ rule ->getLineNo (), $ rule ->getColNo ());
567
567
foreach ($ aNewValues as $ mValue ) {
568
568
$ oNewRule ->addValue ($ mValue );
569
569
}
@@ -636,19 +636,19 @@ public function createDimensionsShorthand(): void
636
636
$ aRules = $ this ->getRulesAssoc ();
637
637
foreach ($ aExpansions as $ sProperty => $ sExpanded ) {
638
638
$ aFoldable = [];
639
- foreach ($ aRules as $ sRuleName => $ oRule ) {
639
+ foreach ($ aRules as $ sRuleName => $ rule ) {
640
640
foreach ($ aPositions as $ sPosition ) {
641
641
if ($ sRuleName == \sprintf ($ sExpanded , $ sPosition )) {
642
- $ aFoldable [$ sRuleName ] = $ oRule ;
642
+ $ aFoldable [$ sRuleName ] = $ rule ;
643
643
}
644
644
}
645
645
}
646
646
// All four dimensions must be present
647
647
if (\count ($ aFoldable ) == 4 ) {
648
648
$ aValues = [];
649
649
foreach ($ aPositions as $ sPosition ) {
650
- $ oRule = $ aRules [\sprintf ($ sExpanded , $ sPosition )];
651
- $ mRuleValue = $ oRule ->getValue ();
650
+ $ rule = $ aRules [\sprintf ($ sExpanded , $ sPosition )];
651
+ $ mRuleValue = $ rule ->getValue ();
652
652
$ aRuleValues = [];
653
653
if (!$ mRuleValue instanceof RuleValueList) {
654
654
$ aRuleValues [] = $ mRuleValue ;
@@ -657,7 +657,7 @@ public function createDimensionsShorthand(): void
657
657
}
658
658
$ aValues [$ sPosition ] = $ aRuleValues ;
659
659
}
660
- $ oNewRule = new Rule ($ sProperty , $ oRule ->getLineNo (), $ oRule ->getColNo ());
660
+ $ oNewRule = new Rule ($ sProperty , $ rule ->getLineNo (), $ rule ->getColNo ());
661
661
if ((string ) $ aValues ['left ' ][0 ] == (string ) $ aValues ['right ' ][0 ]) {
662
662
if ((string ) $ aValues ['top ' ][0 ] == (string ) $ aValues ['bottom ' ][0 ]) {
663
663
if ((string ) $ aValues ['top ' ][0 ] == (string ) $ aValues ['left ' ][0 ]) {
@@ -716,8 +716,8 @@ public function createFontShorthand(): void
716
716
unset($ oOldRule );
717
717
foreach (['font-style ' , 'font-variant ' , 'font-weight ' ] as $ sProperty ) {
718
718
if (isset ($ aRules [$ sProperty ])) {
719
- $ oRule = $ aRules [$ sProperty ];
720
- $ mRuleValue = $ oRule ->getValue ();
719
+ $ rule = $ aRules [$ sProperty ];
720
+ $ mRuleValue = $ rule ->getValue ();
721
721
$ aValues = [];
722
722
if (!$ mRuleValue instanceof RuleValueList) {
723
723
$ aValues [] = $ mRuleValue ;
@@ -730,8 +730,8 @@ public function createFontShorthand(): void
730
730
}
731
731
}
732
732
// Get the font-size value
733
- $ oRule = $ aRules ['font-size ' ];
734
- $ mRuleValue = $ oRule ->getValue ();
733
+ $ rule = $ aRules ['font-size ' ];
734
+ $ mRuleValue = $ rule ->getValue ();
735
735
$ aFSValues = [];
736
736
if (!$ mRuleValue instanceof RuleValueList) {
737
737
$ aFSValues [] = $ mRuleValue ;
@@ -740,8 +740,8 @@ public function createFontShorthand(): void
740
740
}
741
741
// But wait to know if we have line-height to add it
742
742
if (isset ($ aRules ['line-height ' ])) {
743
- $ oRule = $ aRules ['line-height ' ];
744
- $ mRuleValue = $ oRule ->getValue ();
743
+ $ rule = $ aRules ['line-height ' ];
744
+ $ mRuleValue = $ rule ->getValue ();
745
745
$ aLHValues = [];
746
746
if (!$ mRuleValue instanceof RuleValueList) {
747
747
$ aLHValues [] = $ mRuleValue ;
@@ -757,8 +757,8 @@ public function createFontShorthand(): void
757
757
} else {
758
758
$ oNewRule ->addValue ($ aFSValues [0 ]);
759
759
}
760
- $ oRule = $ aRules ['font-family ' ];
761
- $ mRuleValue = $ oRule ->getValue ();
760
+ $ rule = $ aRules ['font-family ' ];
761
+ $ mRuleValue = $ rule ->getValue ();
762
762
$ aFFValues = [];
763
763
if (!$ mRuleValue instanceof RuleValueList) {
764
764
$ aFFValues [] = $ mRuleValue ;
0 commit comments