Skip to content

Commit d241836

Browse files
authored
update PHP Parser to 1.x (#121)
fixes #8
1 parent 5051e3b commit d241836

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Yii Framework 2 apidoc extension Change Log
44
2.1.0 under development
55
-----------------------
66

7-
- no changes in this release.
7+
- Enh #8: Updated PHP Parser dependency to from version 0.9 to 1.0 to resolve dependency conflicts with other libraries.
8+
This breaks the implementation of the `yii\apidoc\helpers\PrettyPrinter` class (cebe)
89

910

1011
2.0.6 November 22, 2016

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
],
2020
"minimum-stability": "dev",
2121
"require": {
22+
"php": ">=5.4",
2223
"yiisoft/yii2": "~2.0.4",
2324
"yiisoft/yii2-bootstrap": "~2.0.0",
24-
"phpdocumentor/reflection": "^1.0.3",
25-
"phpdocumentor/reflection-docblock": "^2.0.1",
26-
"nikic/php-parser": "0.9.*",
25+
"phpdocumentor/reflection": "^3.0.1",
26+
"phpdocumentor/reflection-docblock": "^2.0.4",
27+
"nikic/php-parser": "^1.0",
2728
"cebe/js-search": "~0.9.3",
2829
"cebe/markdown": "~1.0.0 | ~1.1.0",
2930
"cebe/markdown-latex": "~1.0",

helpers/PrettyPrinter.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
namespace yii\apidoc\helpers;
99

10-
use PHPParser_Node_Expr;
11-
use PHPParser_Node_Expr_Array;
10+
use PhpParser\Node\Expr;
1211

1312
/**
1413
* Enhances the phpDocumentor PrettyPrinter with short array syntax
@@ -19,21 +18,21 @@
1918
class PrettyPrinter extends \phpDocumentor\Reflection\PrettyPrinter
2019
{
2120
/**
22-
* @param PHPParser_Node_Expr_Array $node
21+
* @param Expr\Array_ $node
2322
* @return string
2423
*/
25-
public function pExpr_Array(PHPParser_Node_Expr_Array $node)
24+
public function pExpr_Array(Expr\Array_ $node)
2625
{
2726
return '[' . $this->pCommaSeparated($node->items) . ']';
2827
}
2928

3029
/**
3130
* Returns a simple human readable output for a value.
3231
*
33-
* @param PHPParser_Node_Expr $value The value node as provided by PHP-Parser.
32+
* @param Expr $value The value node as provided by PHP-Parser.
3433
* @return string
3534
*/
36-
public static function getRepresentationOfValue(PHPParser_Node_Expr $value)
35+
public static function getRepresentationOfValue(Expr $value)
3736
{
3837
if ($value === null) {
3938
return '';

0 commit comments

Comments
 (0)