mirror of
https://github.com/Respect/Validation.git
synced 2024-06-27 17:50:13 +02:00
removing unnecessary else statements
This commit is contained in:
parent
83e6e70421
commit
cc89eb713e
|
@ -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.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue