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

[Type] add TypeInterface / add Type::matches / add vec and dict types. #132

Merged
merged 8 commits into from
Feb 17, 2021

Conversation

azjezz
Copy link
Owner

@azjezz azjezz commented Feb 17, 2021

closes #128
closes #129


change-log:

Features:

  • added Type\vec functions that returns a Type of vec<T> ( aka list<T>, T[] )
  • added Type\dict function that returns a Type of dict<Tk, Tv> ( aka array<Tk, Tv> )
  • added a new Type\TypeInterface interface that is implemented by all types.
  • added Type::matches($value): bool method to check if the given value is of that type.

Deprecation:

  • all Type\is_* functions have been deprecated, use Type\string()->matches($value) instead of Type\is_string($value)

Breaking changes:

  • a new method matches has been added to Type\Type, if you have a type that extends this base class, you probably won't be effected, unless you have a method in your class named matches.

@azjezz azjezz added Priority: Medium This issue may be useful, and needs some attention. Status: In Progress This issue is being worked on, and has someone assigned. Type: Enhancement Most issues will probably ask for additions or changes. Type: BC Break A change that will result in a backward compatibility break in the public API. labels Feb 17, 2021
@azjezz azjezz added this to the 1.3.0 milestone Feb 17, 2021
@azjezz azjezz self-assigned this Feb 17, 2021
@coveralls
Copy link

coveralls commented Feb 17, 2021

Pull Request Test Coverage Report for Build 575979713

  • 167 of 167 (100.0%) changed or added relevant lines in 27 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 99.958%

Totals Coverage Status
Change from base Build 571224268: 0.002%
Covered Lines: 2403
Relevant Lines: 2404

💛 - Coveralls

@azjezz azjezz added Status: Completed Nothing further to be done with this issue. Awaiting to be closed by the requestor out of politeness and removed Status: In Progress This issue is being worked on, and has someone assigned. labels Feb 17, 2021
@azjezz azjezz merged commit 5d6fdc4 into 1.3.x Feb 17, 2021
@azjezz azjezz deleted the feature/type/vec+dict branch February 20, 2021 22:06
@azjezz azjezz restored the feature/type/vec+dict branch October 3, 2021 14:34
@azjezz azjezz deleted the feature/type/vec+dict branch November 4, 2021 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium This issue may be useful, and needs some attention. Status: Completed Nothing further to be done with this issue. Awaiting to be closed by the requestor out of politeness Type: BC Break A change that will result in a backward compatibility break in the public API. Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Type] add Type\vec($vt) and Type\dict($kt, $vt) [Type] add Type::matches($value): bool
2 participants