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

Change type of $skipOnEmpty argument in rules' constructors from mixed to bool|callable|null #698

Merged
merged 23 commits into from Apr 30, 2024

Conversation

arogachev
Copy link
Contributor

Q A
Is bugfix?
New feature?
Breaks BC? ✔️

@arogachev arogachev changed the base branch from 1.x to master April 12, 2024 08:34
@arogachev arogachev requested a review from a team April 12, 2024 08:34
@arogachev arogachev self-assigned this Apr 12, 2024
@arogachev arogachev added the type:task Task label Apr 12, 2024
@arogachev arogachev added this to the 2.0 milestone Apr 12, 2024
@arogachev arogachev marked this pull request as ready for review April 12, 2024 08:35
@arogachev arogachev added the status:code review The pull request needs review. label Apr 12, 2024
Copy link
Member

@vjik vjik left a comment

Choose a reason for hiding this comment

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

What about another rules: AtLeast, Email, In ?

Need keep in constructor argument only and extract class property to class level:

class {
	public function __construct(
		private mixed $skipOnEmpty = null,
	) {}
}

// ↓

class {
	private mixed $skipOnEmpty;
	public function __construct(
		bool|callable|null $skipOnEmpty = null,
	) {
		$this->skipOnEmpty = $skipOnEmpty;
	}
}

@arogachev arogachev requested a review from a team April 15, 2024 09:50
@arogachev
Copy link
Contributor Author

@vjik Done. ✔️

src/Rule/Trait/SkipOnEmptyTrait.php Show resolved Hide resolved
src/Rule/Trait/SkipOnEmptyTrait.php Outdated Show resolved Hide resolved
tests/Rule/CompositeTest.php Show resolved Hide resolved
tests/Rule/CompositeTest.php Outdated Show resolved Hide resolved
@arogachev arogachev requested review from vjik and a team April 29, 2024 16:08
UPGRADE.md Outdated Show resolved Hide resolved
UPGRADE.md Outdated Show resolved Hide resolved
UPGRADE.md Outdated Show resolved Hide resolved
src/Rule/Trait/SkipOnEmptyTrait.php Outdated Show resolved Hide resolved
src/Rule/Trait/SkipOnEmptyTrait.php Outdated Show resolved Hide resolved
UPGRADE.md Outdated Show resolved Hide resolved
@arogachev arogachev merged commit a6c8917 into master Apr 30, 2024
24 of 25 checks passed
@arogachev arogachev deleted the 660-change-skip-on-empty-type branch April 30, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review. type:task Task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace mixed $skipOnEmpty in rules constructors to bool|callable|null $skipOnEmpty
3 participants