Skip to content

Commit 7e76f08

Browse files
committed
Fix PHP Parse errors in tests.
PHP 7.1 and PHP 7.2 don't support a comma after a heredoc end (T_END_HEREDOC)
1 parent 63912e8 commit 7e76f08

File tree

4 files changed

+26
-24
lines changed

4 files changed

+26
-24
lines changed

.github/workflows/ci.yaml

+7-5
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,19 @@ jobs:
3737
- name: "Checkout code"
3838
uses: actions/checkout@v4
3939

40-
- name: "Install PHP with extensions"
40+
- name: "Install PHP"
4141
uses: shivammathur/setup-php@v2
4242
with:
4343
coverage: "none"
4444
php-version: ${{ matrix.php }}
4545
tools: composer:${{ matrix.composer }}
4646

47+
- if: matrix.php == '7.1'
48+
name: "Lint PHP files"
49+
run: |
50+
find src/ -name '*.php' | xargs -n1 php -l
51+
find tests/ -name '*.php' | xargs -n1 php -l
52+
4753
- name: "Validate composer.json"
4854
run: "composer validate --strict --no-check-lock"
4955

@@ -71,7 +77,3 @@ jobs:
7177
fi
7278
7379
- run: vendor/bin/simple-phpunit
74-
75-
- if: matrix.php == '7.1'
76-
name: "Lint PHP files"
77-
run: find src/ -name '*.php' | xargs -n1 php -l

tests/Configurator/AddLinesConfiguratorTest.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function testLinesAddedAfterTarget()
142142
143143
// enables the Symfony UX Stimulus bridge (used in assets/bootstrap.js)
144144
.enableStimulusBridge('./assets/controllers.json')
145-
EOF,
145+
EOF
146146
],
147147
]);
148148

@@ -191,7 +191,7 @@ public function testSkippedIfTargetCannotBeFound()
191191
'content' => <<<EOF
192192
193193
// some new line
194-
EOF,
194+
EOF
195195
],
196196
]);
197197

@@ -375,7 +375,7 @@ public function getUnconfigureTests()
375375
import * as Turbo from '@hotwired/turbo';
376376
377377
console.log(Turbo);
378-
EOF,
378+
EOF
379379
];
380380

381381
yield 'found_top' => [
@@ -391,7 +391,7 @@ public function getUnconfigureTests()
391391
import './bootstrap';
392392
393393
console.log(Turbo);
394-
EOF,
394+
EOF
395395
];
396396

397397
yield 'found_bottom' => [
@@ -407,7 +407,7 @@ public function getUnconfigureTests()
407407
import * as Turbo from '@hotwired/turbo';
408408
import './bootstrap';
409409
410-
EOF,
410+
EOF
411411
];
412412

413413
yield 'not_found' => [
@@ -424,7 +424,7 @@ public function getUnconfigureTests()
424424
import './bootstrap';
425425
426426
console.log(Turbo);
427-
EOF,
427+
EOF
428428
];
429429

430430
yield 'found_twice_in_file' => [
@@ -442,7 +442,7 @@ public function getUnconfigureTests()
442442
import './bootstrap';
443443
444444
console.log(Turbo);
445-
EOF,
445+
EOF
446446
];
447447
}
448448

@@ -535,7 +535,7 @@ public function getUpdateTests()
535535
console.log('bootstrap.js');
536536
537537
console.log('on the bottom');
538-
EOF,
538+
EOF
539539
],
540540
];
541541

tests/Update/DiffHelperTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function getRemoveFilesFromPatchTests(): iterable
118118
-# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
119119
-# For a PostgreSQL database, use: "postgresql://db_user:[email protected]:5432/db_name?serverVersion=11&charset=utf8"
120120
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
121-
EOF,
121+
EOF
122122
],
123123
];
124124

@@ -169,7 +169,7 @@ public function getRemoveFilesFromPatchTests(): iterable
169169
+ #server_version: '13'
170170
orm:
171171
auto_generate_proxy_classes: true
172-
EOF,
172+
EOF
173173
],
174174
];
175175

@@ -220,7 +220,7 @@ public function getRemoveFilesFromPatchTests(): iterable
220220
+ dbal:
221221
+ # "TEST_TOKEN" is typically set by ParaTest
222222
+ dbname_suffix: '_test%env(default::TEST_TOKEN)%'
223-
EOF,
223+
EOF
224224
],
225225
];
226226

@@ -273,7 +273,7 @@ public function getRemoveFilesFromPatchTests(): iterable
273273
+ #server_version: '13'
274274
orm:
275275
auto_generate_proxy_classes: true
276-
EOF,
276+
EOF
277277
],
278278
];
279279

@@ -328,7 +328,7 @@ public function getRemoveFilesFromPatchTests(): iterable
328328
- type: pool
329329
- pool: doctrine.system_cache_pool
330330
query_cache_driver:
331-
EOF,
331+
EOF
332332
],
333333
];
334334
}

tests/Update/RecipePatcherTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function getGeneratePatchTests(): iterable
103103
\ No newline at end of file
104104
+Updated file2
105105
\ No newline at end of file
106-
EOF,
106+
EOF
107107
];
108108

109109
yield 'file_created_in_update_because_missing' => [
@@ -118,7 +118,7 @@ public function getGeneratePatchTests(): iterable
118118
@@ -0,0 +1 @@
119119
+New file
120120
\ No newline at end of file
121-
EOF,
121+
EOF
122122
];
123123

124124
yield 'file_created_in_update_because_null' => [
@@ -133,7 +133,7 @@ public function getGeneratePatchTests(): iterable
133133
@@ -0,0 +1 @@
134134
+New file
135135
\ No newline at end of file
136-
EOF,
136+
EOF
137137
];
138138

139139
yield 'file_deleted_in_update_because_missing' => [
@@ -491,7 +491,7 @@ private function getFilesForPatching(string $projectPath = ''): array
491491
# For an SQL-HEAVY database, use: "sqlheavy:///%kernel.project_dir%/var/data.db"
492492
DATABASE_URL=sqlite:///%kernel.project_dir%/var/data.db
493493
###< doctrine/doctrine-bundle ###
494-
EOF,
494+
EOF
495495
],
496496

497497
// package.json
@@ -536,7 +536,7 @@ private function getFilesForPatching(string $projectPath = ''): array
536536
"@symfony/webpack-encore": "^1.7.0"
537537
}
538538
}
539-
EOF,
539+
EOF
540540
],
541541

542542
// config/packages/webpack_encore.yaml
@@ -557,7 +557,7 @@ private function getFilesForPatching(string $projectPath = ''): array
557557
output_path: '%kernel.project_dir%/public/build'
558558
# If multiple builds are defined (as shown below), you can disable the default build:
559559
# output_path: false
560-
EOF,
560+
EOF
561561
],
562562

563563
// config/packages/security.yaml

0 commit comments

Comments
 (0)