| @@ 705-720 (lines=16) @@ | ||
| 702 | * @return Assert |
|
| 703 | * @throws AssertionFailedException |
|
| 704 | */ |
|
| 705 | public function notEmpty($message = null, $propertyPath = null) |
|
| 706 | { |
|
| 707 | if ( $this->doAllOrNullOr(__FUNCTION__, func_get_args()) ) |
|
| 708 | { |
|
| 709 | return $this; |
|
| 710 | } |
|
| 711 | if ( ( is_object($this->value) && empty((array)$this->value) ) || empty($this->value) ) |
|
| 712 | { |
|
| 713 | $message = sprintf( |
|
| 714 | $message ?: 'Value "%s" is empty, but non empty value was expected.', |
|
| 715 | $this->stringify($this->value) |
|
| 716 | ); |
|
| 717 | throw $this->createException($message, self::VALUE_EMPTY, $propertyPath); |
|
| 718 | } |
|
| 719 | return $this; |
|
| 720 | } |
|
| 721 | ||
| 722 | /** |
|
| 723 | * Assert that value is empty |
|
| @@ 1490-1505 (lines=16) @@ | ||
| 1487 | * @return Assert |
|
| 1488 | * @throws AssertionFailedException |
|
| 1489 | */ |
|
| 1490 | public function notBlank($message = null, $propertyPath = null) |
|
| 1491 | { |
|
| 1492 | if ( $this->doAllOrNullOr(__FUNCTION__, func_get_args()) ) |
|
| 1493 | { |
|
| 1494 | return $this; |
|
| 1495 | } |
|
| 1496 | if ( false === $this->value || ( empty( $this->value ) && '0' != $this->value ) ) |
|
| 1497 | { |
|
| 1498 | $message = sprintf( |
|
| 1499 | $message ?: 'Value "%s" is blank, but was expected to contain a value.', |
|
| 1500 | $this->stringify($this->value) |
|
| 1501 | ); |
|
| 1502 | throw $this->createException($message, self::INVALID_NOT_BLANK, $propertyPath); |
|
| 1503 | } |
|
| 1504 | return $this; |
|
| 1505 | } |
|
| 1506 | ||
| 1507 | /** |
|
| 1508 | * Assert that value is instance of given class-name. |
|