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

added question helper compatibility alongside the dialog in CreateSit… #816

Merged
merged 1 commit into from
May 19, 2017

Conversation

Dunduro
Copy link
Contributor

@Dunduro Dunduro commented May 17, 2017

I am targeting this branch, because this is BC.

Changelog

### Fixed
- added support for both `QuestionHelper` and `DialogHelper` in `CreateSiteCommand` for Symfony 2.3 and 3.x compatibility

Subject

Symfony 3 intergration

@Dunduro
Copy link
Contributor Author

Dunduro commented May 17, 2017

heej i rebased and fixed the structrual stuf i had done wrong, how do i get the test to run again?

#magic?!?!

}

/**
* {@inheritdoc}
*/
public function execute(InputInterface $input, OutputInterface $output)
{
$dialog = $this->getHelperSet()->get('dialog');
if (!$this->getHelperSet()->has('question')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove the ! and swap lines 60 and 62

$helper = $this->getHelperSet()->get('dialog');
} else {
$helper = $this->getHelperSet()->get('question');
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please provide NEXT_MAJOR instructions indicating what to do when dropping support for old versions of sf

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed the if statements around,

is there a specific best practice for adding these instructions?
and where can i read up on that?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cheers

} else {
$question = new \Symfony\Component\Console\Question\ConfirmationQuestion('Confirm site creation (Y/N)', false, '/^(y|j)/i');
$confirmation = $helper->ask($input, $output, $question);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

@greg0ire
Copy link
Contributor

Please associate your webengine.nl email address with your Github account, or change the email in your commits to an address already associated with it.

@greg0ire
Copy link
Contributor

heej i rebased and fixed the structrual stuf i had done wrong, how do i get the test to run again? #magic?!?!

I cancelled the second last build so that the last build would run. A build is run each time you push ;)


if ($input->getOption('no-confirmation') || $dialog->askConfirmation($output, 'Confirm site creation ?', false)) {
if ($this->getHelperSet()->has('question')) {
$question = new \Symfony\Component\Console\Question\ConfirmationQuestion('Confirm site creation (Y/N)', false, '/^(y|j)/i');
Copy link
Contributor

Choose a reason for hiding this comment

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

Please linebreak this

$question = new \Symfony\Component\Console\Question\ConfirmationQuestion('Confirm site creation (Y/N)', false, '/^(y|j)/i');
$confirmation = $helper->ask($input, $output, $question);
} else {
$confirmation = $input->getOption('no-confirmation') || $helper->askConfirmation($output, 'Confirm site creation ?', false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Linebreak this too please.

@Dunduro Dunduro force-pushed the 3.x branch 2 times, most recently from 0c82359 to 7693337 Compare May 17, 2017 13:12
}

/**
* {@inheritdoc}
*/
public function execute(InputInterface $input, OutputInterface $output)
{
$dialog = $this->getHelperSet()->get('dialog');
/*
* NEXT_MAJOR: do remove if statment and use the question helper only (true value of if) when dropping sf < 2.5
Copy link
Contributor

@greg0ire greg0ire May 17, 2017

Choose a reason for hiding this comment

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

- do remove if statment and use the question helper only (true value of if) when dropping sf < 2.5
+    remove if statement and use the question helper only (true value of if) when dropping sf < 2.5

if ($input->getOption('no-confirmation') || $dialog->askConfirmation($output, 'Confirm site creation ?', false)) {
/*
* NEXT_MAJOR: do remove if statment and use the question helper only (true value of if) when dropping sf < 2.5
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, and after that, good to merge :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oke fixed that

}

/**
* {@inheritdoc}
*/
public function execute(InputInterface $input, OutputInterface $output)
{
$dialog = $this->getHelperSet()->get('dialog');
/*
* NEXT_MAJOR: remove if statment and use the question helper only (true value of if) when dropping sf < 2.5
Copy link
Contributor

Choose a reason for hiding this comment

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

- statment
+ statement

@greg0ire
Copy link
Contributor

@sonata-project/contributors please review

} else {
$confirmation = $input->getOption('no-confirmation') || $helper->askConfirmation(
$output,
'Confirm site creation ?',
Copy link
Member

Choose a reason for hiding this comment

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

No whitespace infront of the question mark please

Copy link
Contributor

Choose a reason for hiding this comment

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

Ping @Dunduro

$question = new \Symfony\Component\Console\Question\ConfirmationQuestion(
'Confirm site creation (Y/N)',
false,
'/^(y|j)/i'
Copy link
Member

Choose a reason for hiding this comment

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

Why did you allow the letter j?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wel thats a funny story but i was looking the symfony 3 explanation and it had it as an example. But thought it made sense since symfony is in essence a multi langual platform, and in dutch for instance is 'ja'. But if ya think it shouldnt be there i dont mind taking it away

Copy link
Contributor

Choose a reason for hiding this comment

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

If you keep it, please add o for french, s for spanish, i for hungarian, h for Klingon and so on

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haha good point :p i'll get it fixed tomorrow

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oke fixed now

@Dunduro Dunduro force-pushed the 3.x branch 2 times, most recently from 143a5aa to 7ea64e8 Compare May 18, 2017 08:31
@greg0ire greg0ire merged commit 4c19123 into sonata-project:3.x May 19, 2017
@greg0ire
Copy link
Contributor

Thanks @Dunduro !

jayesbe pushed a commit to Indinuity/SonataPageBundle that referenced this pull request Aug 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants