Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

added method to merge input filters #6431

Closed
wants to merge 10 commits into from

Conversation

brettminnie
Copy link

Needed a clean way to chain input filters together

*/
public function chainInputFilter(BaseInputFilter $inputFilter)
{
foreach ($inputFilter->getInputs() as $name=>$input) {
Copy link
Member

Choose a reason for hiding this comment

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

formatting issue, missing space around =>

Copy link
Author

Choose a reason for hiding this comment

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

Addressed and committed
On 12 Jul 2014 12:54 PM, "Aleksey Khudyakov" notifications@github.com
wrote:

In library/Zend/InputFilter/InputFilter.php:

@@ -62,4 +62,17 @@ public function add($input, $name = null)
}
return parent::add($input, $name);
}
+

  • /**
  • \* Chain one InputFilter into the current one
    
  • \* @param BaseInputFilter $inputFilter
    
  • \* @return $this
    
  • */
    
  • public function chainInputFilter(BaseInputFilter $inputFilter)
  • {
  •    foreach ($inputFilter->getInputs() as $name=>$input) {
    

formatting issue, missing space around =>


Reply to this email directly or view it on GitHub
https://github.com/zendframework/zf2/pull/6431/files#r14852944.

@brettminnie
Copy link
Author

Moved the input filter to the base class as per suggestion

@@ -62,4 +62,5 @@ public function add($input, $name = null)
}
return parent::add($input, $name);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this line.

@brettminnie
Copy link
Author

Is anything further going to happen with this after I have implemented the suggested changes?

@@ -60,6 +60,6 @@ public function add($input, $name = null)
$factory = $this->getFactory();
$input = $factory->createInput($input);
}
return parent::add($input, $name);
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert this change

@brettminnie
Copy link
Author

Updated, my bad, misread your comment :)

foreach ($inputFilter->getInputs() as $name => $input) {
$this->add($input, $name);
}
return $this;
Copy link
Member

Choose a reason for hiding this comment

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

Fluent interface should not be provided, especially on new APIs

@adamlundrigan
Copy link
Contributor

@brettminnie could you rebase your PR and do a force-push to get rid of all the other commits clogging up the view?

Two questions:

Ideally I'd also like to see it added to InputFilterInterface, but that would be a BC break, so maybe target for ZF3?

And, one last thing (I swear :P)...could you update the ticket title to say "merge" instead of "chain"...the latter has an incorrect connotation in this context.

Thanks!

@brettminnie brettminnie changed the title added method to chain input filters added method to merge input filters Nov 17, 2014
brettminnie added a commit to brettminnie/zf2-documentation that referenced this pull request Nov 17, 2014
@Ocramius Ocramius self-assigned this Nov 17, 2014
Ocramius added a commit that referenced this pull request Nov 17, 2014
Ocramius added a commit that referenced this pull request Nov 17, 2014
@Ocramius
Copy link
Member

@brettminnie this was merged into develop at 40970f4

Thanks!

@Ocramius Ocramius closed this Nov 17, 2014
@brettminnie
Copy link
Author

@Ocramius many thanks, about to open a pull request on the documentation side will reference it here when done

brettminnie added a commit to brettminnie/zf2-documentation that referenced this pull request Nov 17, 2014
@brettminnie
Copy link
Author

Documentation pr opened zendframework/zf2-documentation#1398

Ocramius added a commit to zendframework/zf2-documentation that referenced this pull request Jan 22, 2015
samsonasik pushed a commit to samsonasik/zf2-documentation that referenced this pull request Mar 31, 2015
gianarb pushed a commit to zendframework/zend-inputfilter that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-inputfilter that referenced this pull request May 15, 2015
…nd cleaning up test logic for readability
gianarb pushed a commit to zendframework/zend-inputfilter that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants