removing unnecessary else statements

This commit is contained in:
Marcelo Araujo 2011-04-04 15:13:46 -03:00
parent 83e6e70421
commit cc89eb713e

View file

@ -18,24 +18,24 @@ class Contains extends AbstractRule
{
if ($this->identical)
return $this->validateIdentical($input);
else
return $this->validateEquals($input);
return $this->validateEquals($input);
}
protected function validateEquals($input)
{
if (is_array($input))
return in_array($this->containsValue, $input);
else
return false !== mb_stripos($input, $this->containsValue);
return false !== mb_stripos($input, $this->containsValue);
}
protected function validateIdentical($input)
{
if (is_array($input))
return in_array($this->containsValue, $input, true);
else
return false !== mb_strpos($input, $this->containsValue);
return false !== mb_strpos($input, $this->containsValue);
}
}
@ -71,4 +71,4 @@ class Contains extends AbstractRule
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
*/