Preg.php 486 字节
<?php

namespace Lackoxygen\TiktokShop\Support;

class Preg
{
    /**
     * @param string $docs
     * @return array|mixed
     */
    public static function annotation(string $docs)
    {
        preg_match_all('/@.*?/U', $docs, $matches);

        return $matches[0] ?? [];
    }


    /**
     * @param $string
     * @return array|string|string[]|null
     */
    public static function mergeSpaces($string)
    {
        return preg_replace("/\s(?=\s)/", "\\1", $string);
    }
}