Skip to content

Commit 6fd0aa0

Browse files
driesvintstaylorotwell
authored andcommitted
[6.x] PHP 7.4 support (#29482)
* Add PHP 7.4 build * Fix array_key_exists call on object * Fix CreateMembersTable resolving * Fix array call on null for Facade * Rebind $this for static closure macros * Try reverting unbinding closure * Use argument unpacking * Require new minimum mockery version * Fix PHP 7.4 support for email package * Make Symfony 4.3.4 the new minimum requirement * Bump PHPUnit to 8.3 * Remove 7.4 build from failures
1 parent f9ccf59 commit 6fd0aa0

File tree

17 files changed

+48
-43
lines changed

17 files changed

+48
-43
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ matrix:
1414
- php: 7.3
1515
- php: 7.3
1616
env: SETUP=lowest
17+
- php: 7.4snapshot
18+
- php: 7.4snapshot
19+
env: SETUP=lowest
1720

1821
cache:
1922
directories:

composer.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"ext-openssl": "*",
2222
"doctrine/inflector": "^1.1",
2323
"dragonmantank/cron-expression": "^2.0",
24-
"egulias/email-validator": "^2.0",
24+
"egulias/email-validator": "^2.1.10",
2525
"erusev/parsedown": "^1.7",
2626
"league/flysystem": "^1.0.8",
2727
"monolog/monolog": "^1.12|^2.0",
@@ -31,14 +31,14 @@
3131
"psr/simple-cache": "^1.0",
3232
"ramsey/uuid": "^3.7",
3333
"swiftmailer/swiftmailer": "^6.0",
34-
"symfony/console": "^4.3",
35-
"symfony/debug": "^4.3",
36-
"symfony/finder": "^4.3",
37-
"symfony/http-foundation": "^4.3",
38-
"symfony/http-kernel": "^4.3",
39-
"symfony/process": "^4.3",
40-
"symfony/routing": "^4.3",
41-
"symfony/var-dumper": "^4.3",
34+
"symfony/console": "^4.3.4",
35+
"symfony/debug": "^4.3.4",
36+
"symfony/finder": "^4.3.4",
37+
"symfony/http-foundation": "^4.3.4",
38+
"symfony/http-kernel": "^4.3.4",
39+
"symfony/process": "^4.3.4",
40+
"symfony/routing": "^4.3.4",
41+
"symfony/var-dumper": "^4.3.4",
4242
"tijsverkoyen/css-to-inline-styles": "^2.2.1",
4343
"vlucas/phpdotenv": "^3.3"
4444
},
@@ -81,11 +81,11 @@
8181
"filp/whoops": "^2.4",
8282
"guzzlehttp/guzzle": "^6.3",
8383
"league/flysystem-cached-adapter": "^1.0",
84-
"mockery/mockery": "^1.0",
84+
"mockery/mockery": "^1.2.3",
8585
"moontoast/math": "^1.1",
8686
"orchestra/testbench-core": "^4.0",
8787
"pda/pheanstalk": "^4.0",
88-
"phpunit/phpunit": "^8.0",
88+
"phpunit/phpunit": "^8.3",
8989
"predis/predis": "^1.1.1",
9090
"symfony/cache": "^4.3",
9191
"true/punycode": "^2.1"

src/Illuminate/Console/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"php": "^7.2",
1818
"illuminate/contracts": "^6.0",
1919
"illuminate/support": "^6.0",
20-
"symfony/console": "^4.3",
21-
"symfony/process": "^4.3"
20+
"symfony/console": "^4.3.4",
21+
"symfony/process": "^4.3.4"
2222
},
2323
"autoload": {
2424
"psr-4": {

src/Illuminate/Cookie/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"php": "^7.2",
1818
"illuminate/contracts": "^6.0",
1919
"illuminate/support": "^6.0",
20-
"symfony/http-foundation": "^4.3",
21-
"symfony/http-kernel": "^4.3"
20+
"symfony/http-foundation": "^4.3.4",
21+
"symfony/http-kernel": "^4.3.4"
2222
},
2323
"autoload": {
2424
"psr-4": {

src/Illuminate/Filesystem/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"php": "^7.2",
1818
"illuminate/contracts": "^6.0",
1919
"illuminate/support": "^6.0",
20-
"symfony/finder": "^4.3"
20+
"symfony/finder": "^4.3.4"
2121
},
2222
"autoload": {
2323
"psr-4": {

src/Illuminate/Http/Resources/DelegatesToResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function resolveRouteBinding($value)
5050
*/
5151
public function offsetExists($offset)
5252
{
53-
return array_key_exists($offset, $this->resource);
53+
return isset($this->resource[$offset]);
5454
}
5555

5656
/**

src/Illuminate/Http/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"ext-json": "*",
1919
"illuminate/session": "^6.0",
2020
"illuminate/support": "^6.0",
21-
"symfony/http-foundation": "^4.3",
22-
"symfony/http-kernel": "^4.3"
21+
"symfony/http-foundation": "^4.3.4",
22+
"symfony/http-kernel": "^4.3.4"
2323
},
2424
"autoload": {
2525
"psr-4": {

src/Illuminate/Queue/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"illuminate/pipeline": "^6.0",
2525
"illuminate/support": "^6.0",
2626
"opis/closure": "^3.1",
27-
"symfony/debug": "^4.3",
28-
"symfony/process": "^4.3"
27+
"symfony/debug": "^4.3.4",
28+
"symfony/process": "^4.3.4"
2929
},
3030
"autoload": {
3131
"psr-4": {

src/Illuminate/Routing/composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
"illuminate/pipeline": "^6.0",
2323
"illuminate/session": "^6.0",
2424
"illuminate/support": "^6.0",
25-
"symfony/debug": "^4.3",
26-
"symfony/http-foundation": "^4.3",
27-
"symfony/http-kernel": "^4.3",
28-
"symfony/routing": "^4.3"
25+
"symfony/debug": "^4.3.4",
26+
"symfony/http-foundation": "^4.3.4",
27+
"symfony/http-kernel": "^4.3.4",
28+
"symfony/routing": "^4.3.4"
2929
},
3030
"autoload": {
3131
"psr-4": {

src/Illuminate/Session/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"illuminate/contracts": "^6.0",
2020
"illuminate/filesystem": "^6.0",
2121
"illuminate/support": "^6.0",
22-
"symfony/finder": "^4.3",
23-
"symfony/http-foundation": "^4.3"
22+
"symfony/finder": "^4.3.4",
23+
"symfony/http-foundation": "^4.3.4"
2424
},
2525
"autoload": {
2626
"psr-4": {

src/Illuminate/Support/Facades/Facade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ protected static function resolveFacadeInstance($name)
172172
return static::$resolvedInstance[$name];
173173
}
174174

175-
return static::$resolvedInstance[$name] = static::$app[$name];
175+
if (static::$app) {
176+
return static::$resolvedInstance[$name] = static::$app[$name];
177+
}
176178
}
177179

178180
/**

src/Illuminate/Support/Traits/Macroable.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,13 @@ public static function __callStatic($method, $parameters)
8080
));
8181
}
8282

83-
if (static::$macros[$method] instanceof Closure) {
84-
return call_user_func_array(Closure::bind(static::$macros[$method], null, static::class), $parameters);
83+
$macro = static::$macros[$method];
84+
85+
if ($macro instanceof Closure) {
86+
return call_user_func_array(Closure::bind($macro, null, static::class), $parameters);
8587
}
8688

87-
return call_user_func_array(static::$macros[$method], $parameters);
89+
return $macro(...$parameters);
8890
}
8991

9092
/**
@@ -110,6 +112,6 @@ public function __call($method, $parameters)
110112
return call_user_func_array($macro->bindTo($this, static::class), $parameters);
111113
}
112114

113-
return call_user_func_array($macro, $parameters);
115+
return $macro(...$parameters);
114116
}
115117
}

src/Illuminate/Support/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
"illuminate/filesystem": "Required to use the composer class (^6.0).",
4242
"moontoast/math": "Required to use ordered UUIDs (^1.1).",
4343
"ramsey/uuid": "Required to use Str::uuid() (^3.7).",
44-
"symfony/process": "Required to use the composer class (^4.3).",
45-
"symfony/var-dumper": "Required to use the dd function (^4.3).",
44+
"symfony/process": "Required to use the composer class (^4.3.4).",
45+
"symfony/var-dumper": "Required to use the dd function (^4.3.4).",
4646
"vlucas/phpdotenv": "Required to use the Env class and env helper (^3.3)."
4747
},
4848
"config": {

src/Illuminate/Validation/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
"require": {
1717
"php": "^7.2",
1818
"ext-json": "*",
19-
"egulias/email-validator": "^2.0",
19+
"egulias/email-validator": "^2.1.10",
2020
"illuminate/container": "^6.0",
2121
"illuminate/contracts": "^6.0",
2222
"illuminate/support": "^6.0",
2323
"illuminate/translation": "^6.0",
24-
"symfony/http-foundation": "^4.3"
24+
"symfony/http-foundation": "^4.3.4"
2525
},
2626
"autoload": {
2727
"psr-4": {

src/Illuminate/View/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"illuminate/events": "^6.0",
2222
"illuminate/filesystem": "^6.0",
2323
"illuminate/support": "^6.0",
24-
"symfony/debug": "^4.3"
24+
"symfony/debug": "^4.3.4"
2525
},
2626
"autoload": {
2727
"psr-4": {

tests/Integration/Migration/MigratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function testDontDisplayOutputWhenOutputObjectIsNotAvailable()
2727

2828
$migrator->run([__DIR__.'/fixtures']);
2929

30-
$this->assertTrue($this->tableExists('members'));
30+
$this->assertTrue($this->tableExists('people'));
3131
}
3232

3333
private function tableExists($table): bool

tests/Integration/Migration/fixtures/2014_10_12_000000_create_members_table.php renamed to tests/Integration/Migration/fixtures/2014_10_12_000000_create_people_table.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<?php
22

3-
namespace Illuminate\Tests\Integration\Migration\fixtures;
4-
53
use Illuminate\Support\Facades\Schema;
64
use Illuminate\Database\Schema\Blueprint;
75
use Illuminate\Database\Migrations\Migration;
86

9-
class CreateMembersTable extends Migration
7+
class CreatePeopleTable extends Migration
108
{
119
/**
1210
* Run the migrations.
@@ -15,7 +13,7 @@ class CreateMembersTable extends Migration
1513
*/
1614
public function up()
1715
{
18-
Schema::create('members', function (Blueprint $table) {
16+
Schema::create('people', function (Blueprint $table) {
1917
$table->increments('id');
2018
$table->string('name');
2119
$table->string('email')->unique();
@@ -32,6 +30,6 @@ public function up()
3230
*/
3331
public function down()
3432
{
35-
Schema::drop('members');
33+
Schema::drop('people');
3634
}
3735
}

0 commit comments

Comments
 (0)