propelorm/Propel3

Why not use strict return types?

tarlepp opened this issue · 4 comments

composer.json shows that minimum PHP version is 7.1.x - so why don't use strict types everywhere? eg. https://github.com/propelorm/Propel3/blob/master/src%2FPropel%2FCommon%2FTypes%2FSQL%2FBooleanType.php

<?php
declare(strict_types=1);

public function databaseToProperty($value, FieldMap $fieldMap): bool
public function propertyToDatabase($value, FieldMap $fieldMap): int
marcj commented

Because we decided to use php 7.1+ after the most code was written.

So is strict return types a nice to have (something a contributer should to for newer code) or do you want to keep the code consistent by not using strict return types in general?

marcj commented

Actually, I would prefer strict :)

While refactoring some parts and fixing test suite, we're moving to strict types (see #64 and #61).
At the end, Propel 3 will be almost totally strict typed.