Comments (6)
@plumthedev This isn't a BC. Your example isn't entirely accurate in this case. This applies only to parameters that default to null (they implicitly become nullable). So, int $foo = null
is equal to ?int $foo = null
.
Before:
// framework class
interface Service
{
public function func(DateTime $date = null): void;
}
// application class
class FooService implements Service
{
public function func(DateTime $date = null): void
{
echo $date->format('Y');
}
}
(new FooService())->func(new DateTime('now'));
After:
// framework class
interface Service
{
public function func(?DateTime $date = null): void;
}
// application class
class FooService implements Service
{
public function func(DateTime $date = null): void
{
echo $date->format('Y');
}
}
(new FooService())->func(new DateTime('now'));
from framework.
Indeed you are right @korkoshko - thanks for your eagle eye 😄
from framework.
It's highly unlikely we'll support PHP 8.4 on Laravel v10. But if it's not too much work and there aren't any breaking changes we can give it a go. I'll try to get a CI job up soon.
from framework.
It's highly unlikely we'll support PHP 8.4 on Laravel v10. But if it's not too much work and there aren't any breaking changes we can give it a go. I'll try to get a CI job up soon.
It is functionally equivalent and just guessed it is probably easier to maintain by using same styling across both branches, but if it turns out that's not the case then definitely updating just 11.x
sounds fine. Moreover it's only a deprecation and not a require change.
from framework.
It is breaking change as method signature will be changed and all child classes which are overriding affected methods will throw a fatal error.
// framework class
interface Service
{
public function func(?DateTime $date): void;
}
// application class
class FooService implements Service
{
public function func(DateTime $date): void
{
echo $date->format('Y');
}
}
// Fatal error: Declaration of FooService::func(DateTime $date): void must be compatible with Service::func(?DateTime $date): void
(new FooService())->func(new DateTime('now'));
from framework.
PR has been merged to 11.x branch.
from framework.
Related Issues (20)
- Laravel 11 has issues with broadcasting. HOT 2
- [11.2] Global Scopes can't be removed from BelongsToMany relations HOT 4
- Virtual columns and `Model::preventAccessingMissingAttributes` HOT 5
- PhpUnit now throws warnings: Test code or tested code removed exception handlers other than its own HOT 11
- Fresh install of Laravel 11 fails during migrate because PHP SqlLite driver is not configured HOT 2
- Migration
- Bug with redis based session HOT 2
- Linux file permissions and Undefined variable error HOT 1
- Routes Provided by Package Do Not Load When Middleware Applied HOT 21
- SyncQueue invokes createPayload with parameter $queue as null while phpdoc declares it should be string HOT 3
- Blade Component Attributes: Passing boolean-style (without value) attributes HOT 1
- Laravel 11 connection with MariaDB fails with "Unknown collation: 'utf8mb4_uca1400_ai_ci' " HOT 5
- Laravel 11: questionable default indexes on table `password_reset_tokens`
- Cannot rename failed_jobs table HOT 1
- validateCsrfTokens - does not accept dynamic parameters
- Connection Refused Redis Clusters HOT 1
- Pivot events not fired when using `updateExistingPivot` with custom pivot class and `wherePivot` condition HOT 3
- Laravel 11 command choice test issue HOT 13
- onEachSide HOT 1
- php artisan view:cache returns an error since laravel 11 : Unable to locate a class or view for component [mail::message]. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from framework.