Code Duplication    Length = 17-17 lines in 2 locations

src/Assert.php 2 locations

@@ 905-921 (lines=17) @@
902
     * @return Assert
903
     * @throws AssertionFailedException
904
     */
905
    public function notEmpty($message = null, $fieldName = null)
906
    {
907
        if ( $this->doAllOrNullOr(__FUNCTION__, func_get_args()) )
908
        {
909
            return $this;
910
        }
911
        if ( ( is_object($this->value) && empty((array)$this->value) ) || empty($this->value) )
912
        {
913
            $message = $message ?: $this->overrideError;
914
            $message = sprintf(
915
                $message ?: 'Value "%s" is empty, but non empty value was expected.',
916
                $this->stringify($this->value)
917
            );
918
            throw $this->createException($message, $this->overrideCode ?: self::VALUE_EMPTY, $fieldName);
919
        }
920
        return $this;
921
    }
922
923
    /**
924
     * Assert that value is empty.
@@ 1750-1766 (lines=17) @@
1747
     * @return Assert
1748
     * @throws AssertionFailedException
1749
     */
1750
    public function notBlank($message = null, $fieldName = null)
1751
    {
1752
        if ( $this->doAllOrNullOr(__FUNCTION__, func_get_args()) )
1753
        {
1754
            return $this;
1755
        }
1756
        if ( false === $this->value || ( empty( $this->value ) && '0' != $this->value ) )
1757
        {
1758
            $message = $message ?: $this->overrideError;
1759
            $message = sprintf(
1760
                $message ?: 'Value "%s" is blank, but was expected to contain a value.',
1761
                $this->stringify($this->value)
1762
            );
1763
            throw $this->createException($message, $this->overrideCode ?: self::INVALID_NOT_BLANK, $fieldName);
1764
        }
1765
        return $this;
1766
    }
1767
1768
    /**
1769
     * Assert that value is an instance of a given class-name.