jawira/case-converter

View on GitHub
src/Split/UppercaseSplitter.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php declare(strict_types=1);

namespace Jawira\CaseConverter\Split;

class UppercaseSplitter extends Splitter
{
    // language=PhpRegExp
    public const PATTERN = '#(?=\p{Lu}{1})#u';

    /**
     * Splits $words using Uppercase letters.
     *
     * @see https://www.regular-expressions.info/unicode.html#category
     * @return string[] Words in $input
     * @throws \Jawira\CaseConverter\CaseConverterException
     */
    public function split(): array
    {
        return $this->splitUsingPattern($this->inputString, self::PATTERN);
    }
}