Usage of PHP strict typing by default

At the sprint in Salzburg 2018 we decided to introduce PHPs strict_types declaration in our code base.

So each newly introduced PHP file must declare strict types for the given file. Existing files should be adjusted over time.

We will use the code style of the upcoming PHP-Fig as described in https://github.com/php-fig/fig-standards/blob/master/proposed/extended-coding-style-guide.md.

Example:

<?php
declare(strict_types=1);

namespace Vendor\Package;

There might be some exceptions from this rule, for example:

  • Eel Helper
  • Fluid View Helper

where providing type safe arguments are not assured.

4 Likes