Skip to content

Commit aa52c5b

Browse files
authored
Merge pull request #30 from efureev/lara11
feat: add support Lara 11, PHP 8.3
2 parents a7145b0 + 014c7c1 commit aa52c5b

File tree

10 files changed

+82
-108
lines changed

10 files changed

+82
-108
lines changed

.github/workflows/php.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,23 @@ jobs:
3636
fail-fast: false
3737
matrix:
3838
setup: [ 'basic', 'lowest', 'stable' ]
39-
php: [ '8.0', '8.1' , '8.2' ]
40-
laravel: [ 8.*, 9.* , 10.* ]
39+
php: [ '8.2', '8.3' ]
40+
laravel: [ 11.* ]
4141
include:
42-
- laravel: 10.*
42+
- laravel: 11.*
4343
php: 8.2
44-
testbench: 8.*
45-
vardumper: 6.*
46-
- laravel: 9.*
47-
testbench: 7.*
48-
vardumper: 6.*
49-
- laravel: 8.*
50-
testbench: 6.*
51-
vardumper: 5.*
52-
exclude:
53-
- php: '8.2'
54-
setup: 'lowest'
44+
testbench: 9.*
45+
vardumper: 7.*
46+
# - laravel: 9.*
47+
# testbench: 7.*
48+
# vardumper: 6.*
49+
# exclude:
50+
# - php: '8.2'
51+
# setup: 'lowest'
5552

5653
services:
5754
postgres:
58-
image: postgres:14
55+
image: postgres:16
5956
env:
6057
POSTGRES_USER: postgres
6158
POSTGRES_PASSWORD: postgres
@@ -69,7 +66,7 @@ jobs:
6966
--health-retries 5
7067
7168
steps:
72-
- uses: actions/checkout@v3
69+
- uses: actions/checkout@v4
7370

7471
- name: Use PHP ${{ matrix.php }}
7572
uses: shivammathur/setup-php@v2 # Action page: <https://github.com/shivammathur/setup-php>
@@ -84,7 +81,7 @@ jobs:
8481
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
8582
8683
- name: Cache dependencies
87-
uses: actions/cache@v3
84+
uses: actions/cache@v4
8885
with:
8986
path: ${{ steps.composer-cache.outputs.dir }}
9087
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
uses: actions/checkout@master
1515
- name: Create Release
1616
id: create_release
17-
uses: softprops/action-gh-release@v1
17+
uses: softprops/action-gh-release@v2
1818
env:
1919
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2020
if: startsWith(github.ref, 'refs/tags/')

CHANGELOG.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
<!--- BEGIN HEADER -->
2-
31
# Changelog
42

5-
All notable changes to this project will be documented in this file.
6-
<!--- END HEADER -->
3+
## [4.0.0](https://github.com/efureev/laravel-trees/compare/v3.8.2...v4.0.0) (2024-03-14)
4+
5+
### Added
6+
7+
- Added support `Laravel 11`
8+
- Added support `PHP 8.3`
9+
10+
### Removed
11+
12+
- Removed support `Laravel 10.*`, `9.*`, `8.*`
13+
- Removed support PHP `8.0`, `8.1`
714

815
## [3.8.2](https://github.com/efureev/laravel-trees/compare/v3.8.1...v3.8.2) (2023-09-11)
916

@@ -17,7 +24,6 @@ All notable changes to this project will be documented in this file.
1724

1825
- Soft deleted models is now updating tree attributes (Before not)
1926

20-
2127
## [3.8.0](https://github.com/efureev/laravel-trees/compare/v3.7.0...v3.8.0) (2023-03-20)
2228

2329
### Added

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^8.0|^8.1|^8.2",
20-
"illuminate/database": "^8.8|^9.25|^10.0",
21-
"illuminate/events": "^8.80|^9.25|^10.0",
22-
"efureev/support": "^4.16"
19+
"php": "^8.2|^8.3",
20+
"illuminate/database": "^11.0",
21+
"illuminate/events": "^11.0",
22+
"efureev/support": "^4.27"
2323
},
2424
"require-dev": {
25-
"phpunit/phpunit": "^9.5|^10.0",
26-
"orchestra/testbench": "^6.17|^7.22|8.0",
27-
"fakerphp/faker": "^1.20",
28-
"symfony/var-dumper": "^5.2|^6.1",
29-
"squizlabs/php_codesniffer": "^3.7"
25+
"phpunit/phpunit": "^11.0",
26+
"orchestra/testbench": "^v9.0",
27+
"fakerphp/faker": "^1.23",
28+
"symfony/var-dumper": "^v7.0",
29+
"squizlabs/php_codesniffer": "^3.9"
3030
},
3131
"autoload": {
3232
"psr-4": {

phpunit.xml

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./tests/bootstrap_test.php"
3-
backupGlobals="false"
4-
backupStaticAttributes="false" colors="false" convertErrorsToExceptions="true"
5-
convertNoticesToExceptions="true"
6-
convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false"
7-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd">
8-
<coverage processUncoveredFiles="true">
9-
<include>
10-
<directory suffix=".php">./src</directory>
11-
</include>
12-
<exclude>
13-
<directory>./vendor</directory>
14-
</exclude>
15-
<report>
16-
<clover outputFile="./coverage/clover.xml"/>
17-
<html outputDirectory="./coverage/html"/>
18-
<text outputFile="php://stdout" showUncoveredFiles="false"/>
19-
<xml outputDirectory="./coverage/xml"/>
20-
</report>
21-
</coverage>
22-
<testsuites>
23-
<testsuite name="Main">
24-
<directory suffix="Test.php">./tests</directory>
25-
</testsuite>
26-
</testsuites>
27-
<logging>
28-
<testdoxHtml outputFile="./coverage/index.html"/>
29-
<testdoxXml outputFile="./coverage/testdoxXml.xml"/>
30-
</logging>
31-
<php>
32-
<server name="XDEBUG_MODE" value="coverage"/>
33-
</php>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./tests/bootstrap_test.php" backupGlobals="false" colors="false" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<coverage>
4+
<report>
5+
<clover outputFile="./coverage/clover.xml"/>
6+
<html outputDirectory="./coverage/html"/>
7+
<text outputFile="php://stdout" showUncoveredFiles="false"/>
8+
<xml outputDirectory="./coverage/xml"/>
9+
</report>
10+
</coverage>
11+
<testsuites>
12+
<testsuite name="Main">
13+
<directory suffix="Test.php">./tests</directory>
14+
</testsuite>
15+
</testsuites>
16+
<logging>
17+
<testdoxHtml outputFile="./coverage/index.html"/>
18+
</logging>
19+
<php>
20+
<server name="XDEBUG_MODE" value="coverage"/>
21+
</php>
22+
<source>
23+
<include>
24+
<directory suffix=".php">./src</directory>
25+
</include>
26+
<exclude>
27+
<directory>./vendor</directory>
28+
</exclude>
29+
</source>
3430
</phpunit>

src/NestedSetTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ protected function onDeleteNodeWeShouldToDeleteChildrenBy(): void
905905
}
906906

907907
protected static ?Closure $customRestoreWithDescendantsFn = null;
908-
protected static ?Closure $customRestoreWithParentsFn = null;
908+
protected static ?Closure $customRestoreWithParentsFn = null;
909909

910910
/**
911911
* @param callable(Model, ?string): string|int|null $fn

tests/Functional/DrawTableTest.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Fureev\Trees\Tests\Functional\Helpers\StructureHelper;
1010
use Fureev\Trees\Tests\models\Structure;
1111
use Illuminate\Console\BufferedConsoleOutput;
12+
use PHPUnit\Framework\Attributes\Test;
1213

1314
class DrawTableTest extends AbstractFunctionalTestCase
1415
{
@@ -21,10 +22,7 @@ protected function setUp(): void
2122
(new InstallMigration(Structure::class))->install();
2223
}
2324

24-
25-
/**
26-
* @test
27-
*/
25+
#[Test]
2826
public function drawFromModel(): void
2927
{
3028
$root = $this->createStructure();
@@ -47,9 +45,7 @@ public function drawFromModel(): void
4745
self::assertNotEmpty($str);
4846
}
4947

50-
/**
51-
* @test
52-
*/
48+
#[Test]
5349
public function drawFromTree(): void
5450
{
5551
$root = $this->createStructure();
@@ -80,9 +76,7 @@ public function drawFromTree(): void
8076
}
8177

8278

83-
/**
84-
* @test
85-
*/
79+
#[Test]
8680
public function drawFromCollection(): void
8781
{
8882
$root = $this->createStructure();

tests/Functional/SoftDeleteStructureMovingTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Fureev\Trees\Tests\Functional\Helpers\InstallMigration;
88
use Fureev\Trees\Tests\Functional\Helpers\StructureHelper;
99
use Fureev\Trees\Tests\models\SoftDeleteStructure;
10+
use PHPUnit\Framework\Attributes\Test;
1011

1112
class SoftDeleteStructureMovingTest extends AbstractFunctionalTestCase
1213
{
@@ -19,9 +20,7 @@ protected function setUp(): void
1920
(new InstallMigration(SoftDeleteStructure::class))->install();
2021
}
2122

22-
/**
23-
* @test
24-
*/
23+
#[Test]
2524
public function moveNodeBeforeDeletedNode(): void
2625
{
2726
$root = $this->createSoftDeleteStructure(null, ['title'=> 'Root']);

tests/Functional/SoftDeleteStructureTest.php

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Fureev\Trees\Tests\Functional\Helpers\InstallMigration;
88
use Fureev\Trees\Tests\Functional\Helpers\StructureHelper;
99
use Fureev\Trees\Tests\models\SoftDeleteStructure;
10+
use PHPUnit\Framework\Attributes\Test;
1011

1112
class SoftDeleteStructureTest extends AbstractFunctionalTestCase
1213
{
@@ -19,9 +20,7 @@ protected function setUp(): void
1920
(new InstallMigration(SoftDeleteStructure::class))->install();
2021
}
2122

22-
/**
23-
* @test
24-
*/
23+
#[Test]
2524
public function createOnlyRootAndThenDeleteIt(): void
2625
{
2726
$root = $this->createSoftDeleteStructure();
@@ -49,9 +48,7 @@ public function createOnlyRootAndThenDeleteIt(): void
4948
}
5049

5150

52-
/**
53-
* @test
54-
*/
51+
#[Test]
5552
public function createSoftDeleteStructures(): void
5653
{
5754
$root = $this->createSoftDeleteStructure();
@@ -116,9 +113,7 @@ public function createSoftDeleteStructures(): void
116113
static::assertEquals(0, $structure2->children()->count());
117114
}
118115

119-
/**
120-
* @test
121-
*/
116+
#[Test]
122117
public function moveInstance(): void
123118
{
124119
$root = $this->createSoftDeleteStructure();
@@ -150,9 +145,7 @@ public function moveInstance(): void
150145
static::assertEquals(5, SoftDeleteStructure::count());
151146
}
152147

153-
/**
154-
* @test
155-
*/
148+
#[Test]
156149
public function deleteNodes(): void
157150
{
158151
$root = $this->createSoftDeleteStructure();
@@ -189,9 +182,7 @@ public function deleteNodes(): void
189182
}
190183

191184

192-
/**
193-
* @test
194-
*/
185+
#[Test]
195186
public function deleteAndRestoreNodes(): void
196187
{
197188
$root = $this->createSoftDeleteStructure();
@@ -264,9 +255,7 @@ public function deleteAndRestoreNodes(): void
264255
static::assertEquals(5, SoftDeleteStructure::withTrashed()->count());
265256
}
266257

267-
/**
268-
* @test
269-
*/
258+
#[Test]
270259
public function restoreParentsNodes(): void
271260
{
272261
$root = $this->createSoftDeleteStructure();

tests/Functional/WithoutSoftDeleteStructureTest.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Fureev\Trees\Tests\Functional\Helpers\InstallMigration;
88
use Fureev\Trees\Tests\Functional\Helpers\StructureHelper;
99
use Fureev\Trees\Tests\models\Structure;
10+
use PHPUnit\Framework\Attributes\Test;
1011

1112
class WithoutSoftDeleteStructureTest extends AbstractFunctionalTestCase
1213
{
@@ -19,9 +20,7 @@ protected function setUp(): void
1920
(new InstallMigration(Structure::class))->install();
2021
}
2122

22-
/**
23-
* @test
24-
*/
23+
#[Test]
2524
public function createOnlyRootAndThenDeleteIt(): void
2625
{
2726
$root = $this->createStructure();
@@ -45,9 +44,7 @@ public function createOnlyRootAndThenDeleteIt(): void
4544
}
4645

4746

48-
/**
49-
* @test
50-
*/
47+
#[Test]
5148
public function createStructures(): void
5249
{
5350
$root = $this->createStructure();
@@ -112,9 +109,7 @@ public function createStructures(): void
112109
static::assertEquals(0, $structure2->children()->count());
113110
}
114111

115-
/**
116-
* @test
117-
*/
112+
#[Test]
118113
public function moveInstance(): void
119114
{
120115
$root = $this->createStructure();
@@ -146,9 +141,7 @@ public function moveInstance(): void
146141
static::assertEquals(5, Structure::count());
147142
}
148143

149-
/**
150-
* @test
151-
*/
144+
#[Test]
152145
public function deleteNodes(): void
153146
{
154147
$root = $this->createStructure();

0 commit comments

Comments
 (0)