Symfony 1 support in 2016!

Symfony

A company recently contacted us regarding their website, stating that they were in need of some development services for their Symfony 1 website.  With such an old code base (from 2008) and a lack of any tests / documentation it seemed that this was a tall order.

The client wanted functional changes to their navigation menu, updates their search (prioritising results) and to use the latest google ReCaptcha code on their forms as well as other various changes.

We decided to help the client and and after some time working through the legacy code base, we were able to provide full solutions to all their project needs.  Their website is now updated and has been brought back to life without the expense of a full new build.

If you or your company find yourselves in a similar situation, held back by a legacy code base such as a Symfony 1x web application, why not contact us and see if we can help.

We are a friendly bunch and we will give you an honest opinion about your options and provide what services we can.

 

PHP 7 – A new way of coding for PHP

upgrades

At the start of 2016 we have began updating our client web servers  to use PHP version 7, as we wanted to take advantage of the immediate performance benefits it brings.  We first concentrated on the low hanging fruit and updated the Symfony 2 – 3 applications that we develop and manage.  We are yet to look into updating the many  Wordpress servers we maintain as these code bases can often depend upon 3rd party plugins which may not have been tested under php 7.

Using a Ubuntu server it is quite easy to update to PHP 7 simply by adding the PPA.  Once PHP 7 is installed we can expect quicker response times (which we have witnessed) as well as access to the new features of PHP 7.

New Features of PHP 7

If you wish to read about all the new features in PHP 7 then you can do so here.  However we will discuss a couple that we have enjoyed using so far below:

Return type declarations and Scalar type declarations

This is a couple of new features we started using right away.  When developing you domain code, we practice true professionalism by practicing TDD (test driven development) and as such we also try to follow the SOLID principals.  Writing code in this way has many benefits, and it is now aided by the addition of return type and scalar argument type declarations:

public function getUniversityId() : int
{
    return $this->universityId;
}

public function setUniversityId(int $universityId)
{
    $this->universityId = $universityId;
}

Using these new features allows us in the PHP community to structure our code in a more strict way, and provides clarity when reading code.  It also allows IDEs to better predict what is expected from a method of some object.  A breath of fresh air in a language which has a bad reputation for ugly code.

Anonymous Classes

We have not used these much yet, but I can already think of many situations recently when these would be useful.  Specifying interfaces and being able to create anonymous classes that are very simple and implement those interfaces is extremely convenient.

So far PHP 7 has been a great improvement for us and we hope this continues and improves the code bases of our existing frameworks and CMSs such as Symfony, WordPress, Magento, Drupal and Zend.