Skip to content

Commit 8dfdc47

Browse files
committed
Merge branch 'release/4.1.1'
2 parents 63adea2 + 68c45c6 commit 8dfdc47

21 files changed

+69
-97
lines changed

.php_cs renamed to .php-cs-fixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
->exclude('tests/resources')
66
->in(__DIR__);
77

8-
return PhpCsFixer\Config::create()
8+
return (new PhpCsFixer\Config())
99
->setUsingCache(false)
1010
->setRules(array(
1111
'@PhpCsFixer' => true,

.travis.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

CHANGELOG.md

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

3+
## 4.1.1 - 2022/03/24
4+
- Update PHP CS Fixer and corresponding setting file
5+
- Add PHPStan
6+
- Update badges
7+
38
## 4.1.0 - 2021/02/05
49
- issue #12 - Use array short notation
510

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# PhpGenerator, a Real PHP source code generator
22

3-
> PhpGenerator helps generating PHP source code
3+
> PhpGenerator helps to generate PHP source code
44
55
[![License](https://poser.pugx.org/wsdltophp/phpgenerator/license)](https://packagist.org/packages/wsdltophp/phpgenerator)
66
[![Latest Stable Version](https://poser.pugx.org/wsdltophp/phpgenerator/version.png)](https://packagist.org/packages/wsdltophp/phpgenerator)
7-
[![Build Status](https://travis-ci.com/WsdlToPhp/PhpGenerator.svg)](https://travis-ci.com/github/WsdlToPhp/PhpGenerator)
7+
[![TeamCity build status](https://teamcity.mikael-delsol.fr/app/rest/builds/buildType:id:PhpGenerator_Build/statusIcon.svg)](https://github.com/WsdlToPhp/PhpGenerator)
88
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/WsdlToPhp/PhpGenerator/badges/quality-score.png)](https://scrutinizer-ci.com/g/WsdlToPhp/PhpGenerator/)
99
[![Code Coverage](https://scrutinizer-ci.com/g/WsdlToPhp/PhpGenerator/badges/coverage.png)](https://scrutinizer-ci.com/g/WsdlToPhp/PhpGenerator/)
1010
[![Total Downloads](https://poser.pugx.org/wsdltophp/phpgenerator/downloads)](https://packagist.org/packages/wsdltophp/phpgenerator)
1111
[![StyleCI](https://styleci.io/repos/36832375/shield)](https://styleci.io/repos/36832375)
12-
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/e55e9115-5a3f-4d37-bfd5-b01c8de579f9/mini.png)](https://insight.sensiolabs.com/projects/e55e9115-5a3f-4d37-bfd5-b01c8de579f9)
12+
[![SymfonyInsight](https://insight.symfony.com/projects/a384481c-01ba-4c20-a8c6-a4d852ee7985/mini.svg)](https://insight.symfony.com/projects/a384481c-01ba-4c20-a8c6-a4d852ee7985)
1313

1414
Even if this project is yet another PHP source code generator, its main goal is to provide a consistent PHP source code generator for the [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator) project. Nevertheless, it also aims to be used for any PHP source code generation process as it generates standard PHP code.
1515

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717
],
1818
"scripts": {
1919
"test": "vendor/bin/phpunit",
20-
"lint": "vendor/bin/php-cs-fixer fix --ansi --diff --verbose"
20+
"lint": "vendor/bin/php-cs-fixer fix --ansi --diff --verbose",
21+
"phpstan": "vendor/bin/phpstan analyze src --level=3"
2122
},
2223
"require" : {
23-
"php" : ">=7.4"
24+
"php": ">=7.4",
25+
"phpstan/phpstan": "^1.5"
2426
},
2527
"require-dev": {
26-
"friendsofphp/php-cs-fixer": "^2.0",
28+
"friendsofphp/php-cs-fixer": "^3.0",
2729
"phpunit/phpunit": "^9"
2830
},
2931
"autoload" : {

src/Component/GenerateableInterface.php

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

77
interface GenerateableInterface
88
{
9-
const BREAK_LINE_CHAR = "\n";
9+
public const BREAK_LINE_CHAR = "\n";
1010

1111
public function __toString(): string;
1212

src/Component/PhpInterface.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ public function addMethodElement(PhpMethodElement $method): self
2121
$method->setHasBody(false);
2222
}
2323

24-
return parent::addMethodElement($method);
24+
parent::addMethodElement($method);
25+
26+
return $this;
2527
}
2628

2729
public function addMethod(string $name, array $parameters = [], ?string $returnType = null, string $access = PhpMethodElement::ACCESS_PUBLIC, bool $abstract = false, bool $static = false, bool $final = false, bool $hasBody = true): self

src/Element/AbstractElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function toString(?int $indentation = null): string
7676
}
7777
$lines[] = $this->getToStringAfterChildren($indentation);
7878

79-
return implode(self::BREAK_LINE_CHAR, static::cleanArrayToString($lines));
79+
return implode(self::BREAK_LINE_CHAR, self::cleanArrayToString($lines));
8080
}
8181

8282
public function getPhpName(): string

src/Element/AccessRestrictedElementInterface.php

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

77
interface AccessRestrictedElementInterface
88
{
9-
const ACCESS_PRIVATE = 'private';
9+
public const ACCESS_PRIVATE = 'private';
1010

11-
const ACCESS_PROTECTED = 'protected';
11+
public const ACCESS_PROTECTED = 'protected';
1212

13-
const ACCESS_PUBLIC = 'public';
13+
public const ACCESS_PUBLIC = 'public';
1414

15-
const ACCESSES = [
15+
public const ACCESSES = [
1616
self::ACCESS_PRIVATE,
1717
self::ACCESS_PROTECTED,
1818
self::ACCESS_PUBLIC,

src/Element/AssignedValueElementInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface AssignedValueElementInterface
99
/**
1010
* Use this constant as value to ensure element has not assigned value.
1111
*/
12-
const NO_VALUE = '##NO_VALUE##';
12+
public const NO_VALUE = '##NO_VALUE##';
1313

1414
public function setValue($value): AbstractElement;
1515

0 commit comments

Comments
 (0)