| @@ 692-707 (lines=16) @@ | ||
| 689 | * @return Assert |
|
| 690 | * @throws AssertionFailedException |
|
| 691 | */ |
|
| 692 | public function notEmpty($message = null, $propertyPath = null) |
|
| 693 | { |
|
| 694 | if ( $this->doAllOrNullOr(__FUNCTION__, func_get_args()) ) |
|
| 695 | { |
|
| 696 | return $this; |
|
| 697 | } |
|
| 698 | if ( ( is_object($this->value) && empty((array)$this->value) ) || empty($this->value) ) |
|
| 699 | { |
|
| 700 | $message = sprintf( |
|
| 701 | $message ?: 'Value "%s" is empty, but non empty value was expected.', |
|
| 702 | $this->stringify($this->value) |
|
| 703 | ); |
|
| 704 | throw $this->createException($message, self::VALUE_EMPTY, $propertyPath); |
|
| 705 | } |
|
| 706 | return $this; |
|
| 707 | } |
|
| 708 | ||
| 709 | /** |
|
| 710 | * Assert that value is empty |
|
| @@ 1477-1492 (lines=16) @@ | ||
| 1474 | * @return Assert |
|
| 1475 | * @throws AssertionFailedException |
|
| 1476 | */ |
|
| 1477 | public function notBlank($message = null, $propertyPath = null) |
|
| 1478 | { |
|
| 1479 | if ( $this->doAllOrNullOr(__FUNCTION__, func_get_args()) ) |
|
| 1480 | { |
|
| 1481 | return $this; |
|
| 1482 | } |
|
| 1483 | if ( false === $this->value || ( empty( $this->value ) && '0' != $this->value ) ) |
|
| 1484 | { |
|
| 1485 | $message = sprintf( |
|
| 1486 | $message ?: 'Value "%s" is blank, but was expected to contain a value.', |
|
| 1487 | $this->stringify($this->value) |
|
| 1488 | ); |
|
| 1489 | throw $this->createException($message, self::INVALID_NOT_BLANK, $propertyPath); |
|
| 1490 | } |
|
| 1491 | return $this; |
|
| 1492 | } |
|
| 1493 | ||
| 1494 | /** |
|
| 1495 | * Assert that value is instance of given class-name. |
|