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

chore: PHP 7.2 GitHub workflows #44

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

phil-davis
Copy link
Contributor

@phil-davis phil-davis commented Mar 4, 2024

Use GitHub workflows for CI.
Just support PHP 7.2 and later.
php-cs-fixer 3.51 (latest)
get phpunit to pass locally (I used PHP 7.4 and phpunit 9.6.17)
get phpstan to pass locally (I used PHP 7.4 and phpstan 1.10.59)

IMO the code here should still work with PHP 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3

Related issue #40

@phil-davis
Copy link
Contributor Author

phil-davis commented Mar 4, 2024

@ChristianRiesen this passes locally for me with PHP 7.4

Can you allow the GitHub workflows to run?

CI is green here:
https://github.com/phil-davis/otp/actions/runs/8139794838

@@ -307,7 +307,7 @@ private function getBinaryCounter($counter)
*/
private function getTimecounter()
{
return floor((time() + $this->totpOffset) / $this->period);
return \intval(floor((time() + $this->totpOffset) / $this->period));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

floor gives a float tpye that actually has an integer value. intval()turns into into an actualint` type, which is what the return type is supposed to be.

* @return number
* @return int
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This always returns an int and never a float (phpstan noticed this)

@phil-davis phil-davis marked this pull request as ready for review March 4, 2024 12:03
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.

1 participant