Skip to content

Commit

Permalink
ID#332: corrected implementation to comply w/ interface definition.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Achatz committed Apr 1, 2018
1 parent 2edaf7d commit 3638650
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
10 changes: 9 additions & 1 deletion modules/captcha/pres/taglib/SimpleCaptchaTag.php
Expand Up @@ -71,12 +71,16 @@ class SimpleCaptchaTag extends AbstractFormControl {
*
* @param FormValidator $validator The desired validator.
*
* @return $this
*
* @author Christian Achatz
* @version
* Version 0.1, 30.08.2009<br />
*/
public function addValidator(FormValidator $validator) {
$this->textField->addValidator($validator);

return $this;
}

/**
Expand All @@ -86,6 +90,8 @@ public function addValidator(FormValidator $validator) {
*
* @param FormFilter $filter The desired filter.
*
* @return $this
*
* @since 1.11
*
* @author Christian Achatz
Expand All @@ -94,6 +100,8 @@ public function addValidator(FormValidator $validator) {
*/
public function addFilter(FormFilter $filter) {
$this->textField->addFilter($filter);

return $this;
}

/**
Expand Down Expand Up @@ -187,7 +195,7 @@ public function getCurrentCaptcha() {
/**
* Returns a reference on the captcha control's text field.
*
* @return TextFieldTag The captcha's text field.
* @return AbstractFormControl|TextFieldTag
*
* @author Christian Achatz
* @version
Expand Down
24 changes: 3 additions & 21 deletions modules/captcha/pres/validator/CaptchaValidator.php
Expand Up @@ -20,26 +20,8 @@
*/
namespace APF\modules\captcha\pres\validator;

/**
* <!--
* This file is part of the adventure php framework (APF) published under
* https://adventure-php-framework.org.
*
* The APF is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The APF is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with the APF. If not, see http://www.gnu.org/licenses/lgpl-3.0.txt.
* -->
*/
use APF\modules\captcha\pres\taglib\SimpleCaptchaTag;
use APF\tools\form\FormControl;
use APF\tools\form\validator\TextFieldValidator;

/**
Expand Down Expand Up @@ -105,9 +87,9 @@ public function notify() {
}

/**
* @return SimpleCaptchaTag
* @return SimpleCaptchaTag|FormControl
*/
protected function &getControl() {
protected function getControl() {
return $this->control;
}

Expand Down

0 comments on commit 3638650

Please sign in to comment.