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

alma-oss / php-coding-standard / 18253230767

03 Oct 2025 06:36PM UTC coverage: 85.135% (+3.7%) from 81.481%
18253230767

push

github

web-flow
Merge pull request #110 from alma-oss/feature/remove-skip-of-blank-line-rule

Feat: Remove skip of BlankLineAfterOpeningTagFixer

6 of 7 new or added lines in 2 files covered. (85.71%)

189 of 222 relevant lines covered (85.14%)

27.77 hits per line

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

83.33
/src/polyfill.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * Polyfill for mb_ltrim() which is only available in PHP 8.4+
7
 *
8
 * This file provides backward compatibility for the mb_ltrim() function
9
 * introduced in PHP 8.4.0, allowing the codebase to work with PHP 8.0-8.3.
10
 */
11

12
if (!function_exists('mb_ltrim')) {
13
    /**
14
     * Strip whitespace (or other characters) from the beginning of a string using multibyte encoding.
15
     *
16
     * @param string $string The input string
17
     * @param non-empty-string $characters The characters to strip
18
     * @param string|null $encoding The character encoding. If null, the internal character encoding is used.
19
     *
20
     * @return string The trimmed string
21
     */
22
    function mb_ltrim(string $string, string $characters = " \n\r\t\v\0", ?string $encoding = null): string
23
    {
24
        $encoding = $encoding ?? mb_internal_encoding();
28✔
25

26
        $characterArray = preg_split('//u', $characters, -1, PREG_SPLIT_NO_EMPTY);
28✔
27
        if ($characterArray === false) {
28✔
NEW
28
            return $string;
×
29
        }
30

31
        $pattern = '/^[' . preg_quote(implode('', $characterArray), '/') . ']+/u';
28✔
32

33
        return (string) preg_replace($pattern, '', $string);
28✔
34
    }
35
}
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