Assertion::empty()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 3
1
<?php declare(strict_types=1);
2
namespace Behapi\Assert;
3
4
use Assert as Beberlei;
5
6
/**
7
 * Adds an alias to `noContent`, so that a `not` switch can work on `empty`.
8
 *
9
 * To remove once https://github.com/beberlei/assert/pull/272 has been merged and released.
10
 *
11
 * @method static bool allEmpty(mixed $value, string|callable $message = null, string $propertyPath = null) Assert that value is empty for all values.
12
 * @method static bool nullOrEmpty(mixed $value, string|callable $message = null, string $propertyPath = null) Assert that value is empty or that the value is null.
13
 *
14
 * @link https://github.com/beberlei/assert/pull/272
15
 */
16
abstract class Assertion extends Beberlei\Assertion
17
{
18
    /** @return bool */
19
    public static function empty($value, $message = null, ?string $propertyPath = null): bool
20
    {
21
        return parent::noContent($value, $message, $propertyPath);
22
    }
23
}
24