laravel / socialite

Laravel wrapper around OAuth 1 & OAuth 2 libraries.

Home Page:https://laravel.com/docs/socialite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creation of dynamic property `Laravel\Socialite\SocialiteManager::$app` is deprecated

flexchar opened this issue · comments

commented
  • Socialite Version: 5.6.0
  • Laravel Version: 9.48.0
  • PHP Version: 8.2.0

Description:

Going through the logs I've noticed a spam of deprecation warnings

local.WARNING: Creation of dynamic property Laravel\Socialite\SocialiteManager::$app is deprecated in /var/www/vendor/laravel/socialite/src/SocialiteManager.php on line 214  

The PHP code surrounding the issue

/**
* Set the container instance used by the manager.
*
* @param  \Illuminate\Contracts\Container\Container  $container
* @return $this
*/
public function setContainer($container)
{
    $this->app = $container;
    $this->container = $container;

    return $this;
}

It seems to me that the package misuses $container and $app interchangeably whilst referring to the same actual value. Purging/updating all references to $this->container might be all that's missing. :-)

If you agree, @driesvints, I'd gladly submit a PR tomorrow (CET).

Steps To Reproduce:

  1. laravel new app
  2. composer require laravel/socialite
  3. Run the web server (I'm using octane)

Thanks for reporting! It's best that we add the property instead as some people might still rely on it. I've sent in a PR: #621