Skip to content

Commit

Permalink
Revert "[11.x] use promoted properties (#53807)" (#53832)
Browse files Browse the repository at this point in the history
This reverts commit 69b19ceebec7e2cb16ee54c6dfbf082f3d81cee1.
taylorotwell authored Dec 10, 2024
1 parent b04f8f6 commit 177cd25
Showing 4 changed files with 48 additions and 13 deletions.
13 changes: 10 additions & 3 deletions Context/Events/ContextDehydrating.php
Original file line number Diff line number Diff line change
@@ -4,13 +4,20 @@

class ContextDehydrating
{
/**
* The context instance.
*
* @var \Illuminate\Log\Context\Repository
*/
public $context;

/**
* Create a new event instance.
*
* @param \Illuminate\Log\Context\Repository $context
*/
public function __construct(
public $context,
) {
public function __construct($context)
{
$this->context = $context;
}
}
13 changes: 10 additions & 3 deletions Context/Events/ContextHydrated.php
Original file line number Diff line number Diff line change
@@ -4,13 +4,20 @@

class ContextHydrated
{
/**
* The context instance.
*
* @var \Illuminate\Log\Context\Repository
*/
public $context;

/**
* Create a new event instance.
*
* @param \Illuminate\Log\Context\Repository $context
*/
public function __construct(
public $context,
) {
public function __construct($context)
{
$this->context = $context;
}
}
13 changes: 10 additions & 3 deletions LogManager.php
Original file line number Diff line number Diff line change
@@ -30,6 +30,13 @@ class LogManager implements LoggerInterface
{
use ParsesLogConfiguration;

/**
* The application instance.
*
* @var \Illuminate\Contracts\Foundation\Application
*/
protected $app;

/**
* The array of resolved channels.
*
@@ -64,9 +71,9 @@ class LogManager implements LoggerInterface
* @param \Illuminate\Contracts\Foundation\Application $app
* @return void
*/
public function __construct(
protected $app,
) {
public function __construct($app)
{
$this->app = $app;
}

/**
22 changes: 18 additions & 4 deletions Logger.php
Original file line number Diff line number Diff line change
@@ -15,6 +15,20 @@ class Logger implements LoggerInterface
{
use Conditionable;

/**
* The underlying logger implementation.
*
* @var \Psr\Log\LoggerInterface
*/
protected $logger;

/**
* The event dispatcher instance.
*
* @var \Illuminate\Contracts\Events\Dispatcher|null
*/
protected $dispatcher;

/**
* Any context to be added to logs.
*
@@ -29,10 +43,10 @@ class Logger implements LoggerInterface
* @param \Illuminate\Contracts\Events\Dispatcher|null $dispatcher
* @return void
*/
public function __construct(
protected LoggerInterface $logger,
protected ?Dispatcher $dispatcher = null,
) {
public function __construct(LoggerInterface $logger, ?Dispatcher $dispatcher = null)
{
$this->logger = $logger;
$this->dispatcher = $dispatcher;
}

/**

0 comments on commit 177cd25

Please sign in to comment.