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

SitePoint PHP Blog:
The Theory of Constraints in PHP
Jul 12, 2017 @ 11:22:44

On the SitePoint PHP blog they've posted a tutorial about the Theory of Constraints, how it can be related back to PHP and what it means for building effective code.

I had been reading The Phoenix Project, a great novel about IT (you read that right), which presents day to day IT and devops problems at a large Amazon-like company in a way which makes mortals understand the complexities and chaos of 21st century technology.

Without giving away any spoilers, at one point in the book the Theory of Constraints is mentioned. [...] The Theory of Constraints can be distilled to the idea that the chain is only as strong as its weakest link.

In the book it was phrased thusly: "Any improvements made anywhere besides the bottleneck are an illusion." For some reason, this resonated with me much more than the chain idiom. There’s just something about building something that’s ineffective that’s more relatable to me than breaking something that’s weakly built.

He goes on to talk about the subject of "factories" and "browsers", relating work done (or not done) on browsers to a factory where throughput of work isn't optimized. He then applies this back to PHP, mentioning some of the tools that can help optimize your workflow to prevent the same kind of factory backlog. This list includes services like Blackfire, XDebug and MySQL optimization techniques.

tagged: theory constraints quality factory optimize workflow tools qa

Link: https://www.sitepoint.com/theory-constraints-php/

Laravel News:
A guide for prioritizing application errors
Jul 03, 2017 @ 10:17:26

The Laravel News site has posted a tutorial that offers some advice on how to prioritize fixing bugs and errors in your applications.

One major problem is that prioritizing errors isn’t always clear. Figuring out how much negative impact a bug is really causing is important to answer because not all bugs are worth fixing.

That’s why having a solid workflow in place for prioritizing bugs is so important. In order to confidently allocate your engineering resources on bug fixes and feature building, you need to understand the scope of each application error, and its impact on your customers. Then you can definitively say particular bugs are high enough priority that they should be scheduled into a sprint alongside your work on building new features.

The article is then broken down into a few different sections, each with a few points underneath:

  • Get setup with smart error reporting from the start
  • Focus your error inbox to keep it actionable
  • Prioritize the most relevant errors first
  • Prioritize errors by moving them into your debugging workflow

The post is sponsored by Bugsnag so there's some of the content that suggests using their service but the advice is sound for any kind of error handling workflow.

tagged: priority error tracking application fixes workflow tips

Link: https://laravel-news.com/prioritize-application-errors

Tighten.co:
Supercharge Your Laravel Tinker Workflow
May 11, 2017 @ 09:37:19

On the Tighten.co blog they have a new post that aims to help you get the most out of the Laravel command line tool's (artisan) tinker command.

Laravel's command line tool is called "Artisan," and it comes with a few powerful features out of the box. Tinker, accessed via php artisan tinker, is arguably my favorite Artisan command. It speeds up my workflow and allows me to interact with my application in ways I would have never thought possible.

Tinker is a REPL (read-eval-print loop). A REPL gives you a prompt that allows you to interact with your application using your language's native syntax (in this case, PHP) in a command-line style.

The post then walks through some of the "hidden features" this command line tool offers including:

  • basic usage to call Laravel code (like getting all posts using Post::all)
  • a more interactive version of dd(), a debugging tool
  • improving speed on a Laravel Dusk testing workflow
  • direct access to the PHP docs

The post ends with a few other smaller things this helpful tool can do like showing a stack trace, listing the command history and re-throwing the last exception.

tagged: laravel workflow tinker commandline tool artisan tutorial

Link: https://blog.tighten.co/supercharge-your-laravel-tinker-workflow

Laravel News:
Manage your Laravel Forge Sites and Servers through Alfred
Apr 17, 2017 @ 16:04:38

On the Laravel News site there's a quick post showing you how you can use the Alfred tool to manage your Forge created servers. Alfred is a productivity tool for OSX systems that makes it easier to create shortcuts and interface with external applications in a convenient way.

Since the release of the Forge API developers have started creating a lot of apps and integrations, as well as an unofficial SDK. For those that use Alfred on the Mac, Vince Mitchell, launched a Workflow so you can quickly run many Forge commands right from your desktop.

The post includes the list of commands that the workflow includes allowing you to perform operations like opening the server's page in a browser, rebooting a system and restarting the web server on a specific machine. You can grab the workflow from the Packal site and drop it into your Alfred installation for immediate use.

tagged: alfred manage server laravel forge workflow example api

Link: https://laravel-news.com/forge-alfred-app

Fabien Potencier:
Symfony 4: Automate your Workflow
Apr 13, 2017 @ 10:33:24

Fabien Potencier has continued his series looking at Symfony 4 with a new post to his site today. This time he focuses on workflow automation and removing some of the daily application management tasks.

Symfony 4's most "innovative" feature is the way it drives the day-to-day application management. No more tedious copy/paste from README files. No more boilerplate code. Automation to the max. On a curated list of Composer packages.

He starts the post talking about Symfony Flex (the main engine behind Symfony 4) and how it can help with package management and installation/integration. He uses the sensiolabs/security-checker package as an example, showing how Flex understands the package and knows to run the checks on future composer install commands. He then digs into other areas Flex helps with:

  • bundles
  • configuration
  • environment variables
  • makefile tasks
  • Composer scripts

...and a few others. Examples are provided for each of the sections in the composer.json configuration and the post finishes with an example of the full configuration file, putting everything together.

tagged: symfony4 automation workflow integration installation symfonyflex framework

Link: http://fabien.potencier.org/symfony4-workflow-automation.html

SitePoint PHP Blog:
An Alternative Laravel Package Development Workflow
Apr 11, 2017 @ 12:07:01

In a previous article on the SitePoint PHP site a workflow was presented for creating and releasing Laravel packages. In this new post from author Younes Rafie an alternative flow is proposed that takes a little different approach.

Every framework gives developers a way to extend the system using packages / extensions. We can generally hook in our logic at any point where we want to provide specific functionality, and Laravel is no exception! Following the article of my fellow author Francesco Malatesta about his Laravel package development workflow, I noticed that mine is a bit different and I wanted to share it with you!

To help illustrate the flow, Younes walks through the development of a two-factor authentication package (presented previously). He then walks through the following steps, giving context for each piece:

  • Setting up the Repository
  • [Creating a] Package Skeleton
  • [Defining the] Package Structure
  • [Adding] Tests
  • Tagging [the release]

He ends the post with a suggestion not found in the other article: integrating the library with the TravisCI service for continuous integration and verification that all tests are passing.

tagged: package workflow alternative tutorial

Link: https://www.sitepoint.com/alternative-laravel-package-development-workflow/

Leonid Mamchenkov:
Getting started with workflows in PHP
Mar 21, 2017 @ 12:12:24

Leonid Mamchenkov has put together a post for those out there trying to get started with workflows in PHP and offers some tips from his own experience.

For a large project at work, we need to integrate or develop a workflow engine. I worked a little bit with workflow engines in the past, but the subject is way to big and complex for me to claim any expertise in it.

So, I am looking at what’s available these days and what are our options. This post is a collection of initial links and thoughts, and it’s goal is mostly to document my research process and findings, and not to provide any answers or solutions yet.

He starts off by defining the requirements of the system he's looking for, both on the technology side and the functional side. He outlines his expected flow and then links to some other resources he found to help define common terminology and some of the standards he found. He found the BPMN v2.0 and tracked down several PHP packages that implement that workflow structure (all linked as well).

tagged: workflow gettingstarted introduction concepts packages

Link: http://mamchenkov.net/wordpress/2017/03/20/getting-started-with-workflows-in-php/

SitePoint PHP Blog:
My Laravel Package Building Workflow
Mar 20, 2017 @ 11:19:04

On the SitePoint PHP blog they've posted a tutorial from author Francesco Malatesta covering his Laravel package building workflow.

Packages are a really important part of the Laravel experience (just like with any other framework). Whatever we need to do, there’s probably already a package for it out there; ready for a composer require to bring some magic in.

Some weeks ago, I had an idea for a new one. I work for AdEspresso, where we have a Symfony FeatureBundle, which handles feature toggling in our projects. It’s a really nice piece of code that we use to release new features only for specific subsets of users. So, I asked myself… why not port it for Laravel? That’s how my Laravel Feature package idea was born.

[...] In this article, I will try to explain how I prepared my development environment for it, and which choices I made when building the package. Not the development of every line of code per-se, but the actual workflow of getting from nothing to a full package.

He starts by talking about a handy addition to an application that can make the rollout of your new package easier: feature flags. He then starts in talking about the Composer configuration of the package and its "skeleton" (default directory and file structure). The tutorial then starts in on the code in the package itself covering the abstraction of domain code and implementing the features including the configuration, Blade template and the matching facade.

tagged: laravel package workflow tutorial skeleton featureflag implementation

Link: https://www.sitepoint.com/laravel-package-building-workflow/

Adam Wathan:
Optimizing Your PHPUnit Workflow in Sublime Text
Jan 17, 2017 @ 12:55:10

Adam Wathan has a post over on his site showing you how you can optimize your PHPUnit workflow in Sublime Text with the help of a few handy snippets.

I've been a big fan of Sublime Text's snippets feature for years.

They make it really easy to generate repetitive boilerplate code, and if you know how to use placeholders and substitutions properly, you can do some pretty magical stuff.

He shares some of his own snippets for automagically:

  • creating a new test matching the filename currently selected
  • making new test methods with some placeholder content
  • making the tests easier to run

For this last point he shows the use of the Sublime PHPUnit package to run the tests through the Sublime menu. Finally he ties it all together in a much simpler workflow including a final "all tests" run before he commits.

tagged: sublimetext editor phpunit workflow testing plugin snippet

Link: https://adamwathan.me/2017/01/16/optimizing-your-phpunit-workflow-in-sublime-text/

Eleven Labs:
Use the Symfony Workflow Component
Sep 29, 2016 @ 11:21:42

The Eleven Labs site has a new tutorial posted showing you how to use the Symfony workflow component, a component designed to help make performing a sequence of operations simpler.

Since Symfony 3.2, a new useful component was born: the Workflow component.

It is indeed really convenient and can simplify greatly your developments when you have to manage status workflows in your application, that occurs a lot.

The tutorial starts by helping you get the Workflow component installed (via Composer) and an example configuration defining a flow for a pull request. They then show the command to generate the flow graph so you can ensure the workflow is correct. From there example code is provided to use the workflow and do things like:

  • checking if you can transition to a certain state
  • get the list of enabled transitions
  • event handling

Code examples and configuration options are also included for these points, helping you to make your workflow even more flexible.

tagged: tutorial symfony workflow component example

Link: http://blog.eleven-labs.com/en/symfony-workflow-component/