• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jojo1981 / json-path-ast-builder / 17581676976

09 Sep 2025 11:51AM UTC coverage: 23.69%. First build
17581676976

push

github

web-flow
Merge pull request #2 from jojo1981/feature/upgrade-php-versions

Fix: Make compatible with PHP versions: ^8.0|^8.1|^8.2|^8.3|^8.4

55 of 207 new or added lines in 5 files covered. (26.57%)

434 of 1832 relevant lines covered (23.69%)

1.14 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Value/AbstractEnumValue.php
1
<?php
2
/*
3
 * This file is part of the jojo1981/json-path-ast-builder package
4
 *
5
 * Copyright (c) 2020 Joost Nijhuis <jnijhuis81@gmail.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed in the root of the source code
9
 */
10
declare(strict_types=1);
11

12
namespace Jojo1981\JsonPathAstBuilder\Value;
13

14
use function array_map;
15
use function implode;
16
use function preg_quote;
17

18
/**
19
 * @package Jojo1981\JsonPathAstBuilder\Value
20
 */
21
abstract class AbstractEnumValue extends AbstractStringValue
22
{
23
    /**
24
     * @return string
25
     */
26
    final protected function getPattern(): string
27
    {
28
        return '(' . implode('|', $this->getEscapedEnumValues()) . ')';
×
29
    }
30

31
    /**
32
     * @return string[]
33
     */
34
    private function getEscapedEnumValues(): array
35
    {
NEW
36
        return array_map(fn(string $value): string => preg_quote($value, '/'), $this->getEnumValues());
×
37
    }
38

39
    /**
40
     * @return string[]
41
     */
42
    abstract protected function getEnumValues(): array;
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc