Code Duplication    Length = 9-9 lines in 2 locations

src/Assert.php 2 locations

@@ 1416-1424 (lines=9) @@
1413
     * @param string|int $key
1414
     * @param string     $message
1415
     */
1416
    public static function keyExists($array, $key, $message = '')
1417
    {
1418
        if (!(isset($array[$key]) || \array_key_exists($key, $array))) {
1419
            static::reportInvalidArgument(\sprintf(
1420
                $message ?: 'Expected the key %s to exist.',
1421
                static::valueToString($key)
1422
            ));
1423
        }
1424
    }
1425
1426
    /**
1427
     * @param array      $array
@@ 1431-1439 (lines=9) @@
1428
     * @param string|int $key
1429
     * @param string     $message
1430
     */
1431
    public static function keyNotExists($array, $key, $message = '')
1432
    {
1433
        if (isset($array[$key]) || \array_key_exists($key, $array)) {
1434
            static::reportInvalidArgument(\sprintf(
1435
                $message ?: 'Expected the key %s to not exist.',
1436
                static::valueToString($key)
1437
            ));
1438
        }
1439
    }
1440
1441
    /**
1442
     * Does not check if $array is countable, this can generate a warning on php versions after 7.2.