Asynchronous prooph messages via Amazon AWS SQS

Do you know that you can easily switch to async prooph messages for your commands, events and even queries? This blog post shows how to use it to produce asynchronous messages via Amazon AWS Simple Queue Service (SQS). If you not familiar with the prooph components I will give you a short explanation. The prooph components are CQRS and Event Sourcing packages for PHP. They » ...

My conference talks in September

I'm thrilled to give two talks in September on different conferences. This is my first time, to be a Speaker on such a stage. I am very happy to have been accepted. Hopefully you can join and enjoy my talks. The first talk on 24th September in Dresden is about PHP Docker builds and the second one on 30th September in Hamburg is about PHP » ...

PHP 7 Expectations / Assertions

PHP 7 has many new features. One of them are Expectations maybe better known as assertions. It's a common practice to use an assertion library like beberlei/assert to ensure correct values and types on low level, for instance Value Objects or Aggregates. On the first sight, the Expectations in PHP 7 can replace the assertion libraries and you have a dependency fewer and of » ...

Docker for PHP Developers

Docker is a great way to emulate live server environment. Sure, you don't have the same hardware, but you can have the same infrastructure stack like multiple web, PHP-FPM, Database, CDN server and so on. Another reason why to use Docker for PHP development is, that it's faster than Vagrant and needs much fewer resources as Virtual Box machines. But it's also possible to use » ...

International PHP Conference in Munich 2015

The International PHP Conference 2015 in Munich was a great event for me. Many useful talks around PHP and web development and I was an attendee of the PHP: Continuously Delivered workshop by Sebastian Bergmann and Arne Blankerts. There were also interesting thoughts about PHP 7 and the strict type mode at the IPC Open Night - The Road to PHP 7 discussion. In this » ...

Using Composer cache in a Docker container

If you use the Composer Docker container you have the problem, that there is no Composer package cache, because the state of the Docker container is not saved. That's no problem, if you have only one project. If you have multiple projects it's a waste of time to download every package again and again. There is a simple trick to solve this problem. Start Composer » ...

Docker PHP Xdebug CLI debugging

I use Docker for development and for my website too. Now it's time to throw away var_dump and to use Xdebug for PHP Docker container. It's quite easy, because I have created a Docker PHP Xdebug Image on Docker Hub. You have only to set your path mappings in your IDE. This image can also be used to generate the code coverage with PHPUnit. » ...

PHP interoperable factory and service configuration

The configuration of instances via factories is not uniform, uses different ways to retrieve and check the needed options and it's not clear which configuration options needs the factory to create the instance. See how the interop-config PHP library solves this problem. The goal set by the interop-config library is to standardize how factories uses a configuration to create instances, support for auto discovery of » ...

PHPUnit tests with Peek and Poke - No more Reflection

Sometimes you want to test your protected or private methods or need access to a class property. This can be achieved via the PHP ReflectionClass, but it's some lines of code. Sebastian Bergmann has created a new library Peek and Poke, which does the job. See this tutorial how to use it. Some people would argue that only public methods should be tested. That's right, » ...

Hexagonal Architecture, Domain Driven Design, Event Sourcing, Oh, My!

In the past weeks I've read something about Domain Driven Design and Hexagonal Architecture. And the more I've read, the more I know that I know nothing. In the end I ended up with Event Sourcing and of course, don't forget Command Query Responsibility Segragation. In this article I will give an overview of these techniques. There are also a few links, books and GitHub » ...

PHP Profiler - Z-Ray, Blackfire, Tideways

Last year was the year of PHP profiling tools. Companies like Qafoo, Zend and SensioLabs have released its own profiling tools. Bottlenecks or inefficient code is a thing of the past. All PHP profiling tools are awesome and have its own advantages. This is a quick overview, so you have a good starting point to choose your PHP profiling tool which fits your needs. At » ...

Doctrine 2 plugin for Zend Server Z-Ray

There are some awesome Zend Server Z-Ray plugins, but there was none for Doctrine 2. I like the Doctrine 2 Zend Developer Tools extension, but with Z-Ray there are so many possibilities to display Doctrine 2 information. And the best part is, it's so easy to develop. Simply trace the function you want and collect the desired data. The Doctrine 2 plugin for Zend Server » ...

Remote PHPUnit code coverage in PHPStorm

There is a great PHPUnit code coverage plugin for PHPStorm. After installing this plugin your code coverage will be displayed directly in PHPStorm. Do you know how to use it remotely e.g. mit Vagrant? No, then this article is for you. Install PHPUnit code coverage plugin To install the PHPUnit code coverage plugin please open the menu File -> Settings -> Plugins and search » ...

Vagrant remote PHP & CLI debugging with PHPStorm

First we will cover how to enable PHP remote debugging in PHPStorm if Vagrant is used and because this is so easy we also write a short Shell script to use remote PHP CLI debugging e. g. for Cronjob scripts or unit tests. If you don't have a Vagrant box you can use my vagrant-librarian-puppet example. If you use this Vagrant box you can skip » ...

15 hints for high quality PHP projects

This is a short list of PHP hints to avoid common mistakes which I've seen through the years. Others have the same problems and probably already a solution. Remember every own code line in your project costs money and must be maintained. With the following 15 hints can you incredible improve your project quality! Use E_ALL | E_STRICT as PHP error_reporting and display » ...