Skip to content

Commit f81ec02

Browse files
authored
Allowing version 6 and 7 of symfony/yaml (#346)
* Allowing version 6 of symfony/yaml * allowing symfony 7 as well * another odd psalm error * psalm upgrade and fixes * psalm fix * upgrading codecov github action * adding codecov token
1 parent 5cbee44 commit f81ec02

File tree

5 files changed

+538
-205
lines changed

5 files changed

+538
-205
lines changed

.github/workflows/build.yml

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,48 @@
11
name: Build
22
on:
3-
push:
4-
branches:
5-
- master
6-
pull_request:
7-
branches:
8-
- master
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
99
jobs:
10-
build:
11-
name: PHP ${{ matrix.php-versions }} ${{ matrix.composer-args }}
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
operating-system: [ubuntu-latest]
16-
php-versions: ['7.4', '8.0', '8.1', '8.2']
17-
composer-args: ['', '--prefer-lowest']
18-
runs-on: ${{ matrix.operating-system }}
19-
steps:
20-
- name: Checkout
21-
uses: actions/[email protected]
22-
- name: Setup PHP
23-
uses: shivammathur/setup-php@v2
24-
with:
25-
php-version: ${{ matrix.php-versions }}
26-
extensions: mbstring, apcu
27-
ini-values: apc.enable_cli=1
28-
coverage: xdebug
29-
- name: Install Dependencies
30-
run: |
31-
composer update --no-progress --no-suggest --prefer-stable --optimize-autoloader ${{ matrix.composer-args }}
32-
- name: Static Analysis
33-
run: |
34-
composer phpstan
35-
composer psalm -- --shepherd
36-
- name: Code Style Check
37-
env:
38-
PHP_CS_FIXER_IGNORE_ENV: true
39-
run: composer style-check
40-
- name: Test
41-
run: composer test-with-coverage
42-
- name: Upload Coverage
43-
uses: codecov/codecov-action@v3
44-
with:
45-
files: ./tests/coverage/clover.xml
46-
verbose: true
10+
build:
11+
name: PHP ${{ matrix.php-versions }} ${{ matrix.composer-args }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
operating-system: [ubuntu-latest]
16+
php-versions: ["7.4", "8.0", "8.1", "8.2"]
17+
composer-args: ["", "--prefer-lowest"]
18+
runs-on: ${{ matrix.operating-system }}
19+
steps:
20+
- name: Checkout
21+
uses: actions/[email protected]
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-versions }}
26+
extensions: mbstring, apcu
27+
ini-values: apc.enable_cli=1
28+
coverage: xdebug
29+
- name: Install Dependencies
30+
run: |
31+
composer update --no-progress --no-suggest --prefer-stable --optimize-autoloader ${{ matrix.composer-args }}
32+
- name: Static Analysis
33+
run: |
34+
composer phpstan
35+
composer psalm -- --shepherd
36+
- name: Code Style Check
37+
env:
38+
PHP_CS_FIXER_IGNORE_ENV: true
39+
run: composer style-check
40+
- name: Test
41+
run: composer test-with-coverage
42+
- name: Upload Coverage
43+
uses: codecov/codecov-action@v4
44+
env:
45+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
46+
with:
47+
files: ./tests/coverage/clover.xml
48+
verbose: true

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
"require": {
4040
"php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0",
4141
"ext-pdo": "*",
42-
"symfony/yaml": "^3.4 || ^4.1 || ^5.0"
42+
"symfony/yaml": "^3.4 || ^4.1 || ^5.0 || ^6.0 || ^7.0"
4343
},
4444
"require-dev": {
4545
"phpunit/php-code-coverage": "^9.1.10",
4646
"friendsofphp/php-cs-fixer": "^3.51.0",
4747
"phpstan/phpstan": "1.10.14",
48-
"vimeo/psalm": "5.9.0"
48+
"vimeo/psalm": "5.23.1"
4949
},
5050
"scripts": {
5151
"test": "cd tests && php run.php",

lib/Doctrine/Cache/Memcache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ protected function _getCacheKeys()
145145
foreach (array_keys($slabs) as $slabId) {
146146
$dump = $this->_memcache->getExtendedStats('cachedump', (int) $slabId);
147147
foreach ($dump as $entries) {
148-
if ($entries) {
148+
if ($entries !== false && !empty($entries)) {
149149
$keys = array_merge($keys, array_keys($entries));
150150
}
151151
}

lib/Doctrine/Import/Schema.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ public function importSchema($schema, $format = 'yml', $directory = null, $model
277277

278278
if (count($array) == 0) {
279279
throw new Doctrine_Import_Exception(
280-
sprintf('No ' . $format . ' schema found in ' . implode(', ', $schema))
280+
'No ' . $format . ' schema found in ' . implode(', ', $schema)
281281
);
282282
}
283283

@@ -766,7 +766,7 @@ protected function _validateSchemaElement($name, $element, $path)
766766
foreach ($element as $key => $value) {
767767
if (! isset($validation[$value])) {
768768
throw new Doctrine_Import_Exception(
769-
sprintf('Invalid schema element named "' . $value . '" at path "' . $path . '"')
769+
'Invalid schema element named "' . $value . '" at path "' . $path . '"'
770770
);
771771
}
772772
}

0 commit comments

Comments
 (0)