Propel3 icon indicating copy to clipboard operation
Propel3 copied to clipboard

Why not use strict return types?

Open tarlepp opened this issue 7 years ago • 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

tarlepp avatar May 22 '17 20:05 tarlepp

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

marcj avatar May 22 '17 20:05 marcj

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?

stevleibelt avatar Feb 19 '18 20:02 stevleibelt

Actually, I would prefer strict :)

marcj avatar Feb 19 '18 21:02 marcj

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.

cristianoc72 avatar Feb 20 '18 13:02 cristianoc72