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

feat(type): add class_string types (#432) #435

Merged
merged 2 commits into from
Dec 15, 2023

Conversation

zerkms
Copy link
Contributor

@zerkms zerkms commented Dec 14, 2023

fixes #432

This PR creates a new Type\class_string(T) that allows to assert that the value is of a type class-string<T>.

Example of use:

$value = Type\class_string(Psl\Collection\CollectionInterface::class)->assert('foo');
/** @psalm-trace $value */;

// $value: class-string<Psl\Collection\CollectionInterface<array-key, mixed>>

@zerkms zerkms force-pushed the 432-class_string branch 2 times, most recently from b0c85b4 to a3c049e Compare December 14, 2023 06:49
@coveralls
Copy link

coveralls commented Dec 14, 2023

Pull Request Test Coverage Report for Build 7219484447

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

Totals Coverage Status
Change from base Build 7091315291: 0.002%
Covered Lines: 4189
Relevant Lines: 4231

💛 - Coveralls

Copy link
Collaborator

@veewee veewee left a comment

Choose a reason for hiding this comment

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

Thanks! This looks very good.
I've added 2 little remarks to improve the tests a bit. But I think it's fine to go after this.

tests/unit/Type/ClassStringTypeTest.php Show resolved Hide resolved
tests/unit/Type/ClassStringTypeTest.php Outdated Show resolved Hide resolved
@veewee veewee added 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: Enhancement Most issues will probably ask for additions or changes. labels Dec 15, 2023
@veewee veewee merged commit 15651cb into azjezz:next Dec 15, 2023
14 checks passed
renovate bot referenced this pull request in ben-challis/sql-migrations Dec 29, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [azjezz/psl](https://togithub.com/azjezz/psl) | `2.8.0` -> `2.9.0` |
[![age](https://developer.mend.io/api/mc/badges/age/packagist/azjezz%2fpsl/2.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/packagist/azjezz%2fpsl/2.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/packagist/azjezz%2fpsl/2.8.0/2.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/azjezz%2fpsl/2.8.0/2.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>azjezz/psl (azjezz/psl)</summary>

### [`v2.9.0`](https://togithub.com/azjezz/psl/releases/tag/2.9.0):
Lenalee - 2.9.0

[Compare Source](https://togithub.com/azjezz/psl/compare/2.8.0...2.9.0)

#### What's Changed

- Apply fixes for Psalm 5.17 by
[@&#8203;veewee](https://togithub.com/veewee) in
[https://github.com/azjezz/psl/pull/431](https://togithub.com/azjezz/psl/pull/431)
- feat(type): add class_string types
([#&#8203;432](https://togithub.com/azjezz/psl/issues/432)) by
[@&#8203;zerkms](https://togithub.com/zerkms) in
[https://github.com/azjezz/psl/pull/435](https://togithub.com/azjezz/psl/pull/435)
- feat(option): add `Option::zip()`, `Option::zipWith()` and
`Option::unzip()` methods by
[@&#8203;devnix](https://togithub.com/devnix) in
[https://github.com/azjezz/psl/pull/434](https://togithub.com/azjezz/psl/pull/434)
- feat(option): add `Option::proceed()` method by
[@&#8203;devnix](https://togithub.com/devnix) in
[https://github.com/azjezz/psl/pull/433](https://togithub.com/azjezz/psl/pull/433)
- feat(option): new `Option::apply()` method by
[@&#8203;devnix](https://togithub.com/devnix) in
[https://github.com/azjezz/psl/pull/426](https://togithub.com/azjezz/psl/pull/426)

#### New Contributors

- [@&#8203;zerkms](https://togithub.com/zerkms) made their first
contribution in
[https://github.com/azjezz/psl/pull/435](https://togithub.com/azjezz/psl/pull/435)

**Full Changelog**: azjezz/psl@2.8.0...2.9.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ben-challis/sql-migrations).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMDMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjEwMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@zerkms zerkms deleted the 432-class_string branch September 24, 2024 23:35
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: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type\implements_interface
3 participants