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

Issue with declaring bindings and singletons properties #52286

Closed
manavo opened this issue Jul 26, 2024 · 2 comments
Closed

Issue with declaring bindings and singletons properties #52286

manavo opened this issue Jul 26, 2024 · 2 comments

Comments

@manavo
Copy link
Contributor

manavo commented Jul 26, 2024

Laravel Version

11.18.0

PHP Version

8.3.7

Database Driver & Version

No response

Description

The commit ed28a45 seems to be creating an issue.

When they are magic properties, there is some wiggle-room for how they get defined. For example, in SquirePHP it gets defined with the data-type of array: https://github.com/squirephp/repository/blob/3.x/src/RepositoryServiceProvider.php

So this accidentally becomes a backward incompatible change unfortunately.

Steps To Reproduce

  • laravel new bug-report --github="--public"
  • composer require squirephp/countries-en

This results in the error:

PHP Fatal error:  Type of Squire\RepositoryServiceProvider::$singletons must not be defined (as in class Illuminate\Support\ServiceProvider) in /Users/manavo/Code/laravel-bug/bug-report/vendor/squirephp/repository/src/RepositoryServiceProvider.php on line 7

In RepositoryServiceProvider.php line 7:
                                                                                                                              
  Type of Squire\RepositoryServiceProvider::$singletons must not be defined (as in class Illuminate\Support\ServiceProvider) 
@manavo manavo changed the title Issue with declaring bindings and singletons Issue with declaring bindings and singletons properties Jul 26, 2024
@driesvints
Copy link
Member

I'm gonna revert this one. Thanks for reporting

@manavo
Copy link
Contributor Author

manavo commented Jul 26, 2024

Thanks @driesvints!

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

2 participants