Remove static references

This commit is contained in:
James Cole
2023-10-29 06:33:43 +01:00
parent 075d459b7c
commit 4f2159b54d
205 changed files with 1287 additions and 1287 deletions

View File

@@ -57,7 +57,7 @@ class RemoteUserGuard implements Guard
{
/** @var Request $request */
$request = $app->get('request');
Log::debug(sprintf('Created RemoteUserGuard for %s "%s"', $request?->getMethod(), $request?->getRequestUri()));
app('log')->debug(sprintf('Created RemoteUserGuard for %s "%s"', $request?->getMethod(), $request?->getRequestUri()));
$this->application = $app;
$this->provider = $provider;
$this->user = null;
@@ -68,9 +68,9 @@ class RemoteUserGuard implements Guard
*/
public function authenticate(): void
{
Log::debug(sprintf('Now at %s', __METHOD__));
app('log')->debug(sprintf('Now at %s', __METHOD__));
if (null !== $this->user) {
Log::debug(sprintf('%s is found: #%d, "%s".', get_class($this->user), $this->user->id, $this->user->email));
app('log')->debug(sprintf('%s is found: #%d, "%s".', get_class($this->user), $this->user->id, $this->user->email));
return;
}
@@ -79,7 +79,7 @@ class RemoteUserGuard implements Guard
$userID = request()->server($header) ?? null;
if (function_exists('apache_request_headers')) {
Log::debug('Use apache_request_headers to find user ID.');
app('log')->debug('Use apache_request_headers to find user ID.');
$userID = request()->server($header) ?? apache_request_headers()[$header] ?? null;
}
@@ -88,7 +88,7 @@ class RemoteUserGuard implements Guard
throw new FireflyException('The guard header was unexpectedly empty. See the logs.');
}
Log::debug(sprintf('User ID found in header is "%s"', $userID));
app('log')->debug(sprintf('User ID found in header is "%s"', $userID));
/** @var User $retrievedUser */
$retrievedUser = $this->provider->retrieveById($userID);
@@ -109,7 +109,7 @@ class RemoteUserGuard implements Guard
}
}
Log::debug(sprintf('Result of getting user from provider: %s', $retrievedUser->email));
app('log')->debug(sprintf('Result of getting user from provider: %s', $retrievedUser->email));
$this->user = $retrievedUser;
}
@@ -118,7 +118,7 @@ class RemoteUserGuard implements Guard
*/
public function guest(): bool
{
Log::debug(sprintf('Now at %s', __METHOD__));
app('log')->debug(sprintf('Now at %s', __METHOD__));
return !$this->check();
}
@@ -127,7 +127,7 @@ class RemoteUserGuard implements Guard
*/
public function check(): bool
{
Log::debug(sprintf('Now at %s', __METHOD__));
app('log')->debug(sprintf('Now at %s', __METHOD__));
return !is_null($this->user());
}
@@ -136,10 +136,10 @@ class RemoteUserGuard implements Guard
*/
public function user(): ?User
{
Log::debug(sprintf('Now at %s', __METHOD__));
app('log')->debug(sprintf('Now at %s', __METHOD__));
$user = $this->user;
if (null === $user) {
Log::debug('User is NULL');
app('log')->debug('User is NULL');
return null;
}
@@ -151,7 +151,7 @@ class RemoteUserGuard implements Guard
*/
public function hasUser(): bool
{
Log::debug(sprintf('Now at %s', __METHOD__));
app('log')->debug(sprintf('Now at %s', __METHOD__));
throw new FireflyException('Did not implement RemoteUserGuard::hasUser()');
}
@@ -160,7 +160,7 @@ class RemoteUserGuard implements Guard
*/
public function id(): ?User
{
Log::debug(sprintf('Now at %s', __METHOD__));
app('log')->debug(sprintf('Now at %s', __METHOD__));
return $this->user;
}
@@ -169,7 +169,7 @@ class RemoteUserGuard implements Guard
*/
public function setUser(Authenticatable $user)
{
Log::debug(sprintf('Now at %s', __METHOD__));
app('log')->debug(sprintf('Now at %s', __METHOD__));
$this->user = $user;
}
@@ -178,7 +178,7 @@ class RemoteUserGuard implements Guard
*/
public function validate(array $credentials = [])
{
Log::debug(sprintf('Now at %s', __METHOD__));
app('log')->debug(sprintf('Now at %s', __METHOD__));
throw new FireflyException('Did not implement RemoteUserGuard::validate()');
}
@@ -187,7 +187,7 @@ class RemoteUserGuard implements Guard
*/
public function viaRemember(): bool
{
Log::debug(sprintf('Now at %s', __METHOD__));
app('log')->debug(sprintf('Now at %s', __METHOD__));
return false;
}
}