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

Eduards Sizvos:
Stop Learning Frameworks
Dec 21, 2018 @ 17:19:24

In a recent post to his site Eduards Sizvos shares an opinion that's believed by many in the development world: stop learning frameworks.

We are developers. We need to stay up to date with technology. Every day, we learn programming languages, frameworks, and libraries. The more modern tools we know?—?the better.

Keeping up to date with Angular, React, Vue, Riot, Ember, Knockout is fun.

But we are wasting our time.

He goes on to talk about time, how important it is to spend on the right things and offers a story of his own where learning specific technologies didn't help in the long run. He then shares some resources (books) to help you learn good concepts instead of specific tools.

Remember – frameworks, libraries and tools come and go. Time is precious. Invest your golden time in transferable skills. Skills that will always be relevant.
tagged: learning framework specific tool opinion resource concepts

Link: https://sizovs.net/2018/12/17/stop-learning-frameworks/

Laravel News:
Laravel Telescope Beta Now Available
Oct 24, 2018 @ 17:09:57

On the Laravel News site they have a post about the Laravel Telescope beta that's just been announced. Laravel Telescope is an introspection and debugging tool that integrates with your Laravel application to provide details gathered during execution and issues along the way.

The first beta release of Laravel Telescope is now out and available for everyone. If you are not familiar with Telescope here is the quick overview:

Laravel Telescope is an elegant debug assistant for the Laravel framework. Telescope provides insight into the requests coming into your application, exceptions, log entries, database queries, queued jobs, mail, notifications, cache operations, scheduled tasks, variable dumps and more. Telescope makes a wonderful companion to your local Laravel development environment.

You can get the beta by installing it through Composer.

You install it the same way you'd install any other Laravel package via a composer require for laravel/telescope and run the installation and migration steps using the artisan command. This tool is only for Laravel applications and is tightly integrated with the tool. For more information on Telescope, check out its GitHub repository.

tagged: laravel telescope introspection tool debugging beta announcement

Link: https://laravel-news.com/laravel-telescope-beta

TechBeacon:
Why your choice of software testing suites matters
Oct 09, 2018 @ 15:44:14

On the TechBeacon site they've posted an article about choosing the right testing tools for your codebase and why making the right choice matters.

Fast end-to-end tests are the next big thing. The tooling has improved tremendously, and the productivity and insight gains are too good to ignore. Modern tools such as Cypress and >TestCafe are becoming quite impressive and can give you confidence in your product's quality.

As with most facets of software development, there is a balance to be strived for between speed and test confidence. The leverage point depends on the project, and the two most common types of software project these days are web services and enterprise software.

They talk about some of the differences between the testing of web services versus enterprise software as well as some of the practical advantage of fast tests. They also cover the advantages of broad tests and cover some of the current tools for testing including Cypress.io and Laravel Dusk.

tagged: software testing tool suite decision opinion

Link: https://techbeacon.com/why-your-choice-software-testing-suites-matters

Laravel News:
PHP Docs Workflow for Alfred
Aug 22, 2018 @ 15:49:53

On the Laravel News site there's a new post sharing a workflow developed by Bill Clark that makes searching the PHP documentation with the Alfred tool easier.

PHP Docs workflow for Alfred by Bill Clark is a workflow for searching the PHP documentation from Alfred directly. The PHP Docs workflow code builds on Till Krüss’ Laravel Docs Workflow for Alfred that we recently covered.

[...] You can search the PHP documentation by opening up Alfred and prefixing your search with “php” and then the search term.

They give an example of how to search the documentation and a screenshot of the resulting list. You can find out more and get this Alfred workflow for yourself over on the GitHub repository for the project.

tagged: documentation language workflow alfred productivity tool github

Link: https://laravel-news.com/php-docs-workflow-for-alfred

Pineco.de:
Examples, Tools and Resources for Regular Expressions
Aug 01, 2018 @ 16:27:05

On the Pineco.de blog there's a tutorial posted introducing regular expressions and providing some examples and links to external resources/tools to help put them to use in your code.

Using Regular Expressions is not easy. Mostly we have the feeling we need to learn a new language on the top of those we already know. But, the power and the flexibility that RegEx provides, make it worthy to learn. Take a look at some useful patterns, tools, and sources!

The examples they provide show the matching all the words and matching all the content between specified tags. They end the post linking to several helpful tools including the Laracasts regular expression video and the regexr.com testing tool.

tagged: regularexpression tool resources tutorial introduction example

Link: https://pineco.de/examples-tools-and-resources-for-regular-expressions/

Tomas Vortuba:
How to Convert Latte Templates to Twig in 27 Regular Expressions
Jul 09, 2018 @ 15:35:33

Tomas Votruba has a post to his site sharing a method for translating Latte templates to Twig templates with the help of the Simplify tool.

Statie - a tool for generating static open-sourced website like this blog or Pehapkari.cz - runs on YAML and Symfony DI Container. That way it's easy to understand by the PHP community worldwide.

But there are some pitfalls left. Like templates - being Latte the only one is a pity. Twig is often requested feature and one of the last big reasons not to use Statie.

Well, it was. Statie will support both Twig and Latte since next version. Are you a Twig fan? As a side effect, I made 27 regular expression to handle 80 % of the Latte to Twig migration for you.

He starts with a bit of explanation of how to the project started and his goals ("investing 5 hours to automate 30-minutes manual work under 10 seconds, so no-one else will have to do that ever again"). He covers the installation of the Symplify tool and how to execute the latte-to-twig-converter on a directory of Latte templates. He also provides some snippets of code you can use if you want to reverse the process and go from Twig to Latte.

tagged: convert latte template twig regular expression symplify tool tutorial

Link: https://www.tomasvotruba.cz/blog/2018/07/05/how-to-convert-latte-templates-to-twig-in-27-regular-expressions/

Tomas Votruba:
How to Turn Mocks from Nightmare to Solid Kiss Tests
Jun 13, 2018 @ 17:36:48

In a new post to his site Tomas Votruba shows you how to make your unit test mocks better with an easier and clearer way to use them. This simplification makes use of something PHP itself is already able to do: create anonymous classes.

At the time being, there is only 1 post about anonymous classes in tests (thanks to Matthieu!). Compared to that, there are many PHP tool made just for mocking: Prophecy, Mockery, PHPUnit native mocks, Mockista and so on. If you're a developer who uses one of them, knows that he needs to add proper annotations to make autocomplete work, has the PHPStom plugin that fixes bugs in this autocomplete and it works well for you, just stop reading.

This post is for developers who struggle with mocking and have a feeling, that they're doing something wrong.

He starts with an example of a test that creates a mock for an external request to the Heroku service using PHPUnit's mocking tools. He points out that this requires extra knowledge of the mocking methods and functionality to accomplish, potentially making it difficult to understand for those new to the tool. He then shares a refactor of the same test, this time making use of an anonymous class to mock out the needed findByCategoryId method and return a response. He ends the post pointing out that, as a side effect of this refactoring (and other interface refactoring) you'll create more SOLID code and it can help make it easier to maintain in the future.

tagged: tutorial mock unittest test anonymous class tool

Link: https://www.tomasvotruba.cz/blog/2018/06/11/how-to-turn-mocks-from-nightmare-to-solid-kiss-tests/

TutsPlus.com:
Boost Your Website Performance With PhpFastCache
Jun 05, 2018 @ 17:14:03

The TutsPlus.com site has a new tutorial posted showing you how to boost the performance of your PHP application with the help of PhpFastCache. PhpFastCache is a library that can either be installed manually or via Composer.

PhpFastCache is a library that makes it a breeze to implement caching in your PHP applications. It's an easy-to-use and yet powerful library that provides several APIs to help you implement a caching strategy of your choice without much hassle.

Don't make the mistake of assuming that it's merely a traditional file system caching scheme. In fact, PhpFastCache supports a plethora of adapters that let you choose from high-performance back-ends like Memcache, Redis, MongoDB, CouchDB, and others.

The article starts by helping you install (via Composer) and configure the library with the default file storage method. They talk you through all the code required to configure the caching and using the CacheManager to get and set values as well as checking to see if they're already cached. The tutorial also includes a bonus section showing how to use Redis for the storage rather than local file storage making it easier to share the cache data across multiple systems/servers.

tagged: tutorial phpfastcache caching tool library install configure implement

Link: https://code.tutsplus.com/tutorials/boost-your-website-performance-with-phpfastcache--cms-31031

Michael Dyrynda:
Sharing databases between Laravel applications
Apr 13, 2018 @ 14:39:16

Michael Dyrynda has a new post to his site showing the Laravel users out there how to share a database between your applications. In his case one of the applications is a legacy app and the other is a newer Laravel application.

As a contractor, I had a sanitised copy of the database, and I managed to reverse engineer the Eloquent models from the database schema, creating factories along the way, in order to be able to write tests for the members application.

In late 2017, we started migrating our CRM to Laravel as well, in order to modernise the code base a bit, give it a standard structure, and make it easy to make changes to it moving forward. Now that we had two Laravel applications, we started looking at how best to share data between them.

He starts by talking about reverse engineering the models from the database structure and the use of migrations to manage the database schema. In the end he created a stand-alone tool, Nomad, that helps to keep things in sync between the two databases. He includes examples of it in use and how it helped to keep the database in sync despite permissions issues and connection problems. He also mentions how they used it to take care of some testing issues, database configuration changes and how to use it in a continuous integration pipeline.

tagged: share database laravel application nomad tool migration schema

Link: https://dyrynda.com.au/blog/sharing-databases-between-laravel-applications

Web Technologies Blog:
Code quality tools in PHP to check and improve your code
Apr 12, 2018 @ 15:52:55

On the Web Technologies blog they've posted a guide to some of the top PHP code quality assurance tools to ensure your codebase is kept neat, clear and clean from any unnecessary complexity.

You’ve got the good approach dear reader: code quality tools are essential to write solid and error-free PHP code. It can help your colleagues detect defects in the codebase and teach them some key concepts.

Don’t forget however that the advises and data they can provide won’t be appropriate everywhere. Your experience and your analysis skills are the one you should trust first.

The tutorial starts of with some of the tooling you'll need to get the system up and running: Composer for package management, terminal access for command execution and editor/IDE integrations (optional, obviously). It then lists out each of the tools and includes installation steps and links to more information:

  • PHP-CS-Fixer (PHP Coding Standards Fixer)
  • PHPCS (PHP CodeSniffer)
  • PHPMD (PHP Mess Detector)
  • PHPStan (PHP Static Analysis Tool)
  • PHPUnit and the CRAP metric

It also includes a few "bonus" tools that might be useful to track other quality aspects of your code including PhpLoc (lines of code), PHPMND for detecting "magic" numbers and churn-php for evaluating complexity of code based on number of commits. there's several more listed in the full post so be sure to check it out and see how you can integrate them into your development process.

tagged: quality assurance tool list improve code tutorial

Link: http://web-techno.net/code-quality-check-tools-php/


Trending Topics: