Quantcast
Channel: Symfony Blog
Viewing all 3059 articles
Browse latest View live

Symfony 4.3.0 released

$
0
0

Symfony 4.3.0 has just been released. Here is a list of the most important changes:

  • bug #31654 [HttpFoundation] Do not set X-Accel-Redirect for paths outside of X-Accel-Mapping (@vilius-g)

Want to upgrade to this new release? Fortunately, because Symfony protects backwards-compatibility very closely, this should be quite easy.Read our upgrade documentation to learn more.

Want to be notified whenever a new Symfony release is published? Or when a version is not maintained anymore? Or only when a security issue is fixed? Consider subscribing to the Symfony Roadmap Notifications.


Be trained by Symfony experts - 2019-06-3 Clichy - 2019-06-3 Clichy - 2019-06-5 Clichy

A Week of Symfony #648 (27 May - 2 June 2019)

$
0
0

This week, the stable version of Symfony 4.3.0 was released, adding 270 small and big new features to Symfony. Meanwhile, the work on the upcoming Symfony 5.0 version (to be released on November 2019) started with the removal of deprecated features.

Symfony development highlights

This week, 112 pull requests were merged (87 in code and 25 in docs) and 55 issues were closed (42 in code and 13 in docs). Excluding merges, 47 authors made 5,523 additions and 5,637 deletions. See details for code and docs.

3.4 changelog:

  • c562e71: [Workflow] do not trigger extra guards
  • a26c6d3: [HttpFoundation] use AsserEquals for floating-point values
  • 326a74c: [HttpFoundation] do not set X-Accel-Redirect for paths outside of X-Accel-Mapping
  • 3cd3522: use willReturn() instead of will(returnValue())
  • 1583b4f: [Validator] updated Croatian translation

4.2 changelog:

  • ac4429a: [Messenger] use "real" memory usage to honor --memory-limit
  • da01afa: [DomCrawler] fix type error with null Form::$currentUri

4.3 changelog:

  • 4c1df8a: [Messenger] fixed missing auto_setup for RedisTransport
  • e19de54: [Messenger] disable the SchemaAssetsFilter when setup the transport
  • 8df4e57: [Contracts] split in one package per sub-contracts
  • 94f38d0: [HttpClient] make $response->getInfo('debug') return extended logs about the HTTP transaction
  • 59d5a77: [Mailer] create an abstract HTTP transport and extend it in all HTTP transports
  • d38c19a: [DoctrineBridge, Validator] do not enable validator auto mapping by default
  • 89f423f: [Validator] fix TimezoneValidator default option
  • 1318d3b: [Security\Core] make SodiumPasswordEncoder validate BCrypt-ed passwords
  • 6c93002: [Messenger] inject RoutableMessageBus instead of bus locator
  • d8224b8: [TwigBridge] suggest Translation Component when TranslationExtension is used

4.4 changelog:

  • b49d59f: marked several components as incompatible with EventDispatcher 5
  • 1203290: [HttpKernel] make DebugHandlersListener internal
  • 9934252: [MonologBridge] RouteProcessor class is now final to ease the the removal of deprecated event

Master changelog:

  • 0d62f32: [TwigBundle] remove default value deprecation for twig.strict_variables option
  • 52756a5: [Validator] remove checkDNS option in Url
  • 03797a1: [Validator] remove fallback dependency checks
  • a052378: [Validator] remove DateTime support in date/time validators
  • 86f7513: [HttpKernel] cleanup legacy in ConfigDataCollector
  • 42975ba: [FrameworkBundle] removed capability to load/debug/update legacy translation directories
  • d5f0a26: [Form] remove deprecated implementation of ChoiceLoaderInterface in intl forms
  • b9dca2e: [Security] remove deprecated encoders
  • 2bf74ce: [Serializer] remove CsvEncoder "as_collection" deprecation & change default value
  • bb9cf60: [Form] remove legacy code related to getExtendedType() method
  • 8401f27: [Form] throw exception when render a field which was already rendered
  • c9b146b: [Form] remove legacy regions option in TimezoneType
  • 7d78252: [Form] remove the scale argument of the IntegerToLocalizedStringTransformer
  • d4464af: [DependencyInjection] removed support for extension config without ConfigurationInterface implementation
  • b33a61b: [PHPUnitBridge] use a more appropriate group when deprecating mode
  • bfa43d3: [Security] remove the has_role() security expression function
  • fb865a6: [Serializer] unified normalizers/encoders config through default context solely
  • 6b74938: [TwigBundle] removed capability to load Twig template from legacy directories
  • 5a404b2: [Security] remove simple_preauth and simple_form authenticators
  • f5d15f6: [Yaml] drop support for mappings in multi-line blocks
  • c5922d2: [Security] remove the deprecated AdvancedUserInterface
  • 343da8c: [Security] remove deprecated role classes
  • 090cf32: [Form] remove deprecated date types options handling
  • 4a437ab: [Cache] remove deprecated PSR-16 implementations

Newest issues and pull requests

They talked about us

Upcoming Symfony Events

Call to Action


Be trained by Symfony experts - 2019-06-3 Clichy - 2019-06-3 Clichy - 2019-06-5 Clichy

New in Symfony 4.3: Mailer component

$
0
0

The stable version of Symfony 4.3 was released on May 30 2019, but there are still some new features we haven't talked about. In this article you'll learn about the Mailer component, the third component added by Symfony 4.3 (afterMime component and HttpClient component).

The Mime component allows you to create email messages, but to actually send them, you need to use the Mailer component. Emails are delivered via a"transport", which can be a local SMTP server or a third-party mailing service.

Out of the box this component provides support for the most popular services: Amazon SES, MailChimp, Mailgun, Gmail, Postmark and SendGrid. They are installed separately, so if your app uses for example Amazon SES, run this command:

1
$ composer require symfony/amazon-mailer

This will add some environment variables in your .env file where you can configure the specific service you are using:

1
2
3
4
# .envAWS_ACCESS_KEY=...AWS_SECRET_KEY=...MAILER_DSN=smtp://$AWS_ACCESS_KEY:$AWS_SECRET_KEY@ses

That's all. You can now inject the mailer service in any service or controller by type-hinting a constructor argument with the MailerInterface class:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
useSymfony\Component\Mailer\MailerInterface;useSymfony\Component\Mime\Email;classSomeService{private$mailer;publicfunction__construct(MailerInterface$mailer){$this->mailer=$mailer;}publicfunctionsendNotification(){$email=(newEmail())->from('hello@example.com')->to('you@example.com')->subject('Time for Symfony Mailer!')->text('Sending emails is fun again!')->html('<p>See Twig integration for better HTML integration!</p>');$this->mailer->send($email);}}

When you call $this->mailer->send($email), the email message is sent to the transport immediately. To improve performance, you can leverage theMessenger component to send the messages later via a Messenger transport. Read the Sending Messages Async section in the Mailer docs to learn more about this.


Be trained by Symfony experts - 2019-06-11 Clichy - 2019-06-13 Clichy - 2019-06-17 Lyon

Giving and receiving feedback

$
0
0

Open source contribution is about more than just writing code. A large part of it is in communication. This includes talking about code, discussing issues and reviewing pull requests. When something goes wrong during this communication, the CARE team can be called upon to mediate and help resolve this.

At the hackathon in Brussel, CARE team member Michelle pointed out that the bulk of the incidents noted in the CARE team transparency report for 2018 revolved around feedback given in code reviews on GitHub. That's understandable, it's about the code you've worked on. Opinions differ on approaches, used coding standards or best practices. And when opinions differ, discussions could get intense. Instead of escalating words, it is important to sometimes take a step back, take a breath and if necessary ask for some mediation. Remember: we all care to improve Symfony but sometimes our different backgrounds may lead us to prioritize different things. Also remember that while we communicate in English, many people speak a different language natively. And not everyone has the same sense of humor or even expects humor to be part of a code review.

It should also be noted that frustrations about communication on pull requests do not always lead to a CARE report, but is nonetheless a strain on people and can lead to reduced interest in working on Symfony. This not only affects newcomers but also long-time contributors and core team members.

We have a documentation page covering how to review pull requests. This document focuses more on the formal and technical sides of code review. Therefore, we have another page dedicated more to the human side of comments on a pull request.

Some issues might also arise from people receiving feedback. For this, we recently added a few sections to the how to create a pull request documentation page.

So again, make an effort to prevent escalations in pull request discussions and seek mediation if you feel like a communication barrier is preventing a productive exchange of thoughts.

Do you have any specific advice on how we can improve here? What are your experiences in this matter? Do you have a specific pull request you want to highlight where de-escalation has successfully defused a tense situation?


Be trained by Symfony experts - 2019-06-11 Clichy - 2019-06-13 Clichy - 2019-06-17 Lyon

Symfony 4.3.1 released

$
0
0

Symfony 4.3.1 has just been released. Here is a list of the most important changes:

  • bug #31894 Fix wrong requirements for ocramius/proxy-manager in root composer.json (@henrikvolmer)
  • bug #31865 [Form] Fix wrong DateTime on outdated ICU library (@aweelex)
  • bug #31893 [HttpKernel] fix link to source generation (@nicolas-grekas)
  • bug #31880 [FrameworkBundle] fix BC-breaking property in WebTestAssertionsTrait (@nicolas-grekas)
  • bug #31881 [FramworkBundle][HttpKernel] fix KernelBrowser BC layer (@nicolas-grekas)
  • bug #31879 [Cache] Pass arg to get callback everywhere (@fancyweb)
  • bug #31874 [Doctrine Bridge] Check field type before adding Length constraint (@belinde)
  • bug #31872 [Messenger] Add missing runtime check for ext redis version (@chalasr)
  • bug #31864 [Cache] Fixed undefined variable in ArrayTrait (@eXtreme)
  • bug #31863 [HttpFoundation] Fixed case-sensitive handling of cache-control header in RedirectResponse constructor (@Ivo)
  • bug #31850 [HttpClient] add $response->cancel() (@nicolas-grekas)
  • bug #31871 [HttpClient] revert bad logic around JSO _THRO _O _ERROR (@nicolas-grekas)
  • bug #31869 Fix json-encoding when JSO _THRO _O _ERROR is used (@nicolas-grekas)
  • bug #31868 [HttpKernel] Fix handling non-catchable fatal errors (@nicolas-grekas)
  • bug #31834 [HttpClient] Don't throw InvalidArgumentException on bad Location header (@nicolas-grekas)
  • bug #31846 [Mailer] Set default crypto method (@bpolaszek)
  • bug #31849 [Console] Add check for Konsole/Yakuake to disable hyperlinks (@belinde)
  • bug #31854 Rename the Symfony Mailer service implementation to avoid conflict with SwitMailer (@tgalopin)
  • bug #31856 [VarDumper] fix dumping the cloner itself (@nicolas-grekas)
  • bug #31861 [HttpClient] work around PHP 7.3 bug related to jso _encode() (@nicolas-grekas)
  • bug #31860 [HttpFoundation] work around PHP 7.3 bug related to jso _encode() (@nicolas-grekas)
  • bug #31852 [Form] add missing symfony/service-contracts dependency (@nicolas-grekas)
  • bug #31836 [DoctrineBridge] do not process private properties from parent class (@xabbuh)
  • bug #31790 [Messenger] set amqp conten _type based on serialization format (@Tobion)
  • bug #31832 [HttpClient] fix unregistering the debug buffer when using curl (@nicolas-grekas)
  • bug #31407 [Security] added support for updated "distinguished name" format in x509 authentication (@Robert Kopera)
  • bug #31774 [Mailer] Fix the possibility to set a From header from MessageListener (@fabpot)
  • bug #31811 [DoctrineBridge] don't add embedded properties to wrapping class metadata (@xabbuh)
  • bug #31786 [Translation] Fixed case sensitivity of lint:xliff command (@javiereguiluz)
  • bug #31815 [Translator] Collect locale details earlier in the process (@pierredup)
  • bug #31761 [TwigBridge] suggest Translation Component when TranslationExtension is used (@nicolas-grekas)
  • bug #31748 [Messenger] Inject RoutableMessageBus instead of bus locator (@chalasr)
  • bug #31763 [SecurityCore] Make SodiumPasswordEncoder validate BCrypt-ed passwords (@nicolas-grekas)
  • bug #31744 [Validator] Fix TimezoneValidator default option (@ro0NL)
  • bug #31749 [DoctrineBridge][Validator] do not enable validator auto mapping by default (@xabbuh)
  • bug #31757 [DomCrawler] Fix type error with null Form::$currentUri (@chalasr)
  • bug #31721 [PHPUnitBridge] Use a more appropriate group when deprecating mode (@greg0ire)

Want to upgrade to this new release? Fortunately, because Symfony protects backwards-compatibility very closely, this should be quite easy.Read our upgrade documentation to learn more.

Want to be notified whenever a new Symfony release is published? Or when a version is not maintained anymore? Or only when a security issue is fixed? Consider subscribing to the Symfony Roadmap Notifications.


Be trained by Symfony experts - 2019-06-11 Clichy - 2019-06-13 Clichy - 2019-06-17 Lyon

A Week of Symfony #649 (3-9 June 2019)

$
0
0

This week, Symfony 4.3.1 maintenance version was released. Meanwhile, the upcoming Symfony 4.4 version added a PasswordEncoderInterface::needsRehash() method and a MigratingPasswordEncoder to ease the migration of password hashers. Finally, the upcoming Symfony 5.0 version continued removing all the deprecated features.

Symfony development highlights

This week, 122 pull requests were merged (95 in code and 27 in docs) and 72 issues were closed (63 in code and 9 in docs). Excluding merges, 45 authors made 2,985 additions and 1,070 deletions. See details for code and docs.

3.4 changelog:

  • 5498cf5: [Security] added support for updated "distinguished name" format in x509 authentication
  • 2ae0580: [HttpFoundation] work around PHP 7.3 bug related to json_encode()
  • 11f04ab: [HttpFoundation] fixed case-sensitive handling of cache-control header in RedirectResponse constructor
  • 9691519: [Form] fixed wrong DateTime on outdated ICU library
  • 8214896: [Validator] updated the Italian translation

4.2 changelog:

  • 54ba63a: [Translation] fixed case sensitivity of lint:xliff command
  • 846f721: [VarDumper] fixed inconsistency in json format regarding DST value
  • 687f775: [Cache] pass arg to get callback everywhere
  • 0364135: [Form] fixed usage of legacy TranslatorInterface

4.3 changelog:

  • 66b87ab: [DoctrineBridge] don't add embedded properties to wrapping class metadata
  • 2438b14: [Mailer] fix the possibility to set a From header from MessageListener
  • f6a6fb6: [HttpClient] fix unregistering the debug buffer when using curl
  • 22e5f32: [Messenger] set amqp content_type based on serialization format
  • 40076b9: [DoctrineBridge] do not process private properties from parent class
  • 036d7b6: [Mailer] set default crypto method
  • d90dd8d: [HttpClient] don't throw InvalidArgumentException on bad Location header
  • 3242392: [Routing] revert deprecation of Serializable in routing
  • a80483c: [HttpKernel] fixed handling non-catchable fatal errors
  • e5b082a: [HttpClient] added $response->cancel()
  • 11f04ab: [HttpFoundation] fixed case-sensitive handling of cache-control header in RedirectResponse constructor
  • a6b306d: [Messenger] add missing runtime check for ext redis version
  • 9c8a6f9: [Doctrine Bridge] check field type before adding Length constraint
  • 92f333b: [FramworkBundle, HttpKernel] fixed KernelBrowser BC layer
  • d98dd9b: [Validator] fixed deprecation layer of ValidatorBuilder
  • 3b90c98: [FrameworkBundle] avoid service id conflicts with Swiftmailer
  • e718458: [Validator] PropertyInfoLoader should not try to add validation to non-existent property

4.4 changelog:

  • 693cbff: [Monolog] setup the LoggerProcessor after all other processor
  • 061f622: [FrameworkBundle, TwigBundle] add missing deprecations for PHP templating layer
  • 0bf50cf: [Translator] collect locale details earlier in the process
  • 1768c93: [Security] add PasswordEncoderInterface::needsRehash()
  • 957a0b8: [TwigBundle] mark TemplateIterator as internal
  • be7b7fe: [Messenger] add clear Entity Manager middleware
  • 6f9d0f0: [TwigBundle] add exception as HTML comment to beginning and end of the HTML page
  • 8d359b2: [Validator] improve TypeValidator to handle array of types
  • ec9159e: [Security] added MigratingPasswordEncoder
  • 5c8fb7b: [HttpFoundation] deprecated passing argument to method Request::isMethodSafe()

Master changelog:

  • 9ce3ff3: [Form] improved error message on create a form builder with invalid options
  • 129bf73: [Validator] add compared value path to violation parameters
  • 5d261bc: [Messenger, DoctrineBridge] extract Abstract Doctrine Middleware
  • 8d359b2: [Validator] improve TypeValidator to handle array of types
  • 35cdf61: [FrameworkBundle] remove support for the bundle:controller:action notation
  • b09397c: [Routing] removed deprecations
  • fbf5c34: [BrowserKit] removed deprecated code
  • d559bd1: [Validator] removed deprecated code paths
  • 49f852c: [FrameworkBundle] removed deprecated code paths
  • 927b1b2: [FrameworkBundle] fixed replace argument of routing.loader service
  • 0fb9b1b: [Config] removed the root method and the nullable name
  • 260df48: removed various legacy code paths
  • a2f2769: [Config] removed env var support with cannotBeEmpty(
  • ceb40c1: [DependencyInjection] removed deprecated code paths
  • 0f35e5b: [HttpKernel] removed all deprecated code from http kernel

Symfony Local Server

Symfony Local Server, the best way to run Symfony applications on your local machine, released its new 4.5.5 version with the following changes:

  • Fix transferring files using env:cp with Windows when specifying remote path
  • Fix DATABASE_URL forces serverVersion to 10.2.0 whereas it is compatible with >= 10.2.7
  • Allow one to use DATABASE_VERSION and DATABASE_CHARSET environment variable to override values in DATABASE_URL
  • Add missing help in the error message when ones tries to delete a project variable whereas it is defined at the environment level
  • Fix symfony ssh does not OpenSSH known hosts in addition to PuTTY ones on Windows
  • Don't allow uploading SSH keys that are already uploaded
  • Fix symfony deploy does not interactively ask to trust Host key on Windows
  • Make symfony deploy exit earlier when everything is up to date
  • Add --dry-run option to symfony deploy

Newest issues and pull requests

They talked about us

Upcoming Symfony Events

Call to Action


Be trained by Symfony experts - 2019-06-11 Clichy - 2019-06-13 Clichy - 2019-06-17 Lyon

A Week of Symfony #650 (10-16 June 2019)

$
0
0

This week, Symfony improved the compatibility of the HttpClient component with PSR-18 and with httplug. In addition, it introduced a significant performance improvement for EventDispatcher in the dev environment. Finally, we started working on the support for PHP 7.4 preloading in preparation for the PHP 7.4 release at the end of this year.

Symfony development highlights

This week, 81 pull requests were merged (38 in code and 43 in docs) and 46 issues were closed (30 in code and 16 in docs). Excluding merges, 37 authors made 2,067 additions and 1,642 deletions. See details for code and docs.

3.4 changelog:

  • 27316a4: [Form] fixed binary operation +, - or * on string by type casting to integer
  • faf7b30: [VarDumper] fixed dumping objects that implement __debugInfo()
  • bd9d0a4: [Routing] fixed absolute url generation when scheme is not known
  • b8978bd: [Serializer] handle true and false appropriately in CSV encoder
  • 575e922: [Form] validate composite constraints in all groups
  • cfbb5b5: [Cache] fixed SimpleCacheAdapter fails to cache any item if a namespace is used

4.3 changelog:

  • cf728f5: [DoctrineBridge] fixed handling nested embeddables
  • 2f4f8c0: [HttpClient] fixed Psr18Client handling of non-200 response codes
  • 8bdd25b: [TwigBridge] added back possibility to use form themes without translations
  • ac1a660: [EventDispatcher] collect called listeners information only once
  • 1c1d6d9: [Mailer] fixed sender/recipients in SMTP Envelope
  • d74f389: [Contracts] added missing required dependencies
  • e635775: [HttpClient] fixed closing debug stream prematurely
  • d7ba773: [Mailer] parameterize Mailgun's region
  • 6b50c89: [HttpClient] don't use CurlHttpClient on Windows when curl.cainfo is not set
  • a9bcdcc: [Messenger] fixed delay delivery for non-fanout exchanges

4.4 changelog:

  • c33f69c: [FrameworkBundle] allowed dots in translation domains
  • 71731c6: [HttpClient] made Psr18Client implement relevant PSR-17 factories
  • 9d7e9fc: [HttpClient] added HttplugClient for compat with libs that need httplug v1 or v2
  • bad18dc: [VarDumper] caster for HttpClient's response dumps all info
  • f06a35b: [DomCrawler] added Form::getName() method
  • 50c62d7: [Config] introduce find method in ArrayNodeDefinition to ease configuration tree manipulation
  • 68d1b3f: [Validator] deprecate unused arg in ExpressionValidator

Newest issues and pull requests

They talked about us

Upcoming Symfony Events

Call to Action


Be trained by Symfony experts - 2019-06-17 Lyon - 2019-06-17 Clichy - 2019-06-17 Clichy

SymfonyLive London 2019: workshop topics and complete conference schedule are available!

$
0
0

The SymfonyLive London 2019 conference is coming in less than 3 months! The conference will be split into 2 days: Thursday September 12th is dedicated for the pre-conference workshop day and September 13th for the conference day. We offer several workshops on September 12th and we're very pleased to announce all the workshop topics you'll be able to attend. Here is the list of the workshops you can choose on September 12th to extend your Symfony and PHP skills, all the workshops offered are one-day workshops, you need to choose one workshop topic among all of them:

  • Getting ready for Symfony 5 by Nicolas Grekas - Symfony. Symfony 4 changes the way you develop web applications. During this workshop, you will discover the new best practices recommended by the Symfony Core team. You will learn how to install third-party packages with Symfony Flex, configure your application with environment variables or exploit the new features of the dependency injection container. You will also learn how to prepare a Symfony 4 app for version 5, to be released next November. This workshop will teach you the new way of using the components, whether you know them already or not.
  • Building API-driven apps with API Platform by Kévin Dunglas - Les-Tilleuls.coop. API Platform is a popular framework built on top of Symfony to create API-driven web projects. After an overview of modern API patterns and formats (REST, OpenAPI, hypermedia, HATEOAS, JSON-LD, Hydra, Schema.org, GraphQL...), we'll learn how to use and extend the most popular features of the API Platform: data providers and persisters, docs, pagination, validation, sorting, filtering, authentication, authorization, content negotiation, Mercure live update and much more! This hands-on workshop is focused on the server part of the framework (PHP).
  • Practical Design Patterns with Symfony by Titouan Galopin - SymfonyInsight lead. Writing long-lasting code that is easy to maintain is challenging. In this workshop, we will discover Software Architecture from the point of view of a Symfony developer. We will discuss the Design Patterns implemented by the framework and learn how these patterns can help you develop better Symfony applications. We will also implement the most important of these patterns in a real-world Symfony application in order to give you effective practical tools for your next project.
  • Profiling Symfony & PHP apps by Dmytro Naumenko - Blackfire expert. It is difficult to improve what is not measurable! Profiling an application should always be the first step in trying to improve its performance. With this workshop, learn how to identify performance issues in your application and adopt the best profiling practices in your daily development habits. This workshop will use the Blackfire.io tool to help you identify performance leaks.

We're also very pleased to announce the last selected speakers for the conference on September 13th. The conference day will be split into 2 tracks. We've announced last month the first selected speakers of the conference and we're now pleased to announce the entire conference agenda! We are super happy to introduce you to the last selected speakers who will be speaking this year at the conference (in order of appearance on the schedule):

  • Michael Cullum, Security Lead within the Symfony Core Team, will talk about "Security Best Practices with Symfony 4.4". Discover the latest best practices brought by Symfony 4.4 to secure your application.
  • Denis Brumann, Software Developer at SensioLabs Deutschland, will speak about "Things you will need to know when Doctrine 3 comes out". Doctrine ORM is probably the most used database abstraction in PHP. This talk looks at some of the already merged features for Doctrine 3 that could have an impact on your code and why the might prevent you from upgrading. I will show approaches for tackling these changes and how your projects might benefit from introducing them already.
  • Kévin Dunglas, Symfony Core Team member and creator of the API Platform framework, will teach you how to "Boost your Symfony apps with HTTP/2 ​and HTTP/3". HTTP/2 and HTTP/3 can improve the loading time of webpages up to 2 times. Did you know that it’s very easy to optimize your Symfony applications to leverage the advanced features of this new protocol? Discover how to do it with this talk!
  • Valentine Boineau, SymfonyInsight Developer, will present a talk entitled "Symfony Checker is coming". Have you ever heard of the PHP AST? Maybe not... CFG and SSA? Probably not! In this talk, I will introduce these cool algorithms, how they are used in code quality analysis and how we leveraged them in a project I'm working on: the Symfony Checker.
  • Kamil Kokot, Open Source maintainer and contributor, Software Engineer at Sylius, founder of Friends Of Behat, will talk about "BDD Your Symfony Application". Behaviour Driven Development helps bridge the communication gap between business and IT. This talk will explain the basics of BDD methodology, best practices for writing Cucumber scenarios and how to integrate Symfony with Behat by using a new emerging solution - FriendsOfBehat's SymfonyExtension. I will share the practical insights distilled from 4 years of developing and maintaining the biggest open-source Behat suite which is a part of Sylius.
  • Nicolas Grekas, Symfony Core Team member, will be on stage for the closing Keynote about "The fabulous World of Emojis and other Unicode symbols".

Check out the entire conference agenda and all the talks' details of each presentation!

Don't miss the 8th edition of the SymfonyLive London conference and join us there! Get your conference or combo pre-conference workshop and conference ticket at regular rate until August 5th. Register now to secure your seat there!

We can't wait to meet you at SymfonyLive London 2019! See you there!


Be trained by Symfony experts - 2019-06-24 Berlin - 2019-06-24 Berlin - 2019-06-24 Clichy

Twig Adds Filter, Map and Reduce Features

$
0
0

Twig is the template language used in Symfony and thousands of other projects. In the last six months alone, Twig has released 30 versions for its 1.x and 2.x branches, adding lots of interesting new features. This article focuses on some of the new filters and tags added recently.

Filter, map and reduce

The "filter, map and reduce" pattern is getting more and more popular in other programming languages and paradigms (e.g. functional programming) to transform collections and sequences of elements. You can now use them in Twig thanks to the new filter, map and reduce filters in combination with the new arrow function.

The filter filter removes from a sequence all the elements that don't match the given expression. For example, to ignore products without enough stock:

1
2
3
{%forproductinrelated_products|filter(product=>product.stock>10)%}{# ... #}{%endfor%}

The arrow function receives the value of the sequence or mapping as its argument. The name of this argument can be freely chosen and it doesn't have to be the same as the variable used to iterate the collection:

1
2
3
{%forproductinrelated_products|filter(p=>p.idnotinuser.recentPurchases)%}{# ... #}{%endfor%}

If you also need the key of the sequence element, define two arguments for the arrow function (and wrap them in parenthesis):

1
2
3
{%setcomponents=all_components|filter((v,k)=>v.publishedistrueandnot(kstarts with'Deprecated'))%}

Thanks to the new filter option, the if condition is no longer needed for the for loops, so we've deprecated it in favor of always using filter:

1
2
3
4
-{% for product in related_products if product.stock > 10 %}+{% for product in related_products|filter(p => p.stock > 10) %}
    {# ... #}
{% endfor %}

The map filter applies an arrow function to the elements of a sequence or a mapping (it's similar to PHP's array_map()):

1
2
3
4
5
6
7
{%setpeople=[{first:"Alice",last:"Dupond"},{first:"Bob",last:"Smith"},]%}{{people|map(p=>p.first~' '~p.last)|join(', ')}}{# outputs Alice Dupond, Bob Smith #}

The reduce filter iteratively reduces a sequence or a mapping to a single value using an arrow function. Because of this behavior, the arrow function always receives two arguments: the current value and the result of reducing the previous elements (usually called "carry"):

1
2
{%setnum_products=cart.rows|reduce((previousTotal,row)=>previousTotal+row.totalUnits)%}{{num_products}} products in total.

In addition to filter, map and reduce, recent Twig versions have added other useful filters and tags.

The "column" filter

This new column filter returns the values from a single column in the given array (internally it uses the PHP array_column() function):

1
Your oldest friend is {{max(user.friends|column('age'))}} years old.

The "apply" tag

The filter tag has been deprecated (to not confuse it with the new filter filter explained above) and it has been replaced by the new apply tag which works exactly the same as the previous tag:

1
2
3
4
-{% filter upper %}+{% apply upper %}
    This text becomes uppercase.
{% endapply %}

Allowed using Traversable objects

Another important change related to filters and tags is that you can now use objects that implement the Traversable PHP interface everywhere you can use iterators or arrays: the with tag, the with argument of the include and embed tags, the filter filter, etc.


Be trained by Symfony experts - 2019-06-24 Berlin - 2019-06-24 Berlin - 2019-06-24 Clichy

Simpler Macros in Twig Templates

$
0
0

Macros are one of the most important features of the Twig template language to avoid repetitive contents. In Twig 2.11, usage of macros was simplified and other features were added to help you work with macros.

Automatic macro import

Macros are similar to PHP functions because you can pass arguments to them and the contents generated inside the macro are returned to include them in the place where the macro is called.

On symfony.com we use macros for example to display the "contributor box" in several places to highlight our amazing Symfony code and docs contributors:

1
2
3
4
5
6
{%macrocontributor_details(contributor,vertical_layout=false)%}<div class="d-flex"><img class="avatar {{vertical_layout?'m-b-15'}}" src="...">        Thanks {{contributor.name}} for being a Symfony contributor.</div>{%endmacro%}

Before calling to a macro in a template you must import it, even if the macro is defined in the same template. This behavior always felt confusing to some people and made using macros a bit annoying. Starting from Twig 2.11, we've fixed that and macros defined in the same template are imported automatically under the special variable _self:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{# templates/some-template.html.twig #}{%macrocontributor_details(contributor,vertical_layout=false)%}<div class="d-flex"><img class="avatar {{vertical_layout?'m-b-15'}}" src="...">        Thanks {{contributor.name}} for being a Symfony contributor.</div>{%endmacro%}{# ... #}{%forcontributorincontributors%}{# you don't have to import the macro before using it #}{{_self.contributor_details(contributor)}}{%endfor%}

This automatic import also works for macros themselves, so you can call to a macro inside another macro of the same template without importing it explicitly (this also works for any macro imported globally in the template):

1
2
3
4
5
6
7
8
9
{%macrocontributor_details(contributor,vertical_layout=false)%}{# ... #}{%endmacro%}{%macrocontributor_list(contributors)%}{%forcontributorincontributors%}{{_self.contributor_details(contributor)}}{%endfor%}{%endmacro%}

Checking for macro existence

Another new feature introduced in Twig 2.11 is the support for checking the existence of macros before calling to them thanks to the is defined test. It works both for macros imported explicitly and for auto-imported macros:

1
2
3
4
5
{%import'templates/_macros.html.twig'asmacros%}{%ifmacros.contributor_detailsisdefined%}{# ... #}{%endif%}

Macros Scoping

The scoping rules that define which macros are available inside each element of each template have changed as of Twig 2.11 as follows:

  • Imported macros are available in all blocks and other macros defined in the current template, but they are not available in included templates or child templates (you need to explicitly re-import macros in each template).
  • Macros imported inside a {% block %} tag are only defined inside that block and override other macros with the same name imported in the template. Same for macros imported explicitly inside a {% macro %} tag.

Better macro errors

Recent Twig versions have fixed some edge-cases related to macros (e.g. calling a macro imported in a block from a nested block, etc.) and improved other error messages to make them crystal clear and help you debug issues more easily. Twig has also fixed a partial output leak that could happen when a PHP fatal error occurs.


Be trained by Symfony experts - 2019-06-24 Berlin - 2019-06-24 Berlin - 2019-06-24 Clichy

A Week of Symfony #651 (17-23 June 2019)

$
0
0

This week, development activity focused mostly on fixing bugs instead of adding new features. Meanwhile, a new proposal was made to improve all the commands related to Symfony Flex. Lastly, the full schedule and workshops were announced for the SymfonyLive London conference (September 13).

Symfony development highlights

This week, 54 pull requests were merged (34 in code and 20 in docs) and 40 issues were closed (33 in code and 7 in docs). Excluding merges, 25 authors made 1,169 additions and 563 deletions. See details for code and docs.

3.4 changelog:

  • cfc8ac0: [Lock] fixed expired lock not cleaned
  • 6fcd319: [Validator] fixed GroupSequenceProvider annotation
  • 370682c: [FrameworkBundle] tag the FileType service as a form type

4.2 changelog:

  • c9ab846: [Lock] fixed PDO prune not called
  • 5471867: [Validator] use LogicException for missing Property Access Component in comparison constraints

4.3 changelog:

  • 99c44a3: [HttpClient] throw DecodingExceptionInterface when toArray() fails because of content-type error
  • 12b852f: [Messenger] fixed AMQP delay queue to be per exchange
  • 5af1e9e: [Lock] fixed expired lock not cleaned in ZooKeeper
  • 0a1a885: [Messenger] fixed delay exchange recreation after disconnect
  • 030396a: [SecurityBundle] don't validate IP addresses from env var placeholders
  • 0dbf477: [Form] accept floats for input="string" in NumberType

4.4 changelog:

  • a0aa941: prepare for PHP 7.4 preload
  • 12b852f: [Messenger] fixed AMQP delay queue to be per exchange
  • 411ad97: [FrameworkBundle] added attribute stamps
  • 0a1a885: [Messenger] fixed delay exchange recreation after disconnect
  • f429986: [Ldap] added exception for mapping LDAP errors
  • 115e67b: [HttpClient] added autowiring for HTTPlug
  • aa4385d: [Ldap] added users extraFields in LDAP component

Newest issues and pull requests

They talked about us

Upcoming Symfony Events

Call to Action


Be trained by Symfony experts - 2019-06-24 Berlin - 2019-06-24 Berlin - 2019-06-24 Clichy

Better White Space Control in Twig Templates

$
0
0

Whitespace control in Twig templates allows you to control the indentation and spacing of the generated contents (usually HTML code). Most of the times you should ignore this feature, because the HTML contents are minified and compressed before sending them to the users, so trying to generate perfectly aligned HTML code is just a waste of time.

However, there are some specific cases where whitespace can change how things are displayed. For example, when an <a> element contains white spaces after the link text and the link displays an underline, the whitespace is visible. That's why Twig provides multiple ways of controlling white spaces. In recent Twig versions, we've improved those features.

New whitespace trimming options

Fabien Potencier

Contributed by
Fabien Potencier
in #2925.

Consider the following Twig snippet:

1
2
3
4
5
6
7
<ul><li>{%ifsome_expression%}{{some_variable}}{%endif%}</li></ul>

If the value of some_variable is 'Lorem Ipsum', the HTML generated when the if expression matches, would be the following:

1
2
3
4
5
<ul><li>
            Lorem Ipsum</li></ul>

Twig only removes by default the first \n character after each Twig tag (the \n after the if and endif tags in the previous example). If you want to generate HTML code with better indention, you can use the - character, which removes all white spaces (including newlines) from the left or right of the tag:

1
2
3
4
5
6
7
<ul><li>{%- ifsome_expression%}{{-some_variable -}}{%endif -%}</li></ul>

The output is now:

1
2
3
<ul><li>Lorem Ipsum</li></ul>

Starting from Twig 1.39 and 2.8.0, you have another option to control whitespace: the ~ character (which can be applied to {{, {% and{#). It's similar to -, with the only difference that ~ doesn't remove newlines:

1
2
3
4
5
6
7
<ul><li>        {%~ if some_expression %}{{some_variable -}}{%endif~%}</li></ul>

The output now contains the newlines after/before the <li> tags, so the generated HTML is more similar to the original Twig code you wrote:

1
2
3
4
5
<ul><li>
        Lorem Ipsum</li></ul>

Added a spaceless filter

Fabien Potencier

Contributed by
Fabien Potencier
in #2872.

In previous Twig versions, there was a tag called {% spaceless %} which transformed the given string content to remove the white spaces between HTML tags. However, in Twig, transforming some contents before displaying them is something done by filters.

That's why, starting from Twig 1.38 and 2.7.3, the spaceless tag has been removed in favor of the spaceless filter, which works exactly the same:

1
{{some_variable_with_HTML_content|spaceless}}

However, this is commonly used with the alternative way of applying some filter to some HTML contents:

1
2
3
4
5
-{% spaceless %}+{% apply spaceless %}
    {# some HTML content here #}-{% endspaceless %}+{% endapply %}

In case you missed it, the apply tag was recently added to replace the previous filter tag.

In any case, even after these changes, it's still recommend to not use thespaceless filter too much. The removal of white spaces with this filter happens at runtime, so calling it repeatedly can hurt performance.

Fine-grained escaping on ternary expressions

Fabien Potencier

Contributed by
Fabien Potencier
in #2934.

This new feature introduced in Twig 1.39 and 2.8 is not related to whitespace control, but it's an important new feature to consider in your templates. Consider the following example and the results rendered in Twig versions before 1.39 and 2.8:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{%setfoo='<strong>foo</strong>'%}{%setbar='<strong>bar</strong>'%}{{false?'<strong>bar</strong>':foo|raw}}{# renders as '<strong>foo</strong>' #}{{false?bar:foo|raw}}{# renders as '&lt;strong&gt;foo&lt;/strong&gt;' #}{{(false?bar:foo)|raw}}{# renders as '<strong>foo</strong>' #}

The reason why this example worked in that way in previous Twig versions is that in the first ternary statement, foo is marked as being safe and Twig does not escape static values. In the second ternary statement, even if foo is marked as safe, bar remains unsafe and so is the whole expression. The third ternary statement is marked as safe and the result is not escaped.

This behavior was confusing to lots of designers and developers. That's why, starting from Twig 1.39 and 2.8, the result of this example has changed as follows:

1
2
3
4
5
6
7
{%setfoo='<strong>foo</strong>'%}{%setbar='<strong>bar</strong>'%}{{false?'<strong>bar</strong>':foo|raw}}{{false?bar:foo|raw}}{{(false?bar:foo)|raw}}{# renders as '<strong>foo</strong>' in all cases #}

Be trained by Symfony experts - 2019-06-24 Berlin - 2019-06-24 Berlin - 2019-06-24 Clichy

Preparing your Applications for Twig 3

$
0
0

Twig, the template language used in Symfony and thousands of other projects, has three active development branches: 1.x is for legacy applications, 2.x is for current applications and 3.x will be the next stable version.

Unlike Symfony, older Twig branches still receive some new features. For example, 1.x received the new filter, map and reduce features and thenew white space trimming options. However, sometimes new features need to deprecate some current behaviors. This cannot be done in 1.x and that's why features like the auto import of Twig macros are not available in 1.x.

Although Twig 1.x will be maintained for the foreseeable future, it will receive less and less new features, especially when Twig 3.x is released. The tentativerelease date of Twig 3 is before the end of 2019, so you should start upgrading your Twig 1.x usage now.

The main change needed to prepare for 3.x is to use the namespaced Twig classes (the non-namespaced classes are still available in 1.x and 2.x but deprecated, and they will be removed in 3.x):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
namespace App\Twig;+use Twig\Extension\AbstractExtension;+use Twig\TwigFilter;-class AppExtension extends \Twig_Extension+class AppExtension extends AbstractExtension
{
    public function getFilters()
    {
        return [-            new \Twig_SimpleFilter('...', [$this, '...']),+            new TwigFilter('...', [$this, '...']),
        ];
    }

    // ...
}

For most applications, these namespace updates are the only change you'll need to make to upgrade to Twig 3.x. However, if you make an advanced usage of Twig internals, you'll see other deprecated warnings. Check out thelist of deprecated features in Twig 1.x and thelist of deprecations in Twig 2.x.

Twig 3.x will be the most polished Twig release ever. It includes a ton of small tweaks, better error messages, better performance, better consistency and cleaner code. Get your applications ready for Twig 3 by upgrading them to 2.x as soon as possible.


Be trained by Symfony experts - 2019-06-26 Berlin - 2019-06-26 Lille - 2019-06-26 Clichy

Save the date for SymfonyLive Tunis 2020!

$
0
0

SymfonyLive Tunis 2020 Conference Logo

The first edition of the SymfonyLive Tunis 2019 took place on April 27th 2019! Save the date for next year's edition, the conference will return on April 27th 2020. SymfonyLive Tunis is a one-day French speaking conference to meet the local Symfony community!


La première édition du SymfonyLive Tunis a eu lieu le samedi 27 avril 2019 au Mövenpick Hotel du Lac à Tunis et a réuni 300 participants, 9 fantastiques speakers et des super sponsors autour d’une journée complète de conférences sur Symfony. Nous avons été ravis de vous accueillir pour cette première édition de la conférence !

Nous sommes heureux de vous annoncer que le SymfonyLive Tunis sera de retour en 2020 pour sa seconde édition ! Save the Date : rendez-vous le samedi 18 avril 2020 au Mövenpick Hotel du Lac à Tunis !

Nous avons hâte de retrouver la communauté locale de Symfony pour une nouvelle journée de partage de connaissances sur Symfony, PHP et de rencontres avec l’écosystème local de Symfony réunis autour d’un track ! Deux journées de formation seront organisées les jeudi 16 et vendredi 17 avril 2020.

Le SymfonyLive Tunis est une conférence locale en français pour les passionnés de Symfony et PHP. Plus d’informations à venir prochainement, en attendant restez à l’écoute et notez la date du SymfonyLive Tunis 2020 dans votre agenda !

Rendez-vous l'année prochains sous le soleil tunisien !


Be trained by Symfony experts - 2019-06-26 Berlin - 2019-06-26 Lille - 2019-06-26 Clichy

Symfony 3.4.29 released

$
0
0

Symfony 3.4.29 has just been released. Here is a list of the most important changes:

  • bug #32137 [HttpFoundation] fix accessing session bags (@xabbuh)
  • bug #32164 [EventDispatcher] collect called listeners information only once (@xabbuh)
  • bug #32173 [FrameworkBundle] Fix calling Client::getProfile() before sending a request (@dunglas)
  • bug #32163 [DoctrineBridge] Fix type error (@norkunas)
  • bug #32170 [Security/Core] Don't use ParagonI _Sodiu _Compat (@nicolas-grekas)
  • bug #32123 [Form] fix translation domain (@xabbuh)
  • bug #32116 [FrameworkBundle] tag the FileType service as a form type (@xabbuh)
  • bug #32090 [Debug] workaround BC break in PHP 7.3 (@nicolas-grekas)
  • bug #32071 Fix expired lock not cleaned (@jderusse)
  • bug #32057 [HttpFoundation] Fix SA/phpdoc JsonResponse (@ro0NL)
  • bug #32025 SimpleCacheAdapter fails to cache any item if a namespace is used (@moufmouf)
  • bug #32037 [Form] validate composite constraints in all groups (@xabbuh)
  • bug #32007 [Serializer] Handle true and false appropriately in CSV encoder (@battye)
  • bug #32000 [Routing] fix absolute url generation when scheme is not known (@Tobion)
  • bug #32024 [VarDumper] fix dumping objects that implement debugInfo() (@nicolas-grekas)
  • bug #31962 Fix reporting unsilenced deprecations from insulated tests (@nicolas-grekas)
  • bug #31865 [Form] Fix wrong DateTime on outdated ICU library (@aweelex)
  • bug #31863 [HttpFoundation] Fixed case-sensitive handling of cache-control header in RedirectResponse constructor (@Ivo)
  • bug #31869 Fix json-encoding when JSO _THRO _O _ERROR is used (@nicolas-grekas)
  • bug #31860 [HttpFoundation] work around PHP 7.3 bug related to jso _encode() (@nicolas-grekas)
  • bug #31407 [Security] added support for updated "distinguished name" format in x509 authentication (@Robert Kopera)
  • bug #31654 [HttpFoundation] Do not set X-Accel-Redirect for paths outside of X-Accel-Mapping (@vilius-g)

Want to upgrade to this new release? Fortunately, because Symfony protects backwards-compatibility very closely, this should be quite easy.Read our upgrade documentation to learn more.

Want to be notified whenever a new Symfony release is published? Or when a version is not maintained anymore? Or only when a security issue is fixed? Consider subscribing to the Symfony Roadmap Notifications.


Be trained by Symfony experts - 2019-06-26 Berlin - 2019-06-26 Lille - 2019-06-26 Clichy

Symfony 4.2.10 released

$
0
0

Symfony 4.2.10 has just been released. Here is a list of the most important changes:

  • bug #31972 Add missing rendering of form help block. (@alexsegura)
  • bug #32137 [HttpFoundation] fix accessing session bags (@xabbuh)
  • bug #32164 [EventDispatcher] collect called listeners information only once (@xabbuh)
  • bug #32173 [FrameworkBundle] Fix calling Client::getProfile() before sending a request (@dunglas)
  • bug #32163 [DoctrineBridge] Fix type error (@norkunas)
  • bug #32170 [Security/Core] Don't use ParagonI _Sodiu _Compat (@nicolas-grekas)
  • bug #32094 [Validator] Use LogicException for missing Property Access Component in comparison constraints (@Lctrs)
  • bug #32123 [Form] fix translation domain (@xabbuh)
  • bug #32116 [FrameworkBundle] tag the FileType service as a form type (@xabbuh)
  • bug #32090 [Debug] workaround BC break in PHP 7.3 (@nicolas-grekas)
  • bug #32076 [Lock] Fix PDO prune not called (@jderusse)
  • bug #32071 Fix expired lock not cleaned (@jderusse)
  • bug #32057 [HttpFoundation] Fix SA/phpdoc JsonResponse (@ro0NL)
  • bug #32025 SimpleCacheAdapter fails to cache any item if a namespace is used (@moufmouf)
  • bug #32037 [Form] validate composite constraints in all groups (@xabbuh)
  • bug #32007 [Serializer] Handle true and false appropriately in CSV encoder (@battye)
  • bug #32000 [Routing] fix absolute url generation when scheme is not known (@Tobion)
  • bug #32024 [VarDumper] fix dumping objects that implement debugInfo() (@nicolas-grekas)
  • bug #31962 Fix reporting unsilenced deprecations from insulated tests (@nicolas-grekas)
  • bug #31925 [Form] fix usage of legacy TranslatorInterface (@nicolas-grekas)
  • bug #31908 [Validator] fix deprecation layer of ValidatorBuilder (@nicolas-grekas)
  • bug #31894 Fix wrong requirements for ocramius/proxy-manager in root composer.json (@henrikvolmer)
  • bug #31865 [Form] Fix wrong DateTime on outdated ICU library (@aweelex)
  • bug #31879 [Cache] Pass arg to get callback everywhere (@fancyweb)
  • bug #31863 [HttpFoundation] Fixed case-sensitive handling of cache-control header in RedirectResponse constructor (@Ivo)
  • bug #31869 Fix json-encoding when JSO _THRO _O _ERROR is used (@nicolas-grekas)
  • bug #31868 [HttpKernel] Fix handling non-catchable fatal errors (@nicolas-grekas)
  • bug #31860 [HttpFoundation] work around PHP 7.3 bug related to jso _encode() (@nicolas-grekas)
  • bug #31407 [Security] added support for updated "distinguished name" format in x509 authentication (@Robert Kopera)
  • bug #31786 [Translation] Fixed case sensitivity of lint:xliff command (@javiereguiluz)
  • bug #31757 [DomCrawler] Fix type error with null Form::$currentUri (@chalasr)
  • bug #31654 [HttpFoundation] Do not set X-Accel-Redirect for paths outside of X-Accel-Mapping (@vilius-g)

Want to upgrade to this new release? Fortunately, because Symfony protects backwards-compatibility very closely, this should be quite easy.Read our upgrade documentation to learn more.

Want to be notified whenever a new Symfony release is published? Or when a version is not maintained anymore? Or only when a security issue is fixed? Consider subscribing to the Symfony Roadmap Notifications.


Be trained by Symfony experts - 2019-06-26 Berlin - 2019-06-26 Lille - 2019-06-26 Clichy

Symfony 4.3.2 released

$
0
0

Symfony 4.3.2 has just been released. Here is a list of the most important changes:

  • bug #31954 [PhpunitBridge] Read environment variable from superglobals (@greg0ire)
  • bug #32131 [Mailgun Mailer] fixed issue when using html body (@alOneh)
  • bug #31730 [PhpUnitBridge] More accurate grouping (@greg0ire)
  • bug #31966 [Messenger] Doctrine Connection find and findAll now correctly decode headers (@TimoBakx)
  • bug #31972 Add missing rendering of form help block. (@alexsegura)
  • bug #32141 [HttpClient] fix dealing with 1xx informational responses (@nicolas-grekas)
  • bug #32138 [Filesystem] fix mirroring directory into parent directory (@xabbuh)
  • bug #32137 [HttpFoundation] fix accessing session bags (@xabbuh)
  • bug #32147 [HttpClient] fix timing measurements with NativeHttpClient (@nicolas-grekas)
  • bug #32165 revert #30525 due to performance penalty (@bendavies)
  • bug #32164 [EventDispatcher] collect called listeners information only once (@xabbuh)
  • bug #32173 [FrameworkBundle] Fix calling Client::getProfile() before sending a request (@dunglas)
  • bug #32163 [DoctrineBridge] Fix type error (@norkunas)
  • bug #32154 [Messenger] fix retrying handlers using DoctrineTransactionMiddleware (@Tobion)
  • bug #32169 [Security/Core] require libsodium >= 1.0.14 (@nicolas-grekas)
  • bug #32170 [Security/Core] Don't use ParagonI _Sodiu _Compat (@nicolas-grekas)
  • bug #32156 [Workflow] re-add workflow.definition tag to workflow services (@nikossvnk)
  • bug #32053 [Messenger] No need for retry to require SentStamp (@Tobion)
  • bug #32083 [HttpClient] fixing passing debug info to progress callback (@nicolas-grekas)
  • bug #32129 [DebugBundle] fix register ReflectionCaster::unsetClosureFileInfo caster in var cloner service (@alekitto)
  • bug #32027 [Messenger] Remove DispatchAfterCurrentBusStamp when message is put on internal queue (@Nyholm)
  • bug #32125 [Form] accept floats for input="string" in NumberType (@xabbuh)
  • bug #32094 [Validator] Use LogicException for missing Property Access Component in comparison constraints (@Lctrs)
  • bug #32136 [FrameworkBundle] sync require-dev and conflict constraints (@xabbuh)
  • bug #32123 [Form] fix translation domain (@xabbuh)
  • bug #32115 [SecurityBundle] don't validate IP addresses from env var placeholders (@xabbuh)
  • bug #32116 [FrameworkBundle] tag the FileType service as a form type (@xabbuh)
  • bug #32109 [Messenger] fix delay exchange recreation after disconnect (@Tobion)
  • bug #32090 [Debug] workaround BC break in PHP 7.3 (@nicolas-grekas)
  • bug #32076 [Lock] Fix PDO prune not called (@jderusse)
  • bug #32071 Fix expired lock not cleaned (@jderusse)
  • bug #32052 [Messenger] fix AMQP delay queue to be per exchange (@Tobion)
  • bug #32065 [HttpClient] throw DecodingExceptionInterface when toArray() fails because of content-type error (@nicolas-grekas)
  • bug #32057 [HttpFoundation] Fix SA/phpdoc JsonResponse (@ro0NL)
  • bug #32040 [DI] Show the right class autowired when providing a non-existing class (@Simperfit)
  • bug #32035 [Messenger] fix delay delivery for non-fanout exchanges (@Tobion)
  • bug #32025 SimpleCacheAdapter fails to cache any item if a namespace is used (@moufmouf)
  • bug #32022 [HttpClient] Don't use CurlHttpClient on Windows when curl.cainfo is not set (@nicolas-grekas)
  • bug #32037 [Form] validate composite constraints in all groups (@xabbuh)
  • bug #32007 [Serializer] Handle true and false appropriately in CSV encoder (@battye)
  • bug #32036 [Messenger] improve logs (@Tobion)
  • bug #31998 Parameterize Mailgun's region (@jderusse)
  • bug #32000 [Routing] fix absolute url generation when scheme is not known (@Tobion)
  • bug #32012 Add statement to fileLink to ignore href code when no fileLink. (@bmxmale)
  • bug #32024 [VarDumper] fix dumping objects that implement debugInfo() (@nicolas-grekas)
  • bug #32014 Do not log or call the proxy function when the locale is the same (@gmponos)
  • bug #32011 [HttpClient] fix closing debug stream prematurely (@nicolas-grekas)
  • bug #32017 [Contracts] add missing required dependencies (@mbessolov)
  • bug #31992 Fix sender/recipients in SMTP Envelope (@fabpot)
  • bug #31999 [PhpunitBridge] Restore php 5.5 compat (@greg0ire)
  • bug #31991 [EventDispatcher] collect called listeners information only once (@xabbuh)
  • bug #31988 [TwigBridge] add back possibility to use form themes without translations (@xabbuh)
  • bug #31982 [HttpClient] fix Psr18Client handling of non-200 response codes (@nicolas-grekas)
  • bug #31953 [DoctrineBridge] fix handling nested embeddables (@xabbuh)
  • bug #31962 Fix reporting unsilenced deprecations from insulated tests (@nicolas-grekas)
  • bug #31936 PropertyInfoLoader should not try to add validation to non-existent property (@weaverryan)
  • bug #31923 [Serializer] Fix DataUriNormalizer deprecation (MIME type guesser is optional) (@ogizanagi)
  • bug #31928 [FrameworkBundle] avoid service id conflicts with Swiftmailer (@xabbuh)
  • bug #31925 [Form] fix usage of legacy TranslatorInterface (@nicolas-grekas)
  • bug #31908 [Validator] fix deprecation layer of ValidatorBuilder (@nicolas-grekas)

Want to upgrade to this new release? Fortunately, because Symfony protects backwards-compatibility very closely, this should be quite easy.Read our upgrade documentation to learn more.

Want to be notified whenever a new Symfony release is published? Or when a version is not maintained anymore? Or only when a security issue is fixed? Consider subscribing to the Symfony Roadmap Notifications.


Be trained by Symfony experts - 2019-06-26 Berlin - 2019-06-26 Lille - 2019-06-26 Clichy

SymfonyCon Amsterdam 2019: the pre-conference workshops schedule is online!

$
0
0

Logo of the SymfonyCon Amsterdam 2019

The international Symfony conference is coming from 19th to 23rd November 2019, join us for SymfonyCon Amsterdam 2019 at the beautiful Beurs van Berlage, downtown Amsterdam! We’ll have the pleasure to meet you for a full week of Symfony:

  • November 19th-20th: 2-day pre-conference workshops
  • November 21st-22nd: 2-day conference
  • November 23rd: 1-day hackday

We're thrilled to announce that all the workshop topics are now online! If you already registered for a workshop, you should have received an email asking you to choose your workshop combo. If you're not yet registered neither for the conference nor the combo pre-conference workshops and conference, here is a sneak peak of our workshop schedule. We offer 5 workshops per day, all workshops except the workshop "Practical Design Patterns with Symfony" are one-day workshop. Discover our workshop schedule:

Tuesday November 19th:

  • Building API-driven apps with API Platform by Kévin Dunglas - Les-Tilleuls.coop. Learn how to use and extend the most popular features of the API Platform: data providers and persisters, docs, pagination, validation, sorting, filtering, authentication, authorization, content negotiation, Mercure live update and much more! This hands-on workshop is focused on the server part of the framework (PHP).
  • Getting ready for Symfony 5 by Nicolas Grekas - Symfony. Learn how to install third-party packages with Symfony Flex, configure your application with environment variables or exploit the new features of the dependency injection container. You will also learn how to prepare a Symfony 4 app for version 5, to be released next November. EventDispatcher, Security, Cache, etc - many important components have been improved, which means some part of them have been deprecated, and replaced by updated interface.
  • Practical Design Patterns with Symfony (two days) by Titouan Galopin - SymfonyInsight lead. Discover Software Architecture from the point of view of a Symfony developer. We will discuss the Design Patterns implemented by the framework and learn how these patterns can help you develop better Symfony applications. We will also implement the most important of these patterns in a real-world Symfony application in order to give you effective practical tools for your next project.
  • Practical Doctrine ORM within Symfony apps by Julien Pauli - SensioLabs trainer & PHP core contrib. Learn how to create entities and mappings and practice with some querying scenarios to understand how the ORM works and how it can help us. This workshop will teach what a UnitOfWork is, what are N+1 queries and how you can prevent them. Basically, we will cover everything you need to know to persist your data efficiently with Dotrine ORM.
  • Create an eCommerce website with Sylius by Sylius Core Team Members Łukasz Chruściel and Mateusz Zalewski. Sylius is the only e-commerce framework entirely based on Symfony (with Symfony 4 and Flex support), crafted with clean code and BDD. Join us and see that eCommerce development can be easy and fun. During the workshops, we will together start with vanilla Sylius configuration and customize it to our needs. After the workshops, you will have a good insight into Sylius structure and its core concepts.

Wednesday November 20th:

  • Profiling Symfony & PHP apps by Nicolas Grekas - ex-Blackfire CTO. Profiling an application should always be the first step in trying to improve its performance. With this workshop, learn how to identify performance issues in your application and adopt the best profiling practices in your daily development habits. This workshop will use the Blackfire.io tool to help you identify performance leaks.
  • Practical Forms with Symfony by Julien Pauli - SensioLabs trainer & PHP core contrib. This workshop will teach you the core of the Symfony Form component: its architecture, how to validate submitted input with built-in and custom validators, what are form types and how to use them, their hierarchy and their options, using DTOs to decouple forms from your entities, using Data Tranformers to automate data treatments, writing Form extensions to push forward the limits of factorisation, etc.
  • Writing Modern JS with Symfony & Webpack Encore by Ryan Weaver - SymfonyCasts. In this workshop, we'll use the Webpack Encore library from Symfony to quickly bootstrap a sophisticated asset setup, complete with minification, SASS processing, free versioning, automatic code-rewriting to support older browsers and more! Everything you need to start writing great JavaScript quickly. We'll also learn about using JavaScript modules, how to bootstrap a framework (like Vue) and other important modern practices.
  • Knowing your state machines - Symfony Workflow by Tobias Nyholm - Happyr CTO & Founder. The state pattern will help you move complexity from being all over your code to one or more state machines. Tobias' workshop will introduce state machines, show you how to identify uses of them, and implement them in your Symfony application in an object-oriented manner using the Symfony Workflow component.
  • Practical Design Patterns with Symfony (day 2) by Titouan Galopin - SymfonyInsight lead.

Check our workshop descriptions in details! Create now your own pre-conference workshops combo, select your workshop topic per day and book your workshop registration. Pre-conference workshop tickets are not sold separately from conference tickets.

The combo ticket price includes the 2-day workshops, 2-day conference, the hackday (breaks and lunches during all the 5 days are included). Get 20% off the global price for workshops and conference days with the combo ticket. Improve your Symfony and PHP skills before the conference, register now!

We can't wait to meet you at SymfonyCon Amsterdam 2019, stay tuned for the latest news about the international Symfony conference!


Be trained by Symfony experts - 2019-07-8 Cologne - 2019-07-8 Cologne - 2019-07-8 Clichy

New Symfony Core Team Member: Yonel Ceruto

$
0
0

I'm pleased to announce that Yonel Ceruto is joining the Symfony Core Team.

Yonel has been contributing to Symfony for the last 4 years now. He startedfixing a typo in the code, and contributed via many pull requests over the years. His biggest achievement so far? A pull request that I've just merged for Symfony 4.4: the new ErrorHandler component (which deserves a whole blog post on its own). Yonel also likes to work on complex topics nobody wants to work on! I won't list them all here, but he worked fixing issues on a lot of different Symfony components and bundles.

Please, join me in welcoming Yonel in his new role!


Be trained by Symfony experts - 2019-07-8 Cologne - 2019-07-8 Cologne - 2019-07-8 Clichy

A Week of Symfony #652 (24-30 June 2019)

$
0
0

This week, Symfony 3.4.29, 4.2.10 and 4.3.2 maintenance versions were released. Meanwhile, the SymfonyLive Tunis 2020 conference date was announced, as well as the workshops for the SymfonyCon 2019 conference in Amsterdam. Finally, the Symfony Core Team added Yonel Ceruto as its latest member.

Symfony development highlights

This week, 108 pull requests were merged (84 in code and 24 in docs) and 56 issues were closed (45 in code and 11 in docs). Excluding merges, 38 authors made 6,648 additions and 3,686 deletions. See details for code and docs.

3.4 changelog:

  • 7cc4cab: [FrameworkBundle] fixed calling Client::getProfile() before sending a request
  • c511e46: [EventDispatcher] collect called listeners information only once
  • c042b5b: [HttpFoundation] fixed accessing session bags
  • eb438a4: [Security] work around sodium_compat issue
  • 2bab37d: [Serializer] catch JsonException and rethrow in JsonEncode
  • 278bfba: [Serializer] fixed PHP of DenormalizableInterface::denormalize

4.2 changelog:

  • 6b83861: [Lock] fixed missing inherit docs in RedisStore
  • 6437c5a: [Twig bridge] added missing rendering of form help block
  • 3f16506: [Cache] work around PHP memory leak

4.3 changelog:

  • 67af93f: [Messenger] no need for retry to require SentStamp
  • 9830c64: [Workflow] re-add workflow.definition tag to workflow services
  • b68a6b3: [Messenger] fixed retrying handlers using DoctrineTransactionMiddleware
  • 7f9dad1: [Messenger] extract unrecoverable exception to interface
  • a590829: [HttpClient] fixed timing measurements with NativeHttpClient
  • c245f7c: [Filesystem] fixed mirroring directory into parent directory
  • 0219834: [HttpClient] fixed dealing with 1xx informational responses
  • bd2356d: [Messenger] Doctrine Connection find and findAll now correctly decode headers
  • f8b0bfd: [Mailer] fixed issue when using html body in Mailgun mailer
  • 4e915bd: [PhpunitBridge] read environment variable from superglobals
  • e55978a: [EventDispatcher] improved error messages in the event dispatcher
  • f2f7fb4: [Mailer] fixed error message when connecting to a stream raises an error before connect()
  • 278bfba: [Serializer] fixed PHP of DenormalizableInterface::denormalize
  • 0d5258a: [Workflow] deprecated DefinitionBuilder::setInitialPlace()

4.4 changelog:

  • bd8ad3f: [Process] allow writing portable "prepared" command lines
  • 64b68d4: [PhpUnitBridge] more accurate grouping
  • 13a5e2d, 45526a1: added ErrorCatcher component
  • 0d5258a: [Workflow] deprecated DefinitionBuilder::setInitialPlace()
  • 3644b70: [PropertyAccess] deprecated null as allowed value for defaultLifetime argument in createCache method
  • 8dd5464: [Lock] added an InvalidTTLException to be more accurate
  • 835f6b0: [Mime] added S/MIME support

Master changelog:

  • 18793b7: added return types in final classes
  • 8124159: [Messenger] made all stamps final and mark stamp not meant to be sent
  • efaa154: [Security] added return type declaration
  • 71525d4: [Form] removed form type validation due to typehints
  • 150f0f2: [EventDispatcher] added type-hints to EventDispatcherInterface
  • f123436, 7b3ef19: [Routing] added type-hints to all public interfaces
  • 3644b70: [PropertyAccess] deprecate null as allowed value for defaultLifetime argument in createCache method
  • aac5765: [Debug] removed all deprecated classes that were moved to the ErrorCatcher component
  • 8dd5464: [Lock] added an InvalidTTLException to be more accurate
  • 0781b60: [Serializer] added type-hints to serializer interface
  • bac35b0: [Asset] added type-hints to public interfaces and classes
  • f2b261d: [PropertyInfo] added type-hints to public interfaces and classes
  • 7485b6f: [OptionResolver] added type-hints to OptionResolver class
  • 7739849: [Config] added type-hints to public interfaces and classes
  • faaa83c: [DependencyInjection] added type-hints on compiler passes
  • eead643: [Validator] added parameter type hints to the Validator component
  • a6677ca: [Ldap] added type-hint to interface and implementation

Symfony Local Server

Symfony Local Server, the best way to run Symfony applications on your local machine, released its new 4.6.0 version with the following changes:

  • Add HTTP/2 support in proxy to local web server
  • Enforce having SSH key configured before trying to connect using SSH
  • Make sure deploy always return an exit status != 0 when deploy fails
  • Show payment method details during SymfonyCloud checkout
  • Make the SymfonyCloud checkout payment more explicit
  • Expose SYMFONY_DEFAULT_ROUTE_{URL,HOST,SCHEME,PATH,PORT} environment variables
  • Fix .env files override relationships and tunnels environment variables in Console context
  • Make symfony php forward exit status code
  • Fix rsync paths are being switched when using local to remote way
  • Fix typo in env:rsync help
  • Fix slowness in the local server because of connection attempt to Docker even if docker-compose is not in use
  • Fix Docker integration when project directory name contains special characters

Newest issues and pull requests

They talked about us

Upcoming Symfony Events

Call to Action


Be trained by Symfony experts - 2019-07-8 Cologne - 2019-07-8 Cologne - 2019-07-8 Clichy
Viewing all 3059 articles
Browse latest View live