Skip to content

Commit

Permalink
Fix facade::$app could be nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
erikn69 authored Feb 29, 2024
1 parent 07ffb36 commit 530c5b4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Facade/Pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Barryvdh\DomPDF\PDF as BasePDF;
use Illuminate\Support\Facades\Facade as IlluminateFacade;
use RuntimeException;

/**
* @method static BasePDF setBaseHost(string $baseHost)
Expand Down Expand Up @@ -47,9 +48,15 @@ protected static function getFacadeAccessor()
* @param string $method
* @param array<mixed> $args
* @return mixed
*
* @throws \RuntimeException
*/
public static function __callStatic($method, $args)
{
if (! static::$app) {

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P8 - L8.* - prefer-stable

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P8 - L7.* - prefer-stable

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P8 - L6.* - prefer-stable

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P7.4 - L8.* - prefer-lowest

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P7.4 - L8.* - prefer-stable

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P7.4 - L7.* - prefer-lowest

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P7.4 - L7.* - prefer-stable

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P7.4 - L6.* - prefer-lowest

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P7.4 - L6.* - prefer-stable

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P7.3 - L8.* - prefer-lowest

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P7.3 - L8.* - prefer-stable

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P7.3 - L7.* - prefer-lowest

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P7.3 - L7.* - prefer-stable

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P7.3 - L6.* - prefer-lowest

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P7.3 - L6.* - prefer-stable

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P7.2 - L7.* - prefer-lowest

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P7.2 - L7.* - prefer-stable

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P7.2 - L6.* - prefer-lowest

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P7.2 - L6.* - prefer-stable

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P8.3 - L11.* - prefer-stable

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P8.2 - L11.* - prefer-stable

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P8.2 - L9.* - prefer-stable

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P8.1 - L9.* - prefer-stable

Negated boolean expression is always false.

Check failure on line 56 in src/Facade/Pdf.php

View workflow job for this annotation

GitHub Actions / P8 - L9.* - prefer-stable

Negated boolean expression is always false.
throw new RuntimeException('Facade application has not been set.');
}

$instance = static::$app->make(static::getFacadeAccessor());

return $instance->$method(...$args);
Expand Down

0 comments on commit 530c5b4

Please sign in to comment.