propelorm / Propel3

High performance data-mapper ORM with optional active-record traits for RAD and modern PHP 7.2+
MIT License
250 stars 35 forks source link

Why not use strict return types? #57

Open tarlepp opened 7 years ago

tarlepp commented 7 years ago

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 7 years ago

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

stevleibelt commented 6 years ago

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 6 years ago

Actually, I would prefer strict :)

cristianoc72 commented 6 years ago

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.