Skip to content

Commit 90ac332

Browse files
Merge pull request #98 from mirko-pagliai/develop
Develop
2 parents 527328a + 88070ea commit 90ac332

29 files changed

+271
-124
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
php-version: ['7.4', '8.0', '8.1']
15+
php-version: ['7.4', '8.0', '8.1', '8.2']
1616
db-type: [sqlite, mysql, pgsql]
1717
prefer-lowest: ['']
1818
exclude:
@@ -30,6 +30,9 @@ jobs:
3030
- php-version: '8.1'
3131
db-type: 'mysql'
3232
prefer-lowest: 'prefer-lowest'
33+
- php-version: '8.2'
34+
db-type: 'mysql'
35+
prefer-lowest: 'prefer-lowest'
3336

3437
steps:
3538
- name: Setup Database
@@ -53,7 +56,7 @@ jobs:
5356

5457
- name: Cache Composer packages
5558
id: composer-cache
56-
uses: actions/cache@v2
59+
uses: actions/cache@v3
5760
with:
5861
path: vendor
5962
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
@@ -93,7 +96,7 @@ jobs:
9396
9497
- name: Submit code coverage
9598
if: matrix.php-version == '8.0'
96-
uses: codecov/codecov-action@v2
99+
uses: codecov/codecov-action@v3
97100

98101
cs-stan:
99102
name: Coding Standard & Static Analysis
@@ -105,7 +108,7 @@ jobs:
105108
- name: Setup PHP
106109
uses: shivammathur/setup-php@v2
107110
with:
108-
php-version: '8.0'
111+
php-version: '8.1'
109112
coverage: none
110113
tools: cs2pr
111114

@@ -126,13 +129,13 @@ jobs:
126129
if: success() || failure()
127130
env:
128131
db_dsn: 'sqlite:///:memory:'
129-
run: vendor/bin/psalm.phar --output-format=github --php-version=8.0
132+
run: vendor/bin/psalm --output-format=github --php-version=8.1
130133

131134
- name: Run phpstan
132135
if: success() || failure()
133136
env:
134137
db_dsn: 'sqlite:///:memory:'
135-
run: vendor/bin/phpstan.phar analyse --error-format=github
138+
run: vendor/bin/phpstan analyse --error-format=github
136139

137140

138141
testsuite-windows:
@@ -161,7 +164,7 @@ jobs:
161164

162165
- name: Cache Composer packages
163166
id: composer-cache
164-
uses: actions/cache@v2
167+
uses: actions/cache@v3
165168
with:
166169
path: vendor
167170
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.directory
22
.idea
3-
.phpunit.result.cache
3+
.phpunit.*cache
44
*_old
55
*.old.*
66
composer.lock

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# 2.x branch
22
## 2.12 branch
3+
### 2.12.2
4+
* improved and fixed a bug for `ExportCommand` and `ImportCommand`, in handling some exceptions;
5+
* it no longer needs the `me-tools` package. This removes several (useless) dependencies;
6+
* some, possible changes that prepare it for CakePHP 5 and PHPUnit 10 ([issue #97](https://github.com/mirko-pagliai/cakephp-database-backup/issues/97));
7+
* little fixes. Fixed some deprecations for CakePHP 4.5 ([issue #97](https://github.com/mirko-pagliai/cakephp-database-backup/issues/97));
8+
* improved `BackuManager::index()` method, also regarding the correct files sorting. This also solves a small bug for
9+
the `rotate()` method (which precisely affects `index()`). The `index()` method now returns a collection of arrays (
10+
and no longer a collection of `Entity`);
11+
* some testing methods that have been missing for a long time have been added;
12+
* the `BackupTrait::getDriverName()` method can no longer be static;
13+
* removed (old and useless) `BaseCommandTestCase` class;
14+
* added tests for PHP 8.2.
15+
316
### 2.12.1
417
* fixed a little bug in the `bootstrap.php` file;
518
* the `Exceptionist` class provided by me-tools is no longer used (in anticipation of an upcoming deprecation).

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,17 @@
1111
}
1212
],
1313
"require": {
14-
"php": ">=7.4",
14+
"php": ">=7.4.0",
1515
"ext-fileinfo": "*",
1616
"cakephp/cakephp": "^4.0",
1717
"mirko-pagliai/php-tools": "~1.7.4"
1818
},
1919
"require-dev": {
2020
"cakephp/cakephp-codesniffer": "^4.4",
2121
"cakephp/migrations": "^3.2",
22-
"mirko-pagliai/me-tools": "^2.20.9",
2322
"phpunit/phpunit": "^9.1|^9.5",
24-
"phpstan/phpstan": "^1.7",
25-
"psalm/phar": "^4.24"
23+
"phpstan/phpstan": "^1.10.38",
24+
"vimeo/psalm": "^5.15.0"
2625
},
2726
"autoload": {
2827
"psr-4": {

config/bootstrap.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717
use Cake\Core\Configure;
1818
use Symfony\Component\Process\ExecutableFinder;
1919

20+
/**
21+
* @todo remove the `file_exists()` on CakePHP >= 5
22+
*/
23+
if (file_exists(CAKE . 'functions.php')) {
24+
require CAKE . 'functions.php';
25+
}
26+
2027
/**
2128
* Executables. Name of driver as keys, Then, as value, an array that contains
2229
* first the executable to export and then the executable to import backups.

php-doc-maker.xml

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

phpstan-baseline.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ parameters:
1414
message: "#^Expression \"\\$this\\-\\>BackupExport\\-\\>noExistingProperty\" on a separate line does not do anything\\.$#"
1515
count: 1
1616
path: tests/TestCase/Utility/BackupExportAndImportTest.php
17-

psalm-baseline.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,4 @@
1616
<code>empty($this-&gt;Driver)</code>
1717
</TypeDoesNotContainType>
1818
</file>
19-
<file src="src/Utility/BackupManager.php">
20-
<TooManyTemplateParams occurrences="1">
21-
<code>\Cake\Collection\CollectionInterface&lt;\Cake\ORM\Entity&gt;</code>
22-
</TooManyTemplateParams>
23-
</file>
2419
</files>

psalm.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
88
autoloader="tests/bootstrap.php"
99
errorBaseline="psalm-baseline.xml"
10-
>
10+
findUnusedBaselineEntry="true"
11+
findUnusedCode="false">
1112
<projectFiles>
1213
<directory name="src" />
1314
<ignoreFiles>

src/BackupTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ public static function getConnection(?string $name = null): ConnectionInterface
6464
* @throws \ReflectionException
6565
* @since 2.9.2
6666
*/
67-
public static function getDriverName(): string
67+
public function getDriverName(): string
6868
{
69-
return get_class_short_name(self::getConnection()->getDriver());
69+
return get_class_short_name($this->getConnection()->getDriver());
7070
}
7171

7272
/**

0 commit comments

Comments
 (0)