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

Laravel执行安装后post-autoload-dump报错 #69

Open
czhou opened this issue Sep 30, 2024 · 6 comments
Open

Laravel执行安装后post-autoload-dump报错 #69

czhou opened this issue Sep 30, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@czhou
Copy link

czhou commented Sep 30, 2024

Describe the bug
执行 composer require guanguans/laravel-exception-notify --ansi -v 后:

Generating optimized autoload files
post-autoload-dump: Illuminate\Foundation\ComposerScripts::postAutoloadDump
PHP Fatal error: Cannot redeclare make() (previously declared in /var/www/html/vendor/guanguans/laravel-exception-notify/src/Support/helpers.php:28) in /var/www/html/tests/helpers.php on line 10

Fatal error: Cannot redeclare make() (previously declared in /var/www/html/vendor/guanguans/laravel-exception-notify/src/Support/helpers.php:28) in /var/www/html/tests/helpers.php on line 10

Additional context
Laravel:v8.83.27
PHP: v8.1
laravel-exception-notify: v4.5.1

@czhou czhou added the bug Something isn't working label Sep 30, 2024
Copy link

@Issues-translate-bot
Copy link

Issues-translate-bot commented Sep 30, 2024

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


Branch [issue-69-Laravel post-autoload-dump error after execution of installation](https://github.com/guanguans/laravel-exception-notify/tree/issue-69-Laravel post-autoload-dump error after execution of installation ) created!

GitHub
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.

@czhou
Copy link
Author

czhou commented Sep 30, 2024

找到原因了,因为我在我的单元测试辅助脚本中定义了一个make函数,所以和你的包中同名make函数冲突了。
image

但是这个问题是不是你们也应该修改一下,make这个函数名还是比较容易起冲突的...
image

@Issues-translate-bot
Copy link

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


I found the reason. Because I defined a make function in my unit test auxiliary script, it conflicts with the make function of the same name in your package.
image

But should you also modify this issue? The function name make is still relatively easy to cause conflicts...
image

@guanguans
Copy link
Owner

@czhou 我先记下,等下一个大版本处理。你那边测试专用的先加上测试的命名空间。

@Issues-translate-bot
Copy link

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


@czhou I will note it down first and wait for the next major version to deal with it. For your testing purpose, first add the test namespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants