Skip to content

Commit 413c556

Browse files
committed
Fix styles
1 parent be73506 commit 413c556

File tree

10 files changed

+35
-84
lines changed

10 files changed

+35
-84
lines changed

lib/PHPCfg/Printer/GraphViz.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace PHPCfg\Printer;
1313

1414
use PHPCfg\Func;
15-
use PHPCfg\Printer\Printer;
1615
use PHPCfg\Script;
1716
use phpDocumentor\GraphViz\Edge;
1817
use phpDocumentor\GraphViz\Graph;

lib/PHPCfg/Printer/Printer.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,20 @@
1212
namespace PHPCfg\Printer;
1313

1414
use LogicException;
15-
use PHPCfg\Operand\BoundVariable;
16-
use PHPCfg\Operand\Literal;
17-
use PHPCfg\Operand\NullOperand;
18-
use PHPCfg\Operand\Temporary;
19-
use PHPCfg\Operand\Variable;
20-
use SplObjectStorage;
21-
use SplQueue;
22-
use PHPCfg\Script;
2315
use PHPCfg\Block;
2416
use PHPCfg\Func;
2517
use PHPCfg\Op;
2618
use PHPCfg\Operand;
27-
use PHPCfg\Assertion;
28-
use RecursiveIteratorIterator;
19+
use PHPCfg\Script;
2920
use RecursiveDirectoryIterator;
21+
use RecursiveIteratorIterator;
22+
use SplObjectStorage;
23+
use SplQueue;
3024

3125
abstract class Printer
3226
{
33-
const MODE_DEFAULT = 0b00000;
34-
const MODE_RENDER_ATTRIBUTES = 0b00001;
27+
public const MODE_DEFAULT = 0b00000;
28+
public const MODE_RENDER_ATTRIBUTES = 0b00001;
3529

3630
private SplQueue $blockQueue;
3731

lib/PHPCfg/Printer/Renderer.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@
1111

1212
namespace PHPCfg\Printer;
1313

14-
use PHPCfg\Func;
15-
use PHPCfg\Script;
1614
use PHPCfg\Op;
1715
use PHPCfg\Operand;
18-
use PHPCfg\Block;
1916

2017
interface Renderer
2118
{
@@ -24,5 +21,5 @@ public function reset(): void;
2421
public function renderOp(Op $op): ?array;
2522

2623
public function renderOperand(Operand $operand): ?array;
27-
28-
}
24+
25+
}

lib/PHPCfg/Printer/Renderer/GenericOp.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,13 @@
1111

1212
namespace PHPCfg\Printer\Renderer;
1313

14-
use PHPCfg\Func;
15-
use PHPCfg\Printer\Printer;
16-
use PHPCfg\Script;
1714
use PHPCfg\Op;
1815
use PHPCfg\Operand;
19-
use PHPCfg\Block;
16+
use PHPCfg\Printer\Printer;
2017
use PHPCfg\Printer\Renderer;
2118

2219
class GenericOp implements Renderer
2320
{
24-
2521
protected Printer $printer;
2622

2723
public function __construct(Printer $printer)
@@ -38,7 +34,7 @@ public function renderOp(Op $op): ?array
3834
'types' => [],
3935
'vars' => [],
4036
'attributes' => $this->renderAttributes($op->getAttributes()),
41-
'childblocks' => [],
37+
'childblocks' => [],
4238
];
4339

4440
if ($op instanceof Op\CallableOp) {
@@ -99,7 +95,7 @@ public function renderOp(Op $op): ?array
9995
$result['attrGroups'] = $this->renderAttrGroups($op);
10096
}
10197

102-
98+
10399

104100
return $result;
105101
}
@@ -110,7 +106,7 @@ public function renderOperand(Operand $operand): ?array
110106
}
111107

112108

113-
109+
114110
protected function renderAttributes(array $attributes): array
115111
{
116112
if (!$this->printer->renderAttributes) {
@@ -183,4 +179,4 @@ protected function renderFlags(Op\Stmt $stmt): string
183179
return $result;
184180
}
185181

186-
}
182+
}

lib/PHPCfg/Printer/Renderer/Op/Assertion.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,9 @@
1111

1212
namespace PHPCfg\Printer\Renderer\Op;
1313

14-
15-
use PHPCfg\Printer\Renderer\GenericOp;
16-
use PHPCfg\Func;
17-
use PHPCfg\Printer\Printer;
18-
use PHPCfg\Script;
19-
use PHPCfg\Op;
20-
use PHPCfg\Operand;
21-
use PHPCfg\Block;
22-
use PHPCfg\Printer\Renderer;
2314
use PHPCfg\Assertion as CoreAssertion;
15+
use PHPCfg\Op;
16+
use PHPCfg\Printer\Renderer\GenericOp;
2417

2518
class Assertion extends GenericOp
2619
{
@@ -37,7 +30,7 @@ public function renderOp(Op $op): ?array
3730

3831
protected function renderAssertion(CoreAssertion $assert): string
3932
{
40-
33+
4134
if (is_array($assert->value)) {
4235
$combinator = $assert->mode === CoreAssertion::MODE_UNION ? '|' : '&';
4336

@@ -52,4 +45,4 @@ protected function renderAssertion(CoreAssertion $assert): string
5245
return "$kind({$ret})";
5346

5447
}
55-
}
48+
}

lib/PHPCfg/Printer/Renderer/Op/Include_.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,8 @@
1111

1212
namespace PHPCfg\Printer\Renderer\Op;
1313

14-
15-
use PHPCfg\Printer\Renderer\GenericOp;
16-
use PHPCfg\Func;
17-
use PHPCfg\Printer\Printer;
18-
use PHPCfg\Script;
1914
use PHPCfg\Op;
20-
use PHPCfg\Operand;
21-
use PHPCfg\Block;
22-
use PHPCfg\Printer\Renderer;
23-
use PHPCfg\Assertion as CoreAssertion;
15+
use PHPCfg\Printer\Renderer\GenericOp;
2416

2517
class Include_ extends GenericOp
2618
{
@@ -50,4 +42,4 @@ public function renderOp(Op $op): ?array
5042
return $result;
5143
}
5244

53-
}
45+
}

lib/PHPCfg/Printer/Renderer/Op/TraitUse.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,8 @@
1111

1212
namespace PHPCfg\Printer\Renderer\Op;
1313

14-
15-
use PHPCfg\Printer\Renderer\GenericOp;
16-
use PHPCfg\Func;
17-
use PHPCfg\Printer\Printer;
18-
use PHPCfg\Script;
1914
use PHPCfg\Op;
20-
use PHPCfg\Operand;
21-
use PHPCfg\Block;
22-
use PHPCfg\Printer\Renderer;
23-
use PHPCfg\Assertion as CoreAssertion;
15+
use PHPCfg\Printer\Renderer\GenericOp;
2416

2517
class TraitUse extends GenericOp
2618
{
@@ -73,4 +65,4 @@ public function renderOp(Op $op): ?array
7365
return $result;
7466
}
7567

76-
}
68+
}

lib/PHPCfg/Printer/Renderer/Operand/Literal.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,13 @@
1111

1212
namespace PHPCfg\Printer\Renderer\Operand;
1313

14-
use PHPCfg\Func;
15-
use PHPCfg\Printer\Printer;
16-
use PHPCfg\Script;
1714
use PHPCfg\Op;
1815
use PHPCfg\Operand;
19-
use PHPCfg\Block;
16+
use PHPCfg\Printer\Printer;
2017
use PHPCfg\Printer\Renderer;
2118

2219
class Literal implements Renderer
2320
{
24-
2521
protected Printer $printer;
2622

2723
public function __construct(Printer $printer)
@@ -52,8 +48,8 @@ public function renderOperand(Operand $operand): ?array
5248
return [
5349
"kind" => "LITERAL",
5450
"type" => $operand->type ? "<{$operand->type}>" : "",
55-
"value" => var_export($operand->value, true)
51+
"value" => var_export($operand->value, true),
5652
];
5753
}
58-
59-
}
54+
55+
}

lib/PHPCfg/Printer/Renderer/Operand/Temporary.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,14 @@
1111

1212
namespace PHPCfg\Printer\Renderer\Operand;
1313

14-
use PHPCfg\Func;
15-
use PHPCfg\Printer\Printer;
16-
use PHPCfg\Script;
1714
use PHPCfg\Op;
1815
use PHPCfg\Operand;
19-
use PHPCfg\Block;
16+
use PHPCfg\Printer\Printer;
2017
use PHPCfg\Printer\Renderer;
2118
use SplObjectStorage;
2219

2320
class Temporary implements Renderer
2421
{
25-
2622
protected Printer $printer;
2723

2824
protected SplObjectStorage $varIds;
@@ -35,7 +31,7 @@ public function __construct(Printer $printer)
3531

3632
public function reset(): void
3733
{
38-
$this->varIds = new SplObjectStorage;
34+
$this->varIds = new SplObjectStorage();
3935
}
4036

4137
public function renderOp(Op $op): ?array
@@ -64,5 +60,5 @@ protected function getVarId(Operand $var)
6460

6561
return $this->varIds[$var] = $this->varIds->count() + 1;
6662
}
67-
68-
}
63+
64+
}

lib/PHPCfg/Printer/Renderer/Operand/Variable.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,22 @@
1111

1212
namespace PHPCfg\Printer\Renderer\Operand;
1313

14-
use PHPCfg\Func;
15-
use PHPCfg\Printer\Printer;
16-
use PHPCfg\Script;
14+
use LogicException;
1715
use PHPCfg\Op;
1816
use PHPCfg\Operand;
19-
use PHPCfg\Block;
17+
use PHPCfg\Printer\Printer;
2018
use PHPCfg\Printer\Renderer;
2119

2220
class Variable implements Renderer
2321
{
24-
2522
protected Printer $printer;
2623

2724
public function __construct(Printer $printer)
2825
{
2926
$this->printer = $printer;
3027
}
3128

32-
public function reset(): void
33-
{}
29+
public function reset(): void {}
3430

3531
public function renderOp(Op $op): ?array
3632
{
@@ -64,7 +60,7 @@ public function renderOperand(Operand $operand): ?array
6460
$prefix = "static $prefix";
6561
break;
6662
default:
67-
throw new \LogicException('Unknown bound variable scope');
63+
throw new LogicException('Unknown bound variable scope');
6864
}
6965
}
7066

@@ -74,5 +70,5 @@ public function renderOperand(Operand $operand): ?array
7470
"name" => $prefix . $operand->name->value,
7571
];
7672
}
77-
78-
}
73+
74+
}

0 commit comments

Comments
 (0)