Skip to content

Commit 31b29b8

Browse files
committed
fix phpdoc
we need to stop it using "jms/serializer" 1.8.0 or later, there's an issue with paths add a "1" to the end of some autogenerated enum names to stop phpdoc falling over
1 parent 3678b8a commit 31b29b8

File tree

6 files changed

+16
-5
lines changed

6 files changed

+16
-5
lines changed

Diff for: composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"psr/log": "^1.0.2"
2323
},
2424
"require-dev": {
25+
"jms/serializer" : ">=0.12 < 1.8.0",
2526
"phpunit/phpunit": "^6.5",
2627
"phpdocumentor/phpdocumentor" : "^2.9",
2728
"jakub-onderka/php-parallel-lint": "^1.0.0",

Diff for: examples/generate_phpdoc.py

+10
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@
6161
# for VipsOperationFlags
6262
_OPERATION_DEPRECATED = 8
6363

64+
# some names we might generate are reserved PHP names ... just append a "1".
65+
reserved_php_names = {
66+
'DEFAULT': 'DEFAULT1',
67+
'XOR': 'XOR1',
68+
'AND': 'AND1',
69+
'OR': 'OR1'
70+
}
71+
6472

6573
def gtype_to_php(gtype, result=False):
6674
"""Map a gtype to PHP type name we use to represent it.
@@ -322,6 +330,8 @@ def add_enum(gtype, a, b):
322330

323331
for value in values_for_enum(gtype):
324332
php_name = value.replace('-', '_').upper()
333+
if php_name in reserved_php_names:
334+
php_name = reserved_php_names[php_name]
325335
f.write(' const {0} = \'{1}\';\n'.format(php_name, value))
326336

327337
f.write('}\n')

Diff for: src/BlendMode.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ abstract class BlendMode
6060
const DEST_IN = 'dest-in';
6161
const DEST_OUT = 'dest-out';
6262
const DEST_ATOP = 'dest-atop';
63-
const XOR = 'xor';
63+
const XOR1 = 'xor';
6464
const ADD = 'add';
6565
const SATURATE = 'saturate';
6666
const MULTIPLY = 'multiply';

Diff for: src/ForeignWebpPreset.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
*/
5050
abstract class ForeignWebpPreset
5151
{
52-
const DEFAULT = 'default';
52+
const DEFAULT1 = 'default';
5353
const PICTURE = 'picture';
5454
const PHOTO = 'photo';
5555
const DRAWING = 'drawing';

Diff for: src/Image.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ class Image extends ImageAutodoc implements \ArrayAccess
558558
BlendMode::DEST_IN => 8,
559559
BlendMode::DEST_OUT => 9,
560560
BlendMode::DEST_ATOP => 10,
561-
BlendMode::XOR => 11,
561+
BlendMode::XOR1 => 11,
562562
BlendMode::ADD => 12,
563563
BlendMode::SATURATE => 13,
564564
BlendMode::MULTIPLY => 14,

Diff for: src/OperationBoolean.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
*/
5050
abstract class OperationBoolean
5151
{
52-
const AND = 'and';
53-
const OR = 'or';
52+
const AND1 = 'and';
53+
const OR1 = 'or';
5454
const EOR = 'eor';
5555
const LSHIFT = 'lshift';
5656
const RSHIFT = 'rshift';

0 commit comments

Comments
 (0)