Skip to content

Commit f101ee3

Browse files
committed
v1.0.0 (2023-04-06)
1 parent 2f95860 commit f101ee3

13 files changed

+263
-157
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG
22

3+
## v1.0.0 (2023-04-06)
4+
5+
36
## v0.6.1 (2023-04-03)
47

58
### Features

src/DiagramElement/Division/DivisionColor.php

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

55
namespace Smeghead\PhpClassDiagram\DiagramElement\Division;
66

7-
class DivisionColor {
7+
class DivisionColor
8+
{
89
private static $gen;
9-
public static function nextColor(): string {
10+
public static function nextColor(): string
11+
{
1012
if (empty(self::$gen)) {
1113
self::$gen = generateDivisionColorGenerator();
1214
}

src/DiagramElement/ExternalPackage/PackageHierarchy.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,13 @@
66

77
class PackageHierarchy
88
{
9-
/**
10-
* @var string[] external packages.
11-
*/
12-
private array $externalPackages;
13-
149
private PackageNode $root;
1510

1611
/**
1712
* @param string[] $externalPackages external package list
1813
*/
1914
public function __construct(array $externalPackages)
2015
{
21-
$this->externalPackages = $externalPackages;
2216
$this->root = new PackageNode('root');
2317
foreach ($externalPackages as $p) {
2418
$this->root->register(explode('.', $p));

src/Main.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
class Main
1616
{
17-
const VERSION = 'v0.6.1';
17+
const VERSION = 'v1.0.0';
1818

1919
public function __construct(string $directory, Options $options)
2020
{

src/Php/PhpAccessModifier.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Smeghead\PhpClassDiagram\Php;
66

7-
use PhpParser\Node\Stmt;
87
use PhpParser\Node\Stmt\{
98
ClassConst,
109
ClassMethod,

test/ClassDiagramClassNameSummaryTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testClassnameWithSummary(): void
3131
$entries[] = new Entry('product', PhpReader::parseFile($directory, $filename, $options)[0]->getInfo(), $options);
3232

3333
$rel = new Relation($entries, $options);
34-
$expected =<<<EOS
34+
$expected = <<<EOS
3535
@startuml class-diagram
3636
package product as product {
3737
class "Product\\n<b>製品</b>" as product_Product {
@@ -67,7 +67,7 @@ public function testClassnameWithoutSummary(): void
6767
$entries[] = new Entry('product', PhpReader::parseFile($directory, $filename, $options)[0]->getInfo(), $options);
6868

6969
$rel = new Relation($entries, $options);
70-
$expected =<<<EOS
70+
$expected = <<<EOS
7171
@startuml class-diagram
7272
package product as product {
7373
class "Product" as product_Product {
@@ -89,5 +89,4 @@ class "Name" as product_Name {
8989
EOS;
9090
$this->assertSame($expected, implode(PHP_EOL, $rel->dump()), 'output PlantUML script.');
9191
}
92-
9392
}

test/OptionsTest.php

Lines changed: 69 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
3+
declare(strict_types=1);
4+
25
use PHPUnit\Framework\TestCase;
36

47
use Smeghead\PhpClassDiagram\Config\Options;
58

6-
final class OptionsTest extends TestCase {
7-
public function setUp(): void {
9+
final class OptionsTest extends TestCase
10+
{
11+
public function setUp(): void
12+
{
813
}
914

10-
public function testNothing(): void {
11-
$opt = [
12-
];
15+
public function testNothing(): void
16+
{
17+
$opt = [];
1318

1419
$options = new Options($opt);
1520

1621
$this->assertNotNull($options, 'initialize Options');
1722
$this->assertSame(false, $options->help(), 'help is off.');
1823
}
19-
public function testH(): void {
24+
public function testH(): void
25+
{
2026
$opt = [
2127
'h' => true,
2228
];
@@ -26,7 +32,8 @@ public function testH(): void {
2632
$this->assertNotNull($options, 'initialize Options');
2733
$this->assertSame(true, $options->help(), 'help is on.');
2834
}
29-
public function testHelp(): void {
35+
public function testHelp(): void
36+
{
3037
$opt = [
3138
'help' => true,
3239
];
@@ -36,7 +43,8 @@ public function testHelp(): void {
3643
$this->assertNotNull($options, 'initialize Options');
3744
$this->assertSame(true, $options->help(), 'help is on.');
3845
}
39-
public function testClassProperties1(): void {
46+
public function testClassProperties1(): void
47+
{
4048
$opt = [
4149
'enable-class-properties' => true,
4250
];
@@ -45,7 +53,8 @@ public function testClassProperties1(): void {
4553

4654
$this->assertSame(true, $options->classProperties(), 'classProperties is on.');
4755
}
48-
public function testClassProperties2(): void {
56+
public function testClassProperties2(): void
57+
{
4958
$opt = [
5059
'disable-class-properties' => true,
5160
];
@@ -54,15 +63,16 @@ public function testClassProperties2(): void {
5463

5564
$this->assertSame(false, $options->classProperties(), 'classProperties is off.');
5665
}
57-
public function testClassProperties3(): void {
58-
$opt = [
59-
];
66+
public function testClassProperties3(): void
67+
{
68+
$opt = [];
6069

6170
$options = new Options($opt);
6271

6372
$this->assertSame(true, $options->classProperties(), 'classProperties is default on.');
6473
}
65-
public function testClassMethods1(): void {
74+
public function testClassMethods1(): void
75+
{
6676
$opt = [
6777
'enable-class-methods' => true,
6878
];
@@ -71,7 +81,8 @@ public function testClassMethods1(): void {
7181

7282
$this->assertSame(true, $options->classMethods(), 'classMethods is on.');
7383
}
74-
public function testClassMethods2(): void {
84+
public function testClassMethods2(): void
85+
{
7586
$opt = [
7687
'disable-class-methods' => true,
7788
];
@@ -80,16 +91,17 @@ public function testClassMethods2(): void {
8091

8192
$this->assertSame(false, $options->classMethods(), 'classMethods is off.');
8293
}
83-
public function testClassMethods3(): void {
84-
$opt = [
85-
];
94+
public function testClassMethods3(): void
95+
{
96+
$opt = [];
8697

8798
$options = new Options($opt);
8899

89100
$this->assertSame(true, $options->classMethods(), 'classMethods is default on.');
90101
}
91102

92-
public function testClassNameSummary1(): void {
103+
public function testClassNameSummary1(): void
104+
{
93105
$opt = [
94106
'enable-class-name-summary' => true,
95107
];
@@ -98,7 +110,8 @@ public function testClassNameSummary1(): void {
98110

99111
$this->assertSame(true, $options->classNameSummary(), 'classNameSummary is on.');
100112
}
101-
public function testClassNameSummary2(): void {
113+
public function testClassNameSummary2(): void
114+
{
102115
$opt = [
103116
'disable-class-name-summary' => true,
104117
];
@@ -107,17 +120,18 @@ public function testClassNameSummary2(): void {
107120

108121
$this->assertSame(false, $options->classNameSummary(), 'classNameSummary is off.');
109122
}
110-
public function testClassNameSummary3(): void {
111-
$opt = [
112-
];
123+
public function testClassNameSummary3(): void
124+
{
125+
$opt = [];
113126

114127
$options = new Options($opt);
115128

116129
$this->assertSame(true, $options->classNameSummary(), 'classNameSummary is default on.');
117130
}
118131

119132

120-
public function testPhp1(): void {
133+
public function testPhp1(): void
134+
{
121135
$opt = [
122136
'php7' => true,
123137
];
@@ -126,7 +140,8 @@ public function testPhp1(): void {
126140

127141
$this->assertSame(Options::PHP7, $options->phpVersion(), 'php version is 7.');
128142
}
129-
public function testPhp2(): void {
143+
public function testPhp2(): void
144+
{
130145
$opt = [
131146
'php8' => true,
132147
];
@@ -135,7 +150,8 @@ public function testPhp2(): void {
135150

136151
$this->assertSame(Options::PHP8, $options->phpVersion(), 'php version is 8.');
137152
}
138-
public function testDiagram1(): void {
153+
public function testDiagram1(): void
154+
{
139155
$opt = [
140156
'class-diagram' => true,
141157
];
@@ -144,7 +160,8 @@ public function testDiagram1(): void {
144160

145161
$this->assertSame(Options::DIAGRAM_CLASS, $options->diagram(), 'diagram is class.');
146162
}
147-
public function testDiagram2(): void {
163+
public function testDiagram2(): void
164+
{
148165
$opt = [
149166
'package-diagram' => true,
150167
];
@@ -153,7 +170,8 @@ public function testDiagram2(): void {
153170

154171
$this->assertSame(Options::DIAGRAM_PACKAGE, $options->diagram(), 'diagram is package.');
155172
}
156-
public function testDiagram_division(): void {
173+
public function testDiagram_division(): void
174+
{
157175
$opt = [
158176
'division-diagram' => true,
159177
];
@@ -162,15 +180,16 @@ public function testDiagram_division(): void {
162180

163181
$this->assertSame(Options::DIAGRAM_DIVSION, $options->diagram(), 'diagram is division.');
164182
}
165-
public function testDiagram3(): void {
166-
$opt = [
167-
];
183+
public function testDiagram3(): void
184+
{
185+
$opt = [];
168186

169187
$options = new Options($opt);
170188

171189
$this->assertSame(Options::DIAGRAM_CLASS, $options->diagram(), 'default diagram is class.');
172190
}
173-
public function testDiagram4(): void {
191+
public function testDiagram4(): void
192+
{
174193
$opt = [
175194
'jig-diagram' => true,
176195
];
@@ -179,7 +198,8 @@ public function testDiagram4(): void {
179198

180199
$this->assertSame(Options::DIAGRAM_JIG, $options->diagram(), 'diagram is jig.');
181200
}
182-
public function testHeader(): void {
201+
public function testHeader(): void
202+
{
183203
$opt = [
184204
'header' => 'title PHP Class Diagram',
185205
];
@@ -188,7 +208,8 @@ public function testHeader(): void {
188208

189209
$this->assertSame('title PHP Class Diagram', $options->headers()[0], 'specified header.');
190210
}
191-
public function testMultipleHeaders(): void {
211+
public function testMultipleHeaders(): void
212+
{
192213
$opt = [
193214
'header' => [
194215
'title PHP Class Diagram',
@@ -201,7 +222,8 @@ public function testMultipleHeaders(): void {
201222
$this->assertSame('title PHP Class Diagram', $options->headers()[0], 'specified header. title');
202223
$this->assertSame('skinparam pageMargin 10', $options->headers()[1], 'specified header. pageMargin');
203224
}
204-
public function testInclude(): void {
225+
public function testInclude(): void
226+
{
205227
$opt = [
206228
'include' => '*.php8',
207229
];
@@ -210,7 +232,8 @@ public function testInclude(): void {
210232

211233
$this->assertSame('*.php8', $options->includes()[0], 'specified include.');
212234
}
213-
public function testMultipleInclude(): void {
235+
public function testMultipleInclude(): void
236+
{
214237
$opt = [
215238
'include' => [
216239
'*.php7',
@@ -223,15 +246,16 @@ public function testMultipleInclude(): void {
223246
$this->assertSame('*.php7', $options->includes()[0], 'specified include. php7');
224247
$this->assertSame('*.php8', $options->includes()[1], 'specified include. php8');
225248
}
226-
public function testIncludeDefault(): void {
227-
$opt = [
228-
];
249+
public function testIncludeDefault(): void
250+
{
251+
$opt = [];
229252

230253
$options = new Options($opt);
231254

232255
$this->assertSame('*.php', $options->includes()[0], 'default include.');
233256
}
234-
public function testexclude(): void {
257+
public function testexclude(): void
258+
{
235259
$opt = [
236260
'exclude' => '*Exception.php',
237261
];
@@ -240,7 +264,8 @@ public function testexclude(): void {
240264

241265
$this->assertSame('*Exception.php', $options->excludes()[0], 'specified exclude.');
242266
}
243-
public function testMultipleExclude(): void {
267+
public function testMultipleExclude(): void
268+
{
244269
$opt = [
245270
'exclude' => [
246271
'*Exception.php',
@@ -253,13 +278,12 @@ public function testMultipleExclude(): void {
253278
$this->assertSame('*Exception.php', $options->excludes()[0], 'specified exclude. *Exception.php');
254279
$this->assertSame('config.php', $options->excludes()[1], 'specified exclude. config.php');
255280
}
256-
public function testExcludeDefault(): void {
257-
$opt = [
258-
];
281+
public function testExcludeDefault(): void
282+
{
283+
$opt = [];
259284

260285
$options = new Options($opt);
261286

262287
$this->assertSame(0, count($options->excludes()), 'default exclude is empty.');
263288
}
264-
265289
}

0 commit comments

Comments
 (0)