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

Use array typehints for array arguments #305

Merged
merged 1 commit into from
Apr 26, 2018

Conversation

stof
Copy link

@stof stof commented Apr 26, 2018

Assertions are not blocking the invalid input by default (they might get disabled entirely or be configured to trigger only a warning). Using an array typehint is better to enforce the contract.

Remaining assertions are about scalar types, which cannot go to the method signature until the min PHP requirements is bumped to PHP 7.0.

@stof
Copy link
Author

stof commented Apr 26, 2018

On a side note, the new major release might bump the min requirement to something newer than PHP 5.4. 5.4 is EOLed since quite some time: https://secure.php.net/supported-versions.php

@pitbulk pitbulk merged commit 460ff7e into SAML-Toolkits:3.0.0 Apr 26, 2018
@pitbulk
Copy link
Contributor

pitbulk commented Apr 26, 2018

Hi,

I aligned the php min version requirements with the xmlseclibs library.

There was a debate there about what min PHP version put on composer.

@pitbulk
Copy link
Contributor

pitbulk commented Apr 26, 2018

btw, Thanks for your contributions ;)

@mlocati
Copy link

mlocati commented Apr 26, 2018

Totally off-topic, but this PR reminds me a recent article I wrote about type hinting: it may be useful for others too.

@stof stof deleted the array_typehint branch April 26, 2018 10:10
@stof
Copy link
Author

stof commented Apr 26, 2018

@pitbulk the fact that xmlseclibs supports 5.4+ only means you cannot support 5.3. It does not mean you need to align on it on both sides.

@stof
Copy link
Author

stof commented Apr 26, 2018

and I agree that bumping requirement just for the sake of it is not that useful. Here, I was suggesting to bump it to be able to use scalar typehints (so having a benefit for the library)

@pitbulk
Copy link
Contributor

pitbulk commented Apr 26, 2018

but the truth is that there are php-saml uses on PHP apps 5.4 and 5.5 and the idea of the 3.0.0 branch is to use it for PHP5 & PHP7 , so old php-saml 2.X branch can be declared deprecated (so I don't need to maintain 2 different branches. I do it for python-saml and python3-saml and similar can apply for Java, Ruby..).

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

Successfully merging this pull request may close these issues.

3 participants