fix : update path And request

This commit is contained in:
2025-09-16 15:14:47 +08:00
parent c1d8f02491
commit be0d0913b6
42 changed files with 484 additions and 75 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Common\Trait;
trait ParserRouterTrait
{
/**
* @param $callback
* @return array|string[]|null
*/
final protected function parse($callback): ?array
{
if (is_array($callback) && count($callback) == 2) return $callback;
if (is_string($callback)) {
if (str_contains($callback, '@')) $explode = explode('@', $callback);
if (str_contains($callback, '::')) $explode = explode('::', $callback);
if (isset($explode) && count($explode) === 2) return $explode;
}
return null;
}
}