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

azjezz / psl / 22680186990

04 Mar 2026 05:04PM UTC coverage: 97.34% (-1.0%) from 98.375%
22680186990

Pull #610

github

azjezz
perf: replace PSL calls with native PHP builtins and fix O(n2) algorithms

Signed-off-by: azjezz <azjezz@protonmail.com>
Pull Request #610: perf: replace PSL calls with native PHP builtins and fix O(n2) algorithms

319 of 355 new or added lines in 90 files covered. (89.86%)

64 existing lines in 12 files now uncovered.

9258 of 9511 relevant lines covered (97.34%)

34.97 hits per line

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

77.78
/src/Psl/Vec/concat.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Psl\Vec;
6

7
use function array_merge;
8
use function array_values;
9
use function is_array;
10

11
/**
12
 * Returns a new list formed by concatenating the given lists together.
13
 *
14
 * @template T
15
 *
16
 * @param iterable<T> $first
17
 * @param iterable<T> ...$rest
18
 *
19
 * @return list<T>
20
 */
21
function concat(iterable $first, iterable ...$rest): array
22
{
23
    if (is_array($first) && $rest === []) {
5✔
24
        return array_values($first);
1✔
25
    }
26

27
    $first = values($first);
4✔
28
    foreach ($rest as $arr) {
4✔
29
        if (is_array($arr)) {
4✔
30
            $first = array_merge($first, array_values($arr));
4✔
31
        } else {
NEW
32
            foreach ($arr as $value) {
×
NEW
33
                $first[] = $value;
×
34
            }
35
        }
36
    }
37

38
    return $first;
4✔
39
}
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