Skip to content

Commit 5cd94fb

Browse files
authored
Merge pull request #3 from makeey/feature-php-7.4
Move application to the php 7.4. Fix a couple bugs with function
2 parents 7467664 + 8394595 commit 5cd94fb

38 files changed

+246
-184
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
build:
44
docker:
5-
- image: php:7.2.17
5+
- image: php:7.4
66
steps:
77
- run:
88
name: Install system packages

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
],
1919
"license": "MIT",
2020
"require": {
21-
"php": "^7.2",
21+
"php": "^7.4",
2222
"php-di/php-di": "^6.0",
2323
"php-ds/php-ds": "^1.2",
2424
"symfony/console": "^5.0"

src/Application.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
class Application implements IApplication
1010
{
11-
/** @var \Symfony\Component\Console\Application */
12-
private $application;
11+
private \Symfony\Component\Console\Application $application;
1312

1413
public function __construct(Command ...$commands)
1514
{

src/Command/GenerateCommand.php

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

1212
class GenerateCommand extends Command
1313
{
14-
/** @var Generator */
15-
private $generator;
14+
protected static $defaultName = 'generate';
15+
private Generator $generator;
1616

1717
public function __construct(Generator $generator, string $name = null)
1818
{
1919
$this->generator = $generator;
2020
parent::__construct($name);
2121
}
2222

23-
protected static $defaultName = 'generate';
24-
2523
protected function configure(): void
2624
{
2725
$this->setDescription("Generate class diagram")

src/FileWriter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
class FileWriter implements IWriter
66
{
7-
/** @var string|null */
8-
private $path;
7+
private ?string $path;
98

109
public function setOutput(string $path): IWriter
1110
{

src/Generator.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,12 @@
1111

1212
class Generator
1313
{
14-
/** @var IWriter * */
15-
private $writer;
16-
/** @var IFileCollector * */
17-
private $fileCollector;
18-
/** @var IUMLDiagramFactory * */
19-
private $umlFactory;
20-
/** @var SourceParser * */
21-
private $sourceParser;
22-
/** @var IFormatter * */
23-
private $formatter;
24-
/** @var IFileTransform */
25-
private $fileTransform;
14+
private IWriter $writer;
15+
private IFileCollector $fileCollector;
16+
private IUMLDiagramFactory $umlFactory;
17+
private SourceParser $sourceParser;
18+
private IFormatter $formatter;
19+
private IFileTransform $fileTransform;
2620

2721
public function __construct(
2822
IWriter $writer,

src/Parser/Entity/PhpClass.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@
44

55
final class PhpClass
66
{
7-
/** @var string */
8-
private $namespace;
9-
/** @var string */
10-
private $name;
7+
private string $namespace;
8+
private string $name;
119
/** @var PhpClassMember[] */
12-
private $properties;
10+
private array $properties;
1311
/** @var PhpMethod[] */
14-
private $methods;
15-
/** @var string|null */
16-
private $parent;
12+
private array $methods;
13+
private ?string $parent;
1714
/** @var string[] */
18-
private $implements;
15+
private array $implements;
1916

2017
public function __construct(
2118
string $name,

src/Parser/Entity/PhpClassMember.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44

55
final class PhpClassMember
66
{
7-
/** @var string|null */
8-
private $type;
9-
/** @var string */
10-
private $name;
11-
/** @var string */
12-
private $accessModifier;
7+
private ?string $type;
8+
private string $name;
9+
private string $accessModifier;
1310

1411
public function __construct(string $name, string $accessModifier, ?string $type)
1512
{

src/Parser/Entity/PhpFile.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66

77
class PhpFile
88
{
9-
/** @var string */
10-
private $namespace;
9+
private ?string $namespace = null;
1110
/** @var PhpClass[] */
12-
private $classes = [];
11+
private array $classes = [];
1312
/** @var PhpInterface[] */
14-
private $interfaces = [];
15-
/** @var array */
16-
private $usedClasses = [];
13+
private array $interfaces = [];
14+
private array $usedClasses = [];
1715

1816
public function appendClasses(PhpClass ...$classes): self
1917
{

src/Parser/Entity/PhpInterface.php

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

55
final class PhpInterface
66
{
7-
/** @var string **/
8-
private $namespace;
9-
/** @var string */
10-
private $interfaceName;
7+
private string $namespace;
8+
private string $interfaceName;
119
/** @var PhpMethod[] */
12-
private $methods;
13-
/** @var string|null */
14-
private $parent;
10+
private array $methods;
11+
private ?string $parent;
1512

1613
public function __construct(string $interfaceName, array $methods, string $namespace, ?string $parent)
1714
{

0 commit comments

Comments
 (0)