Skip to content

Commit 90424c0

Browse files
committed
Printer: public properties
1 parent f7899d9 commit 90424c0

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

readme.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -772,9 +772,10 @@ Need to customize printer behavior? Create your own by inheriting the `Printer`
772772
```php
773773
class MyPrinter extends Nette\PhpGenerator\Printer
774774
{
775-
protected string $indentation = "\t";
776-
protected int $linesBetweenProperties = 0;
777-
protected int $linesBetweenMethods = 1;
778-
protected string $returnTypeColon = ': ';
775+
public int $wrapLength = 120;
776+
public string $indentation = "\t";
777+
public int $linesBetweenProperties = 0;
778+
public int $linesBetweenMethods = 2;
779+
public string $returnTypeColon = ': ';
779780
}
780781
```

src/PhpGenerator/Printer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ class Printer
2121
use Nette\SmartObject;
2222

2323
public int $wrapLength = 120;
24-
protected string $indentation = "\t";
25-
protected int $linesBetweenProperties = 0;
26-
protected int $linesBetweenMethods = 2;
27-
protected string $returnTypeColon = ': ';
24+
public string $indentation = "\t";
25+
public int $linesBetweenProperties = 0;
26+
public int $linesBetweenMethods = 2;
27+
public string $returnTypeColon = ': ';
2828
protected ?PhpNamespace $namespace = null;
2929
protected ?Dumper $dumper;
3030
private bool $resolveTypes = true;

src/PhpGenerator/PsrPrinter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
*/
1616
final class PsrPrinter extends Printer
1717
{
18-
protected string $indentation = ' ';
19-
protected int $linesBetweenMethods = 1;
18+
public string $indentation = ' ';
19+
public int $linesBetweenMethods = 1;
2020
}

0 commit comments

Comments
 (0)