Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Symfony Blog:
Improvements to the Handling of .env Files for all Symfony Versions
Nov 20, 2018 @ 13:28:28

On the Symfony blog they've made a post about a change in all Symfony versions around how .env files are handled and what prompted the change.

When Symfony 4.0 was released, the .env file was introduced as a way to set environment variables. The core of the system has not changed. But, thanks to recent updates to some core Symfony recipes, .env loading has some new features that can be enjoyed on any Symfony Flex project!

If you have an existing Symfony app (started before today), your app does not require any changes to keep working. But, if/when you are ready to take advantage of these improvements, you will need to make a few small updates.

The post outlines what changed exactly including the removal of the .env.dist, allowing a .env.local to override the settings and that the .env file is now pulled in for testing. The final point is the main reasoning for the changes to make testing much easier when it relies on these environment variable values. It doesn't require any changes to your current application but can be optionally implemented to take advantage of these updates.

tagged: symfony improvement environment file configuration change env

Link: https://symfony.com/blog/improvements-to-the-handling-of-env-files-for-all-symfony-versions

Freek Van der Herten:
How PHP conferences can be improved
Nov 20, 2018 @ 12:14:01

Freek Van der Herten has made a new post to his site sharing some of the things he thinks that could help to improve PHP conferences in general, not just ones in a particular area of the world.

The past year something has bothered me about the traditional formats most conferences in the PHP ecosystem seem to adhere to. I recently went to DotJS: a JavaScript conference which was organized very differently from the majority of PHP conferences I attended previously.

In this blog post, I'd to highlight what PHP conferences, in general, could consider copying from a conference like DotJS.

Among his suggestions are topics like:

  • shortening the talk length
  • making lightning talks a "first-class citizen"
  • appointing a Master of Ceremony
  • avoiding the Q&A portion of the sessions

There's a few other suggestions he offers to around audience seating and how many tracks to have. He spends some time on each point, explaining some of his thoughts and how it relates back to his experience at other conferences outside of the PHP community.

tagged: conference improvement opinion dotjs community

Link: https://murze.be/how-php-conferences-can-be-improved

Laravel News:
Laravel 5.7 Mail Localization Improvements
Oct 04, 2018 @ 09:18:41

In this new post to the Larvel News site, they cover some of the recent improvements in the mail handling for the framework, specifically in the use of localization to tailor the content for a certain language.

Laravel 5.7.7 is now released and includes both bug fixes and thanks to Derek MacDonald a big improvement to Mail Localization.

With the release of Laravel 5.7 the IlluminateNotificationsNotification class started offering a locale method to set the desired language. The application will change into this locale when the notification is being formatted and then revert back to the previous locale when formatting is complete.

The post provides an example of how to use this functionality in sending your emails and how to add a "locale" field to your models. This allows you to set up a preferred default locale for the data, removing the need to reference it directly every time.

tagged: mail localization improvement laravel tutorial example

Link: https://laravel-news.com/mail-localization

Nick Basile:
Improving Our Laravel Nova CRM
Aug 28, 2018 @ 12:05:31

On his site Nick Basile has a new post sharing some of the ways you can improve an installation of Laravel Nova (the administration dashboard) for a CRM. This latest tutorial is the second part in his series (part one is here).

In my last post, we started building a simple CRM using Laravel Nova. It was pretty complete when we left it, but I think we can add a few more features and explore the rest of what Nova has to offer. In this walkthrough, we'll take a look at how to use Nova's Actions and authorization.

He walks through the additions and improvements he's added to his Nova dashboard:

  • an Action that automates the updating of a lead's status
  • additional authorization checks using policies for model delation

Code is included for each of these along with a summary that walks you through the creation and integration process.

tagged: laravelnova laravel nova administration improvement crm tutorial

Link: https://nick-basile.com/blog/post/improving-our-laravel-nova-crm

Matthias Noback:
Improving your software project by being intolerant
Aug 21, 2018 @ 11:51:19

Matthias Noback has written up an article where he suggests "being intolerant on your software development" as it relates to being stubborn about the quality/structure/etc. of your project's code.

During the holiday I read a book mentioned to me by Pim Elshoff: "Skin in the game", by Nassim Nicholas Taleb. Discussing this concept of "skin in the game" with Pim had made me curious about the book.

[...] Something that's controversial, yet interesting for me as a developer in a team - from Chapter 2, "The Most Intolerant Wins: The Dominance of the Stubborn Minority": "Society doesn't evolve by consensus. [...] All one needs is an asymmetric rule somewhere - and someone with soul in the game. And asymmetry is present in about everything."

He relates this back to software development, pointing out that many of the important decisions about a project aren't made by committee. Rather they're made by a single source, either a individual on the team or an outside source of "truth". He makes some suggestions as to how this kind of structure can be put in place by doing more than talking and "having skin in the game" as it relates to the impact your decisions make on your software.

tagged: software improvement intolerance structure ownership opinion

Link: https://matthiasnoback.nl/2018/08/improving-your-software-project-by-being-intolerant/

Symfony Blog:
New in Symfony 4.1: Misc. improvements (Parts 1-4)
May 30, 2018 @ 13:18:05

On the Symfony project blog they've posted a series of articles covering some miscellaneous improvements made for the v4.1 release of the framework.

During the past months we've published almost 40 blog posts about the main new features of Symfony 4.1. In this article you'll find some of the other small but nice new features.

Here's the list of the posts and some of the things covered in each:

  • Part 1: CSRF without forms, visibility change in progress bar component, showing dotenv files in the profiler
  • Part 2: command to delete cache pool items, allowing custom functions in "allow_if" expressions, addition of "dd" debug helper
  • Part 3: add/remove LDAP attributes efficiently, keeping the query string after redirect, hasser accessors in PropertyInfo
  • Part 4: adding anonymous services in PHP DSL, support for extracting type from constructor, configurable PHP error log level

Check out each post for a brief summary of each change and example code/configuration showing how to make use of it.

tagged: symfony improvement v41 series part1 part2 part3 part4

Link: https://symfony.com/blog/new-in-symfony-4-1-misc-improvements-part-1

Joe Watkins:
PHP allows for the design of X
May 23, 2018 @ 11:20:33

Joe Watkins has a new post to his site that provides his opinions about answering the people that say "PHP wasn't designed for X".

Starting complicated twitter conversations should be avoided, I know this, and yet blurted this out on twitter recently...

This was met with a flurry of responses and I couldn't reasonably reply in tweet form. I'm going to respond to some of those tweets (indirectly) and further explain my original tweet.

He starts off by talking about how PHP isn't always the right tool for a certain job (some people's misinterpretation of his tweet). He also talks about why PHP isn't a "templating language" and has evolved so much beyond some of its original roots. He ends the post responding to the original comment, that "PHP wasn't designed for X". He talks about the opinions of those not as familiar with the current state of the language and, when they say "just because you can, doesn't mean you should" (meaning that they think you actually shouldn't).

When support emerges for a new problem domain, let's be pragmatic and observe that expanding the horizons of PHP in any direction is good for the community that relies on PHP (and maybe PHP alone) to make a living. Let's not rush to take new solutions to production tomorrow, but let's not dismiss anything out of hand because of some imaginary short coming in PHP.
tagged: opinion language design feature improvement

Link: http://blog.krakjoe.ninja/2018/05/php-allows-for-design-of-x.html

Nicolas Grekas:
Making Symfony router lightning fast - 2/2
Feb 22, 2018 @ 12:54:30

Nicolas Grekas has posted the second part of his look at the work that was done to increase the performance on the router in version 4 of the Symfony framework. In part one he covered some of the basic changes made to the router for faster matching. In this latest article he covers some of the "tweaks" made on top of this work to help improve things even more.

In Making Symfony’s Router 77.7x faster - 1/2, we learned how to build a faster URL matcher, using hash-map lookups for static routes, and combined regular expressions for routes with placeholders, while preserving all the advanced features of the Symfony router. However, more work was needed for some real world apps, as at least one of them experienced a slow down. Let’s see how fixing this provided us with (one of) the fastest PHP routers out there.

He then starts working through some of the newer changes to help "reclaim" some of the performance loss in certain situations. He talks about same-prefix route ordering, subpatterns and placeholders to change how the combined regular expressions perform the matching on the incoming URL. The result is an even more performant routing system that's 77 times faster than what they started with.

tagged: symfony routing performance regularexpression regex improvement series part2

Link: https://medium.com/@nicolas.grekas/making-symfony-router-lightning-fast-2-2-19281dcd245b

QaFoo Blog:
Five Tips to Improve Your Unit Testing
Jun 13, 2017 @ 10:52:54

The QaFoo blog has posted a new article sharing five tips to improve your unit testing of your PHP applications. Even if you're a testing veteran, there's some helpful hints in here for you.

After you got the hang of unit testing there is still so much space for improvement. In this post I want to share five tips with advanced testers I have seen to influence testing in the right direction.

Their list of five tips includes advice about what you should consider as a "unit", refactoring test code and writing tests for bugs. Each topic includes a brief description of the suggestion and clear steps to follow when integrating it into your testing workflow.

tagged: unittest tips improvement advice unit logic refactor utilities bugs

Link: https://qafoo.com/blog/105_five_tips_improve_unit_testing.html

DeliciousBrains.com:
Hooks, Line, and Sinker: WordPress’ New WP_Hook Class
Jan 25, 2017 @ 10:34:02

The Delicious Brains site has a new post looking at an addition to the WordPress platform allowing you to hook into the core - the WP_Hook class. In the latest release of WordPress this system received a major overhaul and in this article they share what's been updated and what kind of impact it should have on your code.

The hooks system is a central pillar of WordPress and with the 4.7 release a major overhaul of how it works was merged. The Trac ticket that initially raised an issue with the hooks system was logged over 6 years ago. After a few attempts, the updates finally made it into the 4.7 release and the venerable hooks system was overhauled. In this post I want to go over some of the technical changes and decisions that went into the new WP_Hook class. I’ll also go over some of the more interesting aspects of WordPress core development and look into what it takes to overhaul a major feature in WordPress core.

The post starts out with what's changed related to the hooks handling, mostly that the functionality has moved out into a new "WP_Hook" class. This migrates it way from being handled right next to the plugin logic. He details some of the behind the scenes changes to the code and changes made to help improve performance. The post finishes out looking at the backwards compatibility of these changes and what it means for developers upgrading to this new WordPress version (hint: not much).

tagged: tutorial wordpress hooks upgrade class improvement performance

Link: https://deliciousbrains.com/hooks-line-sinker-wordpress-wp-hook-class/