• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MyIntervals / PHP-CSS-Parser / 13442235950

20 Feb 2025 06:33PM UTC coverage: 52.281% (+0.6%) from 51.654%
13442235950

push

github

web-flow
[CLEANUP] Use accessors in `OutputFormatter` (#966)

Avoid direct access to `OutputFormat` properties as well
as variable access and magic methods.

Also drop some dead code.

We might possibly want to drop the `space` method altogether,
but that's out of scope for this change.

43 of 44 new or added lines in 1 file covered. (97.73%)

6 existing lines in 1 file now uncovered.

997 of 1907 relevant lines covered (52.28%)

11.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.47
/src/OutputFormat.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Sabberworm\CSS;
6

7
class OutputFormat
8
{
9
    /**
10
     * Value format: `"` means double-quote, `'` means single-quote
11
     *
12
     * @var string
13
     *
14
     * @internal since 8.8.0, will be made private in 9.0.0
15
     */
16
    public $sStringQuotingType = '"';
17

18
    /**
19
     * Output RGB colors in hash notation if possible
20
     *
21
     * @var bool
22
     *
23
     * @internal since 8.8.0, will be made private in 9.0.0
24
     */
25
    public $bRGBHashNotation = true;
26

27
    /**
28
     * Declaration format
29
     *
30
     * Semicolon after the last rule of a declaration block can be omitted. To do that, set this false.
31
     *
32
     * @var bool
33
     *
34
     * @internal since 8.8.0, will be made private in 9.0.0
35
     */
36
    public $bSemicolonAfterLastRule = true;
37

38
    /**
39
     * Spacing
40
     * Note that these strings are not sanity-checked: the value should only consist of whitespace
41
     * Any newline character will be indented according to the current level.
42
     * The triples (After, Before, Between) can be set using a wildcard
43
     * (e.g. `$outputFormat->set('Space*Rules', "\n");`)
44
     *
45
     * @var string
46
     *
47
     * @internal since 8.8.0, will be made private in 9.0.0
48
     */
49
    public $sSpaceAfterRuleName = ' ';
50

51
    /**
52
     * @var string
53
     *
54
     * @internal since 8.8.0, will be made private in 9.0.0
55
     */
56
    public $sSpaceBeforeRules = '';
57

58
    /**
59
     * @var string
60
     *
61
     * @internal since 8.8.0, will be made private in 9.0.0
62
     */
63
    public $sSpaceAfterRules = '';
64

65
    /**
66
     * @var string
67
     *
68
     * @internal since 8.8.0, will be made private in 9.0.0
69
     */
70
    public $sSpaceBetweenRules = '';
71

72
    /**
73
     * @var string
74
     *
75
     * @internal since 8.8.0, will be made private in 9.0.0
76
     */
77
    public $sSpaceBeforeBlocks = '';
78

79
    /**
80
     * @var string
81
     *
82
     * @internal since 8.8.0, will be made private in 9.0.0
83
     */
84
    public $sSpaceAfterBlocks = '';
85

86
    /**
87
     * @var string
88
     *
89
     * @internal since 8.8.0, will be made private in 9.0.0
90
     */
91
    public $sSpaceBetweenBlocks = "\n";
92

93
    /**
94
     * Content injected in and around at-rule blocks.
95
     *
96
     * @var string
97
     *
98
     * @internal since 8.8.0, will be made private in 9.0.0
99
     */
100
    public $sBeforeAtRuleBlock = '';
101

102
    /**
103
     * @var string
104
     *
105
     * @internal since 8.8.0, will be made private in 9.0.0
106
     */
107
    public $sAfterAtRuleBlock = '';
108

109
    /**
110
     * This is what’s printed before and after the comma if a declaration block contains multiple selectors.
111
     *
112
     * @var string
113
     *
114
     * @internal since 8.8.0, will be made private in 9.0.0
115
     */
116
    public $sSpaceBeforeSelectorSeparator = '';
117

118
    /**
119
     * @var string
120
     *
121
     * @internal since 8.8.0, will be made private in 9.0.0
122
     */
123
    public $sSpaceAfterSelectorSeparator = ' ';
124

125
    /**
126
     * This is what’s inserted before the separator in value lists, by default.
127
     *
128
     * @var string
129
     *
130
     * @internal since 8.8.0, will be made private in 9.0.0
131
     */
132
    public $sSpaceBeforeListArgumentSeparator = '';
133

134
    /**
135
     * Keys are separators (e.g. `,`).  Values are the space sequence to insert, or an empty string.
136
     *
137
     * @var array<non-empty-string, string>
138
     *
139
     * @internal since 8.8.0, will be made private in 9.0.0
140
     */
141
    public $aSpaceBeforeListArgumentSeparators = [];
142

143
    /**
144
     * This is what’s inserted after the separator in value lists, by default.
145
     *
146
     * @var string
147
     *
148
     * @internal since 8.8.0, will be made private in 9.0.0
149
     */
150
    public $sSpaceAfterListArgumentSeparator = '';
151

152
    /**
153
     * Keys are separators (e.g. `,`).  Values are the space sequence to insert, or an empty string.
154
     *
155
     * @var array<non-empty-string, string>
156
     *
157
     * @internal since 8.8.0, will be made private in 9.0.0
158
     */
159
    public $aSpaceAfterListArgumentSeparators = [];
160

161
    /**
162
     * @var string
163
     *
164
     * @internal since 8.8.0, will be made private in 9.0.0
165
     */
166
    public $sSpaceBeforeOpeningBrace = ' ';
167

168
    /**
169
     * Content injected in and around declaration blocks.
170
     *
171
     * @var string
172
     *
173
     * @internal since 8.8.0, will be made private in 9.0.0
174
     */
175
    public $sBeforeDeclarationBlock = '';
176

177
    /**
178
     * @var string
179
     *
180
     * @internal since 8.8.0, will be made private in 9.0.0
181
     */
182
    public $sAfterDeclarationBlockSelectors = '';
183

184
    /**
185
     * @var string
186
     *
187
     * @internal since 8.8.0, will be made private in 9.0.0
188
     */
189
    public $sAfterDeclarationBlock = '';
190

191
    /**
192
     * Indentation character(s) per level. Only applicable if newlines are used in any of the spacing settings.
193
     *
194
     * @var string
195
     *
196
     * @internal since 8.8.0, will be made private in 9.0.0
197
     */
198
    public $sIndentation = "\t";
199

200
    /**
201
     * Output exceptions.
202
     *
203
     * @var bool
204
     *
205
     * @internal since 8.8.0, will be made private in 9.0.0
206
     */
207
    public $bIgnoreExceptions = false;
208

209
    /**
210
     * Render comments for lists and RuleSets
211
     *
212
     * @var bool
213
     *
214
     * @internal since 8.8.0, will be made private in 9.0.0
215
     */
216
    public $bRenderComments = false;
217

218
    /**
219
     * @var OutputFormatter|null
220
     */
221
    private $outputFormatter;
222

223
    /**
224
     * @var OutputFormat|null
225
     */
226
    private $oNextLevelFormat;
227

228
    /**
229
     * @var int
230
     */
231
    private $iIndentationLevel = 0;
232

233
    public function __construct() {}
234

235
    /**
236
     * @return string|int|bool|null
237
     */
UNCOV
238
    public function get(string $sName)
×
239
    {
UNCOV
240
        $aVarPrefixes = ['a', 's', 'm', 'b', 'f', 'o', 'c', 'i'];
×
UNCOV
241
        foreach ($aVarPrefixes as $prefix) {
×
UNCOV
242
            $sFieldName = $prefix . \ucfirst($sName);
×
UNCOV
243
            if (isset($this->$sFieldName)) {
×
UNCOV
244
                return $this->$sFieldName;
×
245
            }
246
        }
247
        return null;
×
248
    }
249

250
    /**
251
     * @param array<array-key, string>|string $aNames
252
     * @param mixed $mValue
253
     *
254
     * @return self|false
255
     */
256
    public function set($aNames, $mValue)
4✔
257
    {
258
        $aVarPrefixes = ['a', 's', 'm', 'b', 'f', 'o', 'c', 'i'];
4✔
259
        if (\is_string($aNames) && \strpos($aNames, '*') !== false) {
4✔
260
            $aNames =
261
                [
262
                    \str_replace('*', 'Before', $aNames),
4✔
263
                    \str_replace('*', 'Between', $aNames),
4✔
264
                    \str_replace('*', 'After', $aNames),
4✔
265
                ];
266
        } elseif (!\is_array($aNames)) {
×
267
            $aNames = [$aNames];
×
268
        }
269
        foreach ($aVarPrefixes as $prefix) {
4✔
270
            $bDidReplace = false;
4✔
271
            foreach ($aNames as $sName) {
4✔
272
                $sFieldName = $prefix . \ucfirst($sName);
4✔
273
                if (isset($this->$sFieldName)) {
4✔
274
                    $this->$sFieldName = $mValue;
4✔
275
                    $bDidReplace = true;
4✔
276
                }
277
            }
278
            if ($bDidReplace) {
4✔
279
                return $this;
4✔
280
            }
281
        }
282
        // Break the chain so the user knows this option is invalid
283
        return false;
×
284
    }
285

286
    /**
287
     * @param non-empty-string $sMethodName
288
     * @param array<array-key, mixed> $aArguments
289
     *
290
     * @return mixed
291
     *
292
     * @throws \Exception
293
     */
294
    public function __call(string $sMethodName, array $aArguments)
20✔
295
    {
296
        if (\method_exists(OutputFormatter::class, $sMethodName)) {
20✔
297
            return \call_user_func_array([$this->getFormatter(), $sMethodName], $aArguments);
20✔
298
        } else {
299
            throw new \Exception('Unknown OutputFormat method called: ' . $sMethodName);
×
300
        }
301
    }
302

303
    /**
304
     * @internal
305
     */
306
    public function getStringQuotingType(): string
21✔
307
    {
308
        return $this->sStringQuotingType;
21✔
309
    }
310

311
    /**
312
     * @return $this fluent interface
313
     */
314
    public function setStringQuotingType(string $quotingType): self
3✔
315
    {
316
        $this->sStringQuotingType = $quotingType;
3✔
317

318
        return $this;
3✔
319
    }
320

321
    /**
322
     * @internal
323
     */
324
    public function getRGBHashNotation(): bool
23✔
325
    {
326
        return $this->bRGBHashNotation;
23✔
327
    }
328

329
    /**
330
     * @return $this fluent interface
331
     */
332
    public function setRGBHashNotation(bool $rgbHashNotation): self
4✔
333
    {
334
        $this->bRGBHashNotation = $rgbHashNotation;
4✔
335

336
        return $this;
4✔
337
    }
338

339
    /**
340
     * @internal
341
     */
342
    public function getSemicolonAfterLastRule(): bool
23✔
343
    {
344
        return $this->bSemicolonAfterLastRule;
23✔
345
    }
346

347
    /**
348
     * @return $this fluent interface
349
     */
350
    public function setSemicolonAfterLastRule(bool $semicolonAfterLastRule): self
4✔
351
    {
352
        $this->bSemicolonAfterLastRule = $semicolonAfterLastRule;
4✔
353

354
        return $this;
4✔
355
    }
356

357
    /**
358
     * @internal
359
     */
360
    public function getSpaceAfterRuleName(): string
25✔
361
    {
362
        return $this->sSpaceAfterRuleName;
25✔
363
    }
364

365
    /**
366
     * @return $this fluent interface
367
     */
368
    public function setSpaceAfterRuleName(string $whitespace): self
20✔
369
    {
370
        $this->sSpaceAfterRuleName = $whitespace;
20✔
371

372
        return $this;
20✔
373
    }
374

375
    /**
376
     * @internal
377
     */
378
    public function getSpaceBeforeRules(): string
24✔
379
    {
380
        return $this->sSpaceBeforeRules;
24✔
381
    }
382

383
    /**
384
     * @return $this fluent interface
385
     */
386
    public function setSpaceBeforeRules(string $whitespace): self
32✔
387
    {
388
        $this->sSpaceBeforeRules = $whitespace;
32✔
389

390
        return $this;
32✔
391
    }
392

393
    /**
394
     * @internal
395
     */
396
    public function getSpaceAfterRules(): string
24✔
397
    {
398
        return $this->sSpaceAfterRules;
24✔
399
    }
400

401
    /**
402
     * @return $this fluent interface
403
     */
404
    public function setSpaceAfterRules(string $whitespace): self
32✔
405
    {
406
        $this->sSpaceAfterRules = $whitespace;
32✔
407

408
        return $this;
32✔
409
    }
410

411
    /**
412
     * @internal
413
     */
414
    public function getSpaceBetweenRules(): string
22✔
415
    {
416
        return $this->sSpaceBetweenRules;
22✔
417
    }
418

419
    /**
420
     * @return $this fluent interface
421
     */
422
    public function setSpaceBetweenRules(string $whitespace): self
32✔
423
    {
424
        $this->sSpaceBetweenRules = $whitespace;
32✔
425

426
        return $this;
32✔
427
    }
428

429
    /**
430
     * @internal
431
     */
432
    public function getSpaceBeforeBlocks(): string
24✔
433
    {
434
        return $this->sSpaceBeforeBlocks;
24✔
435
    }
436

437
    /**
438
     * @return $this fluent interface
439
     */
440
    public function setSpaceBeforeBlocks(string $whitespace): self
32✔
441
    {
442
        $this->sSpaceBeforeBlocks = $whitespace;
32✔
443

444
        return $this;
32✔
445
    }
446

447
    /**
448
     * @internal
449
     */
450
    public function getSpaceAfterBlocks(): string
24✔
451
    {
452
        return $this->sSpaceAfterBlocks;
24✔
453
    }
454

455
    /**
456
     * @return $this fluent interface
457
     */
458
    public function setSpaceAfterBlocks(string $whitespace): self
32✔
459
    {
460
        $this->sSpaceAfterBlocks = $whitespace;
32✔
461

462
        return $this;
32✔
463
    }
464

465
    /**
466
     * @internal
467
     */
468
    public function getSpaceBetweenBlocks(): string
23✔
469
    {
470
        return $this->sSpaceBetweenBlocks;
23✔
471
    }
472

473
    /**
474
     * @return $this fluent interface
475
     */
476
    public function setSpaceBetweenBlocks(string $whitespace): self
33✔
477
    {
478
        $this->sSpaceBetweenBlocks = $whitespace;
33✔
479

480
        return $this;
33✔
481
    }
482

483
    /**
484
     * @internal
485
     */
486
    public function getBeforeAtRuleBlock(): string
2✔
487
    {
488
        return $this->sBeforeAtRuleBlock;
2✔
489
    }
490

491
    /**
492
     * @return $this fluent interface
493
     */
494
    public function setBeforeAtRuleBlock(string $content): self
2✔
495
    {
496
        $this->sBeforeAtRuleBlock = $content;
2✔
497

498
        return $this;
2✔
499
    }
500

501
    /**
502
     * @internal
503
     */
504
    public function getAfterAtRuleBlock(): string
2✔
505
    {
506
        return $this->sAfterAtRuleBlock;
2✔
507
    }
508

509
    /**
510
     * @return $this fluent interface
511
     */
512
    public function setAfterAtRuleBlock(string $content): self
2✔
513
    {
514
        $this->sAfterAtRuleBlock = $content;
2✔
515

516
        return $this;
2✔
517
    }
518

519
    /**
520
     * @internal
521
     */
522
    public function getSpaceBeforeSelectorSeparator(): string
22✔
523
    {
524
        return $this->sSpaceBeforeSelectorSeparator;
22✔
525
    }
526

527
    /**
528
     * @return $this fluent interface
529
     */
530
    public function setSpaceBeforeSelectorSeparator(string $whitespace): self
2✔
531
    {
532
        $this->sSpaceBeforeSelectorSeparator = $whitespace;
2✔
533

534
        return $this;
2✔
535
    }
536

537
    /**
538
     * @internal
539
     */
540
    public function getSpaceAfterSelectorSeparator(): string
24✔
541
    {
542
        return $this->sSpaceAfterSelectorSeparator;
24✔
543
    }
544

545
    /**
546
     * @return $this fluent interface
547
     */
548
    public function setSpaceAfterSelectorSeparator(string $whitespace): self
19✔
549
    {
550
        $this->sSpaceAfterSelectorSeparator = $whitespace;
19✔
551

552
        return $this;
19✔
553
    }
554

555
    /**
556
     * @internal
557
     */
558
    public function getSpaceBeforeListArgumentSeparator(): string
20✔
559
    {
560
        return $this->sSpaceBeforeListArgumentSeparator;
20✔
561
    }
562

563
    /**
564
     * @return $this fluent interface
565
     */
566
    public function setSpaceBeforeListArgumentSeparator(string $whitespace): self
2✔
567
    {
568
        $this->sSpaceBeforeListArgumentSeparator = $whitespace;
2✔
569

570
        return $this;
2✔
571
    }
572

573
    /**
574
     * @return array<non-empty-string, string>
575
     *
576
     * @internal
577
     */
578
    public function getSpaceBeforeListArgumentSeparators(): array
20✔
579
    {
580
        return $this->aSpaceBeforeListArgumentSeparators;
20✔
581
    }
582

583
    /**
584
     * @param array<non-empty-string, string> $separatorSpaces
585
     *
586
     * @return $this fluent interface
587
     */
588
    public function setSpaceBeforeListArgumentSeparators(array $separatorSpaces): self
2✔
589
    {
590
        $this->aSpaceBeforeListArgumentSeparators = $separatorSpaces;
2✔
591

592
        return $this;
2✔
593
    }
594

595
    /**
596
     * @internal
597
     */
598
    public function getSpaceAfterListArgumentSeparator(): string
19✔
599
    {
600
        return $this->sSpaceAfterListArgumentSeparator;
19✔
601
    }
602

603
    /**
604
     * @return $this fluent interface
605
     */
606
    public function setSpaceAfterListArgumentSeparator(string $whitespace): self
4✔
607
    {
608
        $this->sSpaceAfterListArgumentSeparator = $whitespace;
4✔
609

610
        return $this;
4✔
611
    }
612

613
    /**
614
     * @return array<non-empty-string, string>
615
     *
616
     * @internal
617
     */
618
    public function getSpaceAfterListArgumentSeparators(): array
22✔
619
    {
620
        return $this->aSpaceAfterListArgumentSeparators;
22✔
621
    }
622

623
    /**
624
     * @param array<non-empty-string, string> $separatorSpaces
625
     *
626
     * @return $this fluent interface
627
     */
628
    public function setSpaceAfterListArgumentSeparators(array $separatorSpaces): self
19✔
629
    {
630
        $this->aSpaceAfterListArgumentSeparators = $separatorSpaces;
19✔
631

632
        return $this;
19✔
633
    }
634

635
    /**
636
     * @internal
637
     */
638
    public function getSpaceBeforeOpeningBrace(): string
24✔
639
    {
640
        return $this->sSpaceBeforeOpeningBrace;
24✔
641
    }
642

643
    /**
644
     * @return $this fluent interface
645
     */
646
    public function setSpaceBeforeOpeningBrace(string $whitespace): self
19✔
647
    {
648
        $this->sSpaceBeforeOpeningBrace = $whitespace;
19✔
649

650
        return $this;
19✔
651
    }
652

653
    /**
654
     * @internal
655
     */
656
    public function getBeforeDeclarationBlock(): string
2✔
657
    {
658
        return $this->sBeforeDeclarationBlock;
2✔
659
    }
660

661
    /**
662
     * @return $this fluent interface
663
     */
664
    public function setBeforeDeclarationBlock(string $content): self
2✔
665
    {
666
        $this->sBeforeDeclarationBlock = $content;
2✔
667

668
        return $this;
2✔
669
    }
670

671
    /**
672
     * @internal
673
     */
674
    public function getAfterDeclarationBlockSelectors(): string
2✔
675
    {
676
        return $this->sAfterDeclarationBlockSelectors;
2✔
677
    }
678

679
    /**
680
     * @return $this fluent interface
681
     */
682
    public function setAfterDeclarationBlockSelectors(string $content): self
2✔
683
    {
684
        $this->sAfterDeclarationBlockSelectors = $content;
2✔
685

686
        return $this;
2✔
687
    }
688

689
    /**
690
     * @internal
691
     */
692
    public function getAfterDeclarationBlock(): string
2✔
693
    {
694
        return $this->sAfterDeclarationBlock;
2✔
695
    }
696

697
    /**
698
     * @return $this fluent interface
699
     */
700
    public function setAfterDeclarationBlock(string $content): self
2✔
701
    {
702
        $this->sAfterDeclarationBlock = $content;
2✔
703

704
        return $this;
2✔
705
    }
706

707
    /**
708
     * @internal
709
     */
710
    public function getIndentation(): string
13✔
711
    {
712
        return $this->sIndentation;
13✔
713
    }
714

715
    /**
716
     * @return $this fluent interface
717
     */
718
    public function setIndentation(string $indentation): self
16✔
719
    {
720
        $this->sIndentation = $indentation;
16✔
721

722
        return $this;
16✔
723
    }
724

725
    /**
726
     * @internal
727
     */
728
    public function getIgnoreExceptions(): bool
24✔
729
    {
730
        return $this->bIgnoreExceptions;
24✔
731
    }
732

733
    /**
734
     * @return $this fluent interface
735
     */
736
    public function setIgnoreExceptions(bool $ignoreExceptions): self
6✔
737
    {
738
        $this->bIgnoreExceptions = $ignoreExceptions;
6✔
739

740
        return $this;
6✔
741
    }
742

743
    /**
744
     * @internal
745
     */
746
    public function getRenderComments(): bool
25✔
747
    {
748
        return $this->bRenderComments;
25✔
749
    }
750

751
    /**
752
     * @return $this fluent interface
753
     */
754
    public function setRenderComments(bool $renderComments): self
33✔
755
    {
756
        $this->bRenderComments = $renderComments;
33✔
757

758
        return $this;
33✔
759
    }
760

761
    /**
762
     * @internal
763
     */
764
    public function getIndentationLevel(): int
22✔
765
    {
766
        return $this->iIndentationLevel;
22✔
767
    }
768

769
    /**
770
     * @return $this fluent interface
771
     */
772
    public function indentWithTabs(int $numberOfTabs = 1): self
6✔
773
    {
774
        return $this->setIndentation(\str_repeat("\t", $numberOfTabs));
6✔
775
    }
776

777
    /**
778
     * @return $this fluent interface
779
     */
780
    public function indentWithSpaces(int $numberOfSpaces = 2): self
7✔
781
    {
782
        return $this->setIndentation(\str_repeat(' ', $numberOfSpaces));
7✔
783
    }
784

785
    /**
786
     * @internal since V8.8.0
787
     */
788
    public function nextLevel(): self
25✔
789
    {
790
        if ($this->oNextLevelFormat === null) {
25✔
791
            $this->oNextLevelFormat = clone $this;
25✔
792
            $this->oNextLevelFormat->iIndentationLevel++;
25✔
793
            $this->oNextLevelFormat->outputFormatter = null;
25✔
794
        }
795
        return $this->oNextLevelFormat;
25✔
796
    }
797

798
    public function beLenient(): void
1✔
799
    {
800
        $this->bIgnoreExceptions = true;
1✔
801
    }
1✔
802

803
    public function getFormatter(): OutputFormatter
23✔
804
    {
805
        if ($this->outputFormatter === null) {
23✔
806
            $this->outputFormatter = new OutputFormatter($this);
23✔
807
        }
808
        return $this->outputFormatter;
23✔
809
    }
810

811
    /**
812
     * Creates an instance of this class without any particular formatting settings.
813
     */
814
    public static function create(): self
48✔
815
    {
816
        return new OutputFormat();
48✔
817
    }
818

819
    /**
820
     * Creates an instance of this class with a preset for compact formatting.
821
     */
822
    public static function createCompact(): self
16✔
823
    {
824
        $format = self::create();
16✔
825
        $format
826
            ->setSpaceBeforeRules('')
16✔
827
            ->setSpaceBetweenRules('')
16✔
828
            ->setSpaceAfterRules('')
16✔
829
            ->setSpaceBeforeBlocks('')
16✔
830
            ->setSpaceBetweenBlocks('')
16✔
831
            ->setSpaceAfterBlocks('')
16✔
832
            ->setSpaceAfterRuleName('')
16✔
833
            ->setSpaceBeforeOpeningBrace('')
16✔
834
            ->setSpaceAfterSelectorSeparator('')
16✔
835
            ->setRenderComments(false);
16✔
836

837
        return $format;
16✔
838
    }
839

840
    /**
841
     * Creates an instance of this class with a preset for pretty formatting.
842
     */
843
    public static function createPretty(): self
16✔
844
    {
845
        $format = self::create();
16✔
846
        $format
847
            ->setSpaceBeforeRules("\n")
16✔
848
            ->setSpaceBetweenRules("\n")
16✔
849
            ->setSpaceAfterRules("\n")
16✔
850
            ->setSpaceBeforeBlocks("\n")
16✔
851
            ->setSpaceBetweenBlocks("\n\n")
16✔
852
            ->setSpaceAfterBlocks("\n")
16✔
853
            ->setSpaceAfterListArgumentSeparators([',' => ' '])
16✔
854
            ->setRenderComments(true);
16✔
855

856
        return $format;
16✔
857
    }
858
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc