Skip to content

Commit

Permalink
feat: add Logger stub
Browse files Browse the repository at this point in the history
  • Loading branch information
canvural committed Jan 22, 2021
1 parent 9a03089 commit 208df29
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ parameters:
- stubs/Contracts/Pagination.stub
- stubs/Contracts/Support.stub
- stubs/Redis/Connection.stub
- stubs/Logger.stub
scopeClass: NunoMaduro\Larastan\Analyser\Scope
universalObjectCratesClasses:
- Illuminate\Http\Request
Expand Down
14 changes: 14 additions & 0 deletions stubs/Logger.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Psr\Log {
interface LoggerInterface {}
}

namespace Illuminate\Log {

/**
* @mixin \Illuminate\Log\LogManager
* @mixin \Monolog\Logger
*/
class Logger implements \Psr\Log\LoggerInterface {}
}
16 changes: 16 additions & 0 deletions tests/Features/Methods/Logger.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace Tests\Features\Methods;

use Monolog\Handler\HandlerInterface;

class Logger
{
/** @phpstan-return HandlerInterface[] */
public function testGetHandlers(\Illuminate\Log\Logger $logger): array
{
return $logger->getHandlers();
}
}

0 comments on commit 208df29

Please sign in to comment.