Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
raziel057 authored Aug 31, 2023
1 parent 5e91141 commit 5c1fc92
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Doctrine/Deprecations/Deprecation.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use function assert;
use function debug_backtrace;
use function sprintf;
use function str_replace;
use function strpos;
use function strrpos;
use function substr;
Expand Down Expand Up @@ -138,7 +139,7 @@ public static function triggerIfCalledFromOutside(string $package, string $link,

// first check that the caller is not from a tests folder, in which case we always let deprecations pass
if (isset($backtrace[1]['file'], $backtrace[0]['file']) && strpos($backtrace[1]['file'], DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR) === false) {
$path = DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . str_replace("/", DIRECTORY_SEPARATOR, $package) . DIRECTORY_SEPARATOR;
$path = DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $package) . DIRECTORY_SEPARATOR;

if (strpos($backtrace[0]['file'], $path) === false) {
return;
Expand Down

0 comments on commit 5c1fc92

Please sign in to comment.