Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

Here comes

Symfony 6.3!
@nicolasgrekas
symfony.com/releases

@nicolasgrekas
• PHP >= 8.1
• Upgrade every 6 months for features
Symfony 6 • Backward Compatibility promise
• Upgrade every month for bug fixes

@nicolasgrekas
• PHP >= 8.2
• Upgrade every 2 years for new major
Symfony 7 • Continuous Upgrade Path promise
• Fix deprecations every 6 months

@nicolasgrekas
Since Nov 25th
• 355 minors
• 390 bug fixes
7 merges / day • 223 features
• 280 merges up
• 42 releases

@nicolasgrekas
🧹 Minors

@nicolasgrekas
#48802 Cut compilation time
Performance #49781 Improve perf. of translation messages extraction
#49676 Improve perf. of GlobResource

@nicolasgrekas
./{apps,src}/**/*Controller.php

@nicolasgrekas
#49383 Add missing return types to interfaces
Types #49022 Add missing template annotation on ServiceLocator
#48750 Add generics to PasswordUpgraderInterface

@nicolasgrekas
+/**
+ * @template-covariant T of mixed
+ * @implements ServiceProviderInterface<T>
+ */
class ServiceLocator implements ServiceProviderInterface, \Countable
{

@nicolasgrekas
#49663 Remove withConsecutive() calls from tests
#49233 Use PHPUnit 9.6 to run Symfony's test suite
PHPUnit 10 #48668 Migrate to static data providers
#49253 Use TestCase suffix for abstract test cases

@nicolasgrekas
- public function provideUidEntityClasses()
+ public static function provideUidEntityClasses()

@nicolasgrekas
#48793 Leverage arrow function syntax for closure
New syntax #48670 Use ::class
#48069 Use ??= more

@nicolasgrekas
- $values = array_filter($values, function ($val) { return null !== $val; });
+ $values = array_filter($values, fn ($val) => null !== $val);

- $this->class = get_class($object);
+ $this->class = $object::class;

- if (null === $path) {


- $path = '/';
- }
+ $path ??= '/';

@nicolasgrekas
Continuous #49001 Speed up Psalm tests (12 to 2 minutes)

Integration #47180 Add ossf/scorecard GitHub action

@nicolasgrekas
🤩 Features

@nicolasgrekas
📅🗺🤝🕸 #47112 Add a Scheduler component
#50112 Add AssetMapper to manage JS deps without nodejs
New components #48542 Add the RemoteEvent and Webhook

https://speakerdeck.com/fabpot/

@nicolasgrekas
#47373 Add Chatwork bridge
#46395 Add Contact Everyone bridge
#46724 Add SMSFactor bridge
#49454 Add Pushover bridge
#49461 Add MailerSend bridge
#48855 Add PagerDuty bridge
🔔️ #48101 Add Mastodon bridge
#48466 Add Line bridge
Notifier #48389 Add Bandwidth bridge
#48394 Add Plivo bridge
#48397 Add RingCentral bridge
#48398 Add Termii bridge
#48399 Add iSendPro bridge
#48084 Add Twitter bridge

@nicolasgrekas
#48642 Add Clock class and now() function
#48362 Add ClockAwareTrait

Clock use function Symfony\Component\Clock\now;

$now = now(); // returns a DateTimeImmutable instance

Clock::set(new MockClock()); // for testing

@nicolasgrekas
#49358 Deprecate @route annotations in favor of attributes
🕹️ #48128 Add support for the 103 Early Hints and other 1XX

Controllers #49134 Add #[MapQueryParameter] to map query parameters


#49138 Add #[MapRequestBody] and #[MapQueryString]

@nicolasgrekas
// Matches /blog?page=1
#[Route(path: '/blog', name: 'blog')]
public function index(
#[MapQueryParameter(options: ['min_range' => 0])]
int $page = 0,
) {
// ...

@nicolasgrekas
// Matches /blog?page=1
#[Route(path: '/blog', name: 'blog')]
public function index(
#[MapQueryParameter(options: ['min_range' => 1])]
int $page = 0,
) {
// ...

@nicolasgrekas
class ProductReviewDto
{
public function __construct(
#[Assert\NotBlank]
#[Assert\Length(min: 10, max: 500)]
public readonly string $comment,

#[Assert\GreaterThanOrEqual(1)]
#[Assert\LessThanOrEqual(5)]
public readonly int $rating, #[Route('/product-review', methods: ['POST'])]
) {
public function post(
// ...
#[MapRequestPayload]
ProductReviewDto $productReview,
) {
// ...

@nicolasgrekas
#48352 #[WithHttpStatus] for defining status codes for exceptions
#48747 #[WithLogLevel] for defining log levels for exceptions

🌽
HttpKernel #[WithHttpStatus(429, ['Retry-After' => 10])]
#[WithLogLevel(LogLevel::INFO)]
class RateLimitedException extends \Exception
{

@nicolasgrekas
#49302 Add UriTemplateHttpClient to use RFC-6570
🌐 #49911 Support mime/multipart file uploads

HttpClient #49809 Allow using multiple base_uri as array for retries


#50274 Set the minimum TLS version to v1.2

@nicolasgrekas
#48272 OpenID Connect Token Handler
🛡️ #49300 Add #[NoSuspiciousCharacters] to spot spoofing attempt

Security #49789 New #[PasswordStrength] constraint


#49306 Add logout configuration for Clear-Site-Data header

Clear-Site-Data: "cookies"

@nicolasgrekas
🧙‍♂️ #47680 Remove parameters starting with a dot when compiling
Dependency #47719 Add ContainerBuilder::deprecateParameter()
#49411 Add support for #[AsAlias] during auto-discovery
Injection 1/2

@nicolasgrekas
#[AsAlias('my-alias', public: true)]
#[AsAlias(MyInterface::class)]
class MyService implements MyInterface
{

@nicolasgrekas
🧙‍♀️ #46752 Generate lazy proxies out of the box
#48484 Deprecate proxy-manager bridge
Dependency #49685 Add support for #[Autowire(lazy: true)]
Injection 2/2 #49628 Autowire services as closures with #[AutowireCallable]

@nicolasgrekas
public function __construct(
#[AutowireCallable(UriTemplate::class, 'expand')]
UriExpanderInterface $expander,
)

$uriTemplate->expand(...) implements UriExpanderInterface {


new class($uriTemplate->expand(...))
public function __construct(
private \Closure $closure,
) {
}

public function expand(string $url, array $vars): string


{
return $this->closure->__invoke($url, $vars);
}
}

@nicolasgrekas
#47352 Remove profiles automatically after two days
🫶 #48059 Auto-create Doctrine migrations for sessions and locks
Developer #48707 Fail if #[Target] attribute does not exist during compilation
#48938 Allow setting private services with the test container
eXperience #48432 Add support of named arguments to dd() and dump()

@nicolasgrekas
static::getContainer()
->set('http_client.transport', new MockHttpClient(...));

dump(hello: 'World');

@nicolasgrekas
#49614 Add Request::getPayload(): array
🎁 #49913 [Twig] Add {{ app.locale }}

Various Goodies #49529 Add support for better signal handling in commands
#49588 Render date/time form types using HTML5 by default

@nicolasgrekas
See issues with
"Help Wanted" label
Contribute to the Help Wanted
documentation!

@nicolasgrekas
360+ contributors

@nicolasgrekas
Backers for 6.3

@nicolasgrekas
• Become a backer
• Deploy on Platform.sh
• Attend Symfony conferences
symfony.com/ • Get certified
sponsor • Sign up for SymfonyInsight
• Buy the Symfony book
• Subscribe to SymfonyCasts

@nicolasgrekas
Mutual aid
Kindness symfony.com/slack
CARE team

@nicolasgrekas
Merci ! 🫶
@nicolasgrekas

You might also like