Ramatou Adamou Issa

Ramatou Adamou Issa

  • Experiences
  • Formation
  • Musics
  • Blog

›Recent Posts

Recent Posts

  • Watchtower, container for updating docker images
  • PHP8 (Migrating existing PHP7 project to PHP8)
  • What news in Symfony 5
  • Command Query Segregation Responsibility (CQRS)
  • AFUP conference feedbacks

AFUP conference feedbacks

October 27, 2019

Ramatou Adamou Issa

Introduction

In order to promote knowledge sharing within PHP community, AFUP organise every year a PHP forum. This year, I was able to attend Paris's PHP Forum that took place between 24th and 25th of october. I'd like to share in this article the main topics of the last day of this forum.

Aggressive PHP Quality Insurance in 2019

During his presentation, Ocramus share with us some very useful tools to ensure code quality in production

There are several tools to ensure code quality such as:

  1. Psalm

Psalm is a static analysis tool for finding errors in PHP programs. You can install it with composer

 composer require --dev vimeo/psalm:^3

See full documentation on Github

  1. Phpunit (make program robust by unit testing)

The faster way to install phpunit is by downloading PHP Archive (Phar)

 $ wget https://phar.phpunit.de/phpunit-8.4.phar
 $ chmod +x phpunit-8.4.phar

see full documentation here

  1. Behat (To add functional testings)

Behat is a framework that allow coding functional tests.Easy to install and execute.

Installation

php composer.phar require --dev behat/behat
vendor/bin/behat -V

Full documentation on behat official website here

  1. Phpspec

A php toolset to drive emergent design by specification. Phpspec can be added in the composer file like this:

{
    "require-dev": {
        "phpspec/phpspec": "^4.0"
    },
    "config": {
        "bin-dir": "bin"
    },
    "autoload": {"psr-0": {"": "src"}}
}

The full Phpspec documentation can be found here

  1. Doctrine coding Standard

The doctrine coding standard is a PHP_CodeSniffer used on Doctrine projects. The doctrine coding standard can be use to validate a set of rules specified to validate Php code.

Basic usage

composer global require doctrine/coding-standard
phpcs --standard=Doctrine /path/to/some/file/to/sniff.php
phpcbf --standard=Doctrine /path/to/some/file/to/sniff.php

Full doctrine standard documentation here

  1. Phpbench

A PHP benchmark framework.

Installation

Download the phar and public key with curl as follow.

$ curl -o phpbench.phar https://phpbench.github.io/phpbench/phpbench.phar
$ curl -o phpbench.phar.pubkey https://phpbench.github.io/phpbench/phpbench.phar.pubkey

Make the phar executable and add it to the global path as below

$ chmod 0755 phpbench.phar
$ sudo mv phpbench.phar /usr/local/bin/phpbench
$ sudo mv phpbench.phar.pubkey /usr/local/bin/phpbench.pubkey

The full Phpbench documentation can be found here

  1. Analysis and logging tools

    1. Tideways
    2. Sentry
    3. Instana
    4. Datadog
  2. API Validator tools original website

composer require lezhnev74/openapi-psr7-validator
  1. Backward compatiblity checker tool full documentation

A tool that can be used to check BC (Backward Compatibility) between to PHP versions

Installation

composer require --dev roave/backward-compatibility-check

Install with docker

docker run --rm -v `pwd`:/app nyholm/roave-bc-check
  1. Security checker tool

    1. Security advisories (Fulle documentation can be found here)

Ensure that your application doesn't install dependencies with know vulnerabilities. Installation:

    composer require --dev roave/security-advisories:dev-master
  1. Composer checker & composer unused checker
    composer require maglnet/composer-require-checker
    composer require  icanhazstring/composer-unused

Final words:

A good program is a program that: 1. Keep everything up to date 2. is stable 3. is Fast 4. is nice 5. is working

Tweet
Recent Posts
  • Introduction
  • Aggressive PHP Quality Insurance in 2019
Ramatou Adamou Issa
Ramatou Adamou Issa
HomeExperiencesFormation
Social Networks
InstagramTwitterChat
Accounts
Gallery photoBlogGitHubStar
Copyright © 2025 Ramazaki