Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not use strict return types? #57

Open
tarlepp opened this issue May 22, 2017 · 4 comments
Open

Why not use strict return types? #57

tarlepp opened this issue May 22, 2017 · 4 comments

Comments

@tarlepp
Copy link

tarlepp commented May 22, 2017

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
Copy link
Member

marcj commented May 22, 2017

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

@stevleibelt
Copy link
Contributor

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
Copy link
Member

marcj commented Feb 19, 2018

Actually, I would prefer strict :)

@cristianoc72
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants