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

Minor improvements for RefundFactory and RefundPaymentFactory #321

Merged
merged 3 commits into from
Jun 29, 2021

Conversation

GSadee
Copy link
Member

@GSadee GSadee commented Jun 28, 2021

No description provided.

@GSadee GSadee added the DX Issues and PRs aimed at improving Developer eXperience. label Jun 28, 2021
@GSadee GSadee requested a review from a team as a code owner June 28, 2021 07:19
@GSadee GSadee force-pushed the factory-improvements branch from e5e7bd9 to 31aed15 Compare June 28, 2021 07:29
@GSadee GSadee force-pushed the factory-improvements branch from 31aed15 to 8753031 Compare June 28, 2021 07:54
@@ -27,6 +27,11 @@ public function __construct(string $className)
$this->className = $className;
}

public function createNew(): RefundPaymentInterface
{
throw new \InvalidArgumentException('This object is not default constructable.');
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
throw new \InvalidArgumentException('This object is not default constructable.');
throw new \InvalidArgumentException('This object is not constructable by default.');

or

Suggested change
throw new \InvalidArgumentException('This object is not default constructable.');
throw new \InvalidArgumentException('This object is not constructable without any arguments.');

or

Suggested change
throw new \InvalidArgumentException('This object is not default constructable.');
throw new \InvalidArgumentException('Default creation method is forbidden for this object. Use `createWithData` instead.');

@lchrusciel lchrusciel merged commit 6048825 into Sylius:master Jun 29, 2021
@lchrusciel
Copy link
Member

Thanks, Grzegorz! 🥇

@GSadee GSadee deleted the factory-improvements branch June 29, 2021 08:13
lchrusciel added a commit that referenced this pull request Jun 29, 2021
…n (GSadee)

This PR was merged into the 1.0-dev branch.

Discussion
----------

According to: #321 (review)

Commits
-------

0045e1c Change to a more meaningful message in factory exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Issues and PRs aimed at improving Developer eXperience.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants