Skip to content

Commit 01f4fcc

Browse files
committed
Supports Hyperf 3.0
1 parent 911a0e8 commit 01f4fcc

File tree

8 files changed

+31
-26
lines changed

8 files changed

+31
-26
lines changed

.github/workflows/tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: [ ubuntu-latest ]
18-
php: [ '8.1', '8.0', '7.4' ]
19-
hyperf: [ '^2.0' ]
18+
php: [ '8.2', '8.1', '8.0' ]
19+
hyperf: [ '^3.0' ]
2020
dependency-version: [prefer-lowest, prefer-stable]
2121
fail-fast: false
2222

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Unreleased
44

5+
## v2.0.0 (2023/1/6)
6+
7+
## Added
8+
- Support Hyperf 3.0
9+
510
## v1.1.0 (2023/1/6)
611

712
### Added

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,10 @@ php bin/hyperf.php tinker
102102
],
103103
}
104104
```
105+
106+
## Supported Versions
107+
108+
| Version | Hyperf Version | Php Version | Status |
109+
| ------- | -------------- | ----------------- | ---------------------- |
110+
| 2.x | ^3.0 | >=8.0 | Mainstream support |
111+
| 1.x | ^1.0\|^2.0 | <=7.2\|^8.0\|^8.1 | Security fixes support |

composer.json

+9-11
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,19 @@
1111
}
1212
],
1313
"require": {
14-
"php": ">=7.2",
15-
"ext-swoole": ">=4.4",
16-
"hyperf/contract": "^1.0|^2.0",
17-
"hyperf/di": "^1.0|^2.0",
18-
"hyperf/command": "^1.0|^2.0",
14+
"php": ">=8.0",
15+
"ext-swoole": ">=4.5",
16+
"hyperf/contract": "^3.0",
17+
"hyperf/di": "^3.0",
18+
"hyperf/command": "^3.0",
1919
"psy/psysh": "^0.10.6"
2020
},
2121
"require-dev": {
22-
"hyperf/database": "^1.0|^2.0",
23-
"hyperf/testing": "^1.0|^2.0",
22+
"friendsofphp/php-cs-fixer": "^3.6",
23+
"hyperf/database": "^3.0",
24+
"hyperf/testing": "^3.0",
2425
"mockery/mockery": "^1.4"
2526
},
26-
"suggest": {
27-
"hyperf/database": "The Hypyerf Database package (^1.0|^2.0)."
28-
},
2927
"autoload": {
3028
"psr-4": {
3129
"Gokure\\HyperfTinker\\": "src/"
@@ -40,7 +38,7 @@
4038
},
4139
"extra": {
4240
"branch-alias": {
43-
"dev-master": "1.x-dev"
41+
"dev-master": "2.x-dev"
4442
},
4543
"hyperf": {
4644
"config": "Gokure\\HyperfTinker\\ConfigProvider"

src/TinkerCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,6 @@ protected function getCasters()
112112

113113
$config = $this->container->get(ConfigInterface::class);
114114

115-
return array_merge($casters, (array) $config->get('tinker.casters', []));
115+
return array_merge($casters, (array)$config->get('tinker.casters', []));
116116
}
117117
}

tests/TinkerCasterTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace Gokure\HyperfTinker\Tests;
44

55
use App\Model\User;
6-
use Hyperf\Utils\Collection;
76
use Gokure\HyperfTinker\TinkerCaster;
7+
use Hyperf\Utils\Collection;
88
use PHPUnit\Framework\TestCase;
99

1010
class TinkerCasterTest extends TestCase

tests/fixtures/app/Model/User.php

+5-10
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,18 @@
66

77
class User extends Model
88
{
9-
protected $attributes = [
10-
'first_name' => '',
11-
'last_name' => '',
12-
'secret' => '',
13-
];
14-
15-
protected $guarded = [];
9+
protected array $guarded = [];
1610

17-
protected $appends = [
11+
protected array $appends = [
1812
'full_name',
1913
];
2014

21-
protected $hidden = [
15+
protected array $hidden = [
2216
'secret',
2317
];
2418

25-
public function getFullNameAttribute() {
19+
public function getFullNameAttribute()
20+
{
2621
return $this->first_name . ' ' . $this->last_name;
2722
}
2823
}

tests/fixtures/vendor/composer/autoload_classmap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
$vendorDir = dirname(dirname(__FILE__));
3+
$vendorDir = dirname(__FILE__, 2);
44
$baseDir = dirname($vendorDir);
55

66
return [

0 commit comments

Comments
 (0)