guanguans/soar-php

HasOptions 函数问题

kbdxbt opened this issue · 4 comments

kbdxbt commented

\is_callable($value) and $value = $value($this);

这段代码有个问题,就是因为的 database 参数是 test,然后laravel助手函数中又包含 test 函数,这样导致执行出现了异常。
这里是否考虑加上 is_object 去判断是否是匿名函数

@kbdxbt 不好意思我刚看到。从回调类型中排除是函数的应该就可以了。我有时间改一下。

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@kbdxbt Sorry, I just saw it. It should be enough to exclude functions from the callback types. I'll change it when I have time.

kbdxbt commented

@kbdxbt不好意思我刚看到。从回调类型中排除是函数应该就可以了。我有时间改一下。

好的,我也是偶然发现这个问题,我本地使用了“test“名称的数据库,刚好pest里面也有这个助手函数,就触发了这个问题。

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@kbdxbtSorry I just saw it. Excluding functions from callback types should do the trick. I'll change it when I have time.

Okay, I discovered this problem accidentally. I used a database with the name "test" locally, and there happened to be this helper function in pest, which triggered this problem.