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

Typo #1357

Merged
merged 1 commit into from
Apr 13, 2014
Merged

Typo #1357

merged 1 commit into from
Apr 13, 2014

Conversation

umpirsky
Copy link
Contributor

No description provided.

@jjanvier
Copy link
Contributor

@umpirsky needs rebase :p

@umpirsky
Copy link
Contributor Author

@jjanvier Rebased.


foreach ($container->findTaggedServiceIds('sylius.promotion_action') as $id => $attributes) {
$checkers[$attributes[0]['type']] = $attributes[0]['label'];
$actions[$attributes[0]['type']] = $attributes[0]['label'];
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you fix indent?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also to prevent notices, please add simple validation:

if (!isset($attributes[0]['type'])) {
    throw new \InvalidArgumentException('Tagged promotion action needs to have `type` attribute.');
}

if (!isset($attributes[0]['label'])) {
    throw new \InvalidArgumentException('Tagged promotion action needs to have `label` attribute.');
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there is no need. Since it can happen only because of bad config, which is usually during development. But I added them.

@stloyd
Copy link
Contributor

stloyd commented Apr 13, 2014

@pjedrzejewski 👍

pjedrzejewski pushed a commit that referenced this pull request Apr 13, 2014
@pjedrzejewski pjedrzejewski merged commit e283b63 into Sylius:master Apr 13, 2014
@pjedrzejewski
Copy link
Member

Thanks Sasha!

pamil pushed a commit to pamil/Sylius that referenced this pull request May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants