Skip to content

Conversation

@patdel0
Copy link
Contributor

@patdel0 patdel0 commented Jan 9, 2023

Closes #5

Types were already declared in some functions, however they were not being enforced, due to strict_types not being used in those files.

This PR addresses that issue by adding declare(strict_types=1) to the files.

Changes

  • Add declare(strict_types=1) to all files, using php-cs-fixer
  • Add types to all args and return values
  • Remove tests which were using the incorrect types or were checking for TypeErrors
  • Remove failing test relates Dates testParseFailureA is failing #24

`parse()` expects a string as an argument.
We are now using strict_types=1, meaning a TypeError will return before
the failing test is executed.
This test is failing and will be addressed under issue:
#24
@snim2
Copy link
Contributor

snim2 commented Jan 12, 2023

This all looks fine to me. Do you have a plan for tackling #24? I'm not sure whether it's really big enough to split into a separate PR?

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.

Use type declarations, and strict_types mode

3 participants