mirror of
https://gitee.com/ctexthuang/hyperf_rbac_framework_server_ctexthuang.git
synced 2025-12-25 15:57:50 +08:00
fix : update path And request
This commit is contained in:
25
app/Common/Trait/ParserRouterTrait.php
Normal file
25
app/Common/Trait/ParserRouterTrait.php
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user