Code Duplication    Length = 17-17 lines in 2 locations

src/Assert.php 2 locations

@@ 812-828 (lines=17) @@
809
     * @return Assert
810
     * @throws AssertionFailedException
811
     */
812
    public function notEmpty($message = null, $propertyPath = null)
813
    {
814
        if ( $this->doAllOrNullOr(__FUNCTION__, func_get_args()) )
815
        {
816
            return $this;
817
        }
818
        if ( ( is_object($this->value) && empty((array)$this->value) ) || empty($this->value) )
819
        {
820
            $message = $message ?: $this->overrideError;
821
            $message = sprintf(
822
                $message ?: 'Value "%s" is empty, but non empty value was expected.',
823
                $this->stringify($this->value)
824
            );
825
            throw $this->createException($message, $this->overrideCode ?: self::VALUE_EMPTY, $propertyPath);
826
        }
827
        return $this;
828
    }
829
830
    /**
831
     * Assert that value is empty
@@ 1644-1660 (lines=17) @@
1641
     * @return Assert
1642
     * @throws AssertionFailedException
1643
     */
1644
    public function notBlank($message = null, $propertyPath = null)
1645
    {
1646
        if ( $this->doAllOrNullOr(__FUNCTION__, func_get_args()) )
1647
        {
1648
            return $this;
1649
        }
1650
        if ( false === $this->value || ( empty( $this->value ) && '0' != $this->value ) )
1651
        {
1652
            $message = $message ?: $this->overrideError;
1653
            $message = sprintf(
1654
                $message ?: 'Value "%s" is blank, but was expected to contain a value.',
1655
                $this->stringify($this->value)
1656
            );
1657
            throw $this->createException($message, $this->overrideCode ?: self::INVALID_NOT_BLANK, $propertyPath);
1658
        }
1659
        return $this;
1660
    }
1661
1662
    /**
1663
     * Assert that value is instance of given class-name.