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

selamiphp / stdlib / 73

pending completion
73

push

travis-ci-com

mkorkmaz
fix: cs for php8.0

5 of 5 new or added lines in 4 files covered. (100.0%)

104 of 123 relevant lines covered (84.55%)

27.39 hits per line

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

0.0
/src/Arrays/ArrayKeysCamelCaseConverter.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Selami\Stdlib\Arrays;
6

7
use Selami\Stdlib\CaseConverter;
8

9
use function is_array;
10
use function is_string;
11
use function strpos;
12

13
class ArrayKeysCamelCaseConverter
14
{
15
    public static function convertArrayKeys(array $arrayItems): array
16
    {
17
        $newArray = [];
×
18
        foreach ($arrayItems as $key => $value) {
×
19
            if (is_array($value)) {
×
20
                $value = self::convertArrayKeys($value);
×
21
            }
22

23
            if (is_string($key) && str_contains($key, '_')) {
×
24
                $key = CaseConverter::toCamelCase($key);
×
25
            }
26

27
            $newArray[$key] = $value;
×
28
        }
29

30
        return $newArray;
×
31
    }
32
}
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

© 2025 Coveralls, Inc