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

Let AndroidConfig be more lenient with TTL values #714

Merged
merged 3 commits into from
Jul 7, 2022
Merged

Conversation

jeromegamez
Copy link
Member

Fixes #713

  • Fixed array shape for AndroidConfig objects
  • Allow numeric and string values
    • Positive ints ore numeric strings matching int values are converted to strings ending with s (1 => '1s')
    • Strings matching /^\d+s$/ are passed through
    • All other values throw an InvalidArgument exception to prevent a message from being sent, just to return an error

:octocat:

@MGatner
Copy link

MGatner commented Jul 7, 2022

I had to look up non-empty-string - glad they accounted for the weird fact that empty('0') === true!

non-empty-string is any string except ''. It does not mean “empty” in the weird sense used by empty().

https://phpstan.org/writing-php-code/phpdoc-types#other-advanced-string-types

@codecov
Copy link

codecov bot commented Jul 7, 2022

Codecov Report

Merging #714 (4b2b82c) into 6.x (960f897) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##                6.x     #714      +/-   ##
============================================
+ Coverage     90.45%   90.48%   +0.03%     
- Complexity     1506     1513       +7     
============================================
  Files           151      151              
  Lines          4189     4203      +14     
============================================
+ Hits           3789     3803      +14     
  Misses          400      400              

Copy link

@MGatner MGatner left a comment

Choose a reason for hiding this comment

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

LGTM! 🥳

@jeromegamez
Copy link
Member Author

Okay, I'll merge this now, if @nicodeboer76 finds something to be not working, they'll certainly let me know 😅

@jeromegamez jeromegamez merged commit dd941a7 into 6.x Jul 7, 2022
@jeromegamez jeromegamez deleted the 713-android-ttl branch July 7, 2022 18:00
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.

AndroidConfigShape TTL parameter has changed from string to positive-int
2 participants