Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type errors #293

Open
yiqing-95 opened this issue Apr 28, 2023 · 4 comments
Open

type errors #293

yiqing-95 opened this issue Apr 28, 2023 · 4 comments
Assignees

Comments

@yiqing-95
Copy link

`
TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given in /Volumes/macintosh-hd/workspace/php_space/vendor/schmunk42/yii2-giiant/src/helpers/SaveForm.php:60
Stack trace:
#0 /Volumes/macintosh-hd/workspace/php_space/YiiSpace/vendor/schmunk42/yii2-giiant/src/helpers/SaveForm.php(60): method_exists(Array, 'getBasePath')

`
seems call method on an array !
after minor modify ,it is ok.

foreach (\Yii::$app->modules as $moduleId => $module) { /* * get module base path */ if (!is_array($module) && method_exists($module, 'getBasePath')) { $basePath = $module->getBasePath(); } else {
the $module can be an array config .so check it first . or you can use is_object ^_^

@schmunk42
Copy link
Owner

Which PHP Version are you running?

@yiqing95
Copy link

yiqing95 commented May 5, 2023

php8.2

@handcode
Copy link
Contributor

Isn't this already fixed in d64e07b ?

@ajpgtech
Copy link

ajpgtech commented Oct 19, 2023

php8.2

8,1 for me - same issue - same line
Using @dev version
PHP 8.1
Yii 2.0.45

Live edit of the above mentioned commit worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants