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

Alejandro Celaya:
The PhpStorm plugins of my choice
Sep 18, 2017 @ 09:17:33

In a new post to his site Alejandro Celaya has shared some of the PhpStorm plugins he makes use of in his day-to-day development on PHP applications. Some of them have to do with PHP itself but several help with more generic development needs.

Earlier last week I found a github repository which collects different resources related with the full post for more information.

tagged: phpstorm plugin development tool favorite opinion

Link: https://blog.alejandrocelaya.com/2017/09/16/the-phpstorm-plugins-of-my-choice/

SitePoint PHP Blog:
How to Master Your API Workflow with Postman
Aug 21, 2017 @ 11:13:20

On the SitePoint PHP blog author Younes Rafie has returned with another tutorial, this time with a focus on how Postman can help master your API workflow by making use of several of the features it already includes.

Building good APIs is hard, and anyone who had the chance to do so can relate to this. A project can easily grow to become a mess. One can keep trying to adopt an approach to make it more enjoyable, like trying a documentation-first workflow, but something always feels clumsy.

I was trying out Postman lately, a tool we’ve briefly covered before, and I discovered that they’re doing a great job by providing an integrated environment for different components of an API, like authorization, testing, documentation, versioning, etc.

He then goes through the use of the tool, including screenshots along the way for:

  • Making requests
  • Authorization
  • Environment Variables
  • Testing
  • Validating JSON schemas
  • Working with collections

The post finishes up with a look at generating documentation for the API using Postman's "View in Web" feature including integrating example calls and publishing it. There's also a look at exporting and importing data and a few links to some other helpful resources.

tagged: api workflow tutorial postman tool feature screenshot

Link: https://www.sitepoint.com/master-api-workflow-postman/

Jakub Zalas:
Static analysis tools for PHP in a single docker image
Jul 21, 2017 @ 10:56:07

Jakub Zalas has a new post to his site sharing a Docker image he's created to help make static analysis for your PHP code simpler: the phpqa image.

As part of my job I often perform application reviews and code quality analysis for clients who wish to have their code base looked at by an independent company. Running static analysis tools is usually a starting point to the review as it gives a general overview of a state of the project. I also like to run those tools as part of an introduction to an inherited code base.

For an easy access to the most popular static analysis tools for PHP I recently created a docker image - phpqa.

He lists out the tools that are included with the current version (a quite lengthy list) including:

  • analyze
  • box
  • deptrac
  • php-code-fixer
  • phpDocumentor
  • phpa
  • phploc
  • phpmd
  • phpstan
  • psalm

...and many more. Check out the full post for more of the tools in the list and links to more information about each one.

tagged: docker image static analysis tool image phpqa

Link: http://zalas.eu/phpqa-static-analysis-tools-for-php-docker-image/

Laravel News:
A Roundup of Laravel Testing Resources and Packages
Jul 12, 2017 @ 09:50:29

On the Laravel News site there's a new post sharing a list of Laravel testing resources and package that you can use for your Laravel-based applications to make testing easier and less work overall.

Testing code is one of the more challenging parts of programming, but luckily Laravel and some other tools are making it easier than ever. Research has even shown implementing a Test-Driven Development (TDD) approach can significantly reduce the number of bugs that make it to production. Testing provides many other benefits, like the freedom to refactor large parts of a system without (as much) fear of breaking things.

With all of the benefits of testing, it’s still challenging to continually test applications. If you are looking to start learning how to test Laravel applications or you want to expand your skills here is a list of great resources to help you.

Included in their list are resources like the official documentation, Laravel Dusk, the Laracasts Laravel Behat extension, the phpspec Laravel extension and Spatie Laravel packages. Each item on the list includes a screenshot, a brief description of the resource/tool and links to get more information about it.

tagged: laravel testing package tool list resource link

Link: https://laravel-news.com/laravel-testing-resources

Laravel News:
Homeboy Allows You to Automate Adding Sites to Homestead
Jul 10, 2017 @ 09:27:32

On the Laravel News site there's a quick post highlighting a tool that can be use to help automate adding sites to your local Homestead environment - Homeboy.

Homeboy is a new package for Laravel Homestead that allows you to add a new local development site quickly. Once you run the command line tool, it will update your host file to point your dev domain, update your Homestead.yaml file to include mapping to for the new project and create a database mapping, and finally, it’ll re-provision Vagrant.

The post also includes a screencast the project has shared showing the tool in use (though the choice of soundtrack is questionable). It basically works as a shortcut to adding the changes to the files yourself, making it simpler to spin up new sites and environments quickly.

tagged: homeboy laravel homestead environment setup configure tool

Link: https://laravel-news.com/homeboy-allows-you-to-automate-adding-sites-to-homestead

Symfony Blog:
Introducing Webpack Encore for Asset Management
Jun 13, 2017 @ 11:08:19

On the Symfony blog they've released an announcement about the release of a tool that wants to help make it easier for Symfony developers to work with frontend resources using the Webpack standard: Webpack Encore.

For everyone that has hit [the barrier of complexity in frontend dependencies and compilation], I'm very excited to show you something we've been working on for the last few months: Webpack Encore.

Encore gives you powerful CSS and JavaScript processing, combination, minification and a lot more, wrapped up in a simple API that's built on an industry-standard tool (Webpack).

He includes an example of the Javascript configuration to build out the Javascript, CSS and dependencies required for his build. He talks briefly about the conformity to the Webpack handling and how Encore fills that role in Symfony applications. The post ends linking to the project repository and the changes required to get the package installed.

tagged: webpack symfony encore library configuration frontend library dependency tool

Link: http://symfony.com/blog/introducing-webpack-encore-for-asset-management

Exakat Blog:
Up and running exakat in 15 mins
Jun 01, 2017 @ 11:32:41

On the Eakat blog they've written up a post showing you how to get the scanner up and running quickly on your system and start performing scans of the code based on their ruleset.

Exakat is a smart static analysis engine for PHP. It reviews the code fast and produces reports tailored for every needs : issues and code smell for programmers, inventories and maps for architect ; compilation and configurations lists for sys admins ; dashboards for team leaders. Including over 320 analysis and spanning versions from 5.2 to currently WIP 7.2, it helps you audit your code and keep it under control. Let’s see how to get up and running exakat in 15 mins.

The post then walks you through the installation process and defines some prerequisites you'll need before getting started. The Exakat installation is basically just grabbing a phar archive from the exakat.io server. Once it's installed they show you how to run your first scans and view the resulting output. The guide also shows you how to add additional options to the reporting and the command to update Exakat itself.

tagged: exakat scanner tool setup configuration quickstart tutorial

Link: https://www.exakat.io/up-and-running-with-exakat/

SitePoint PHP Blog:
Web App Performance Testing with Siege – Plan, Test, Learn
May 30, 2017 @ 12:27:36

The SitePoint PHP blog has a tutorial posted that wants to help you test you application and get the best performance from it. The tutorial introduces you to Siege, a performance testing tool that includes benchmarking functionality.

Almost anyone can build an app locally, deploy it to a server, and proudly show it to your friends. I hope you’ve already done all of this, and your project went viral, so you’re obviously here because you want to learn how to make sure your app is ready for some high traffic.

[...] In this article, designed to speed this [learning] process up, I will cover the basic concepts of testing the app (regression, load, and stress testing) with Siege</a and some tips and tricks I like to use when I’m testing my own web apps.

The tutorial starts with an overview of the types of testing and a few tips for making your testing successful and effective. Then, using a sample Symfony demo application, they show how to make basic requests using Siege and what kind of data the results report. With the basics out of the way, they then cover more advanced topics like concurrency and doing the actual performance testing. Based on the results, they see that caching content could definitely help and, after enabling that, see the numbers go down dramatically. The post ends with a look at other testing tools and some of the things you'd need to plan out when using Siege against your application to get the most meaningful results.

tagged: application performance testing siege tool tutorial

Link: https://www.sitepoint.com/web-app-performance-testing-siege-plan-test-learn/

TutsPlus.com:
What Is WP-CLI? A Beginner’s Guide
May 18, 2017 @ 10:35:31

The TutsPlus.com site has posted a new tutorial introducing you to the WordPress command line tool, the WP-CLI.

WP-CLI has been around for quite some time now (circa 2011) and has steadily gained momentum in the WordPress developer community. But what is it exactly, and how can you use it in your WordPress workflow?

The idea behind WP-CLI is that it allows you to interact with, and manage, WordPress sites via a command line interface. According to the official documentation, it's a command line alternative to using the traditional WordPress admin user interface.

They starts by explaining some of what the tool can do and help you get it installed either manually (on Mac or Windows) or more automatically for the DesktopServer users out there. The tutorial then goes through the basics of using the wp command line tool including getting a listing of current settings, showing the version installed and getting a list of currently installed plugins and themes. It also shows how to install new plugins, list posts, pages and comments currently in the system. The post ends with some additional resources where you can get more information about the WP-CLI tool and its features.

tagged: wordpress wpcli tool commandline introduction tutorial

Link: https://code.tutsplus.com/tutorials/what-is-wp-cli-a-beginners-guide--cms-28649

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