Skip to content

Commit 2c80d6d

Browse files
authored
Merge pull request #214 from php-enqueue/fs-do-not-throw-error-on-user-deprecate
Fs do not throw error on user deprecate
2 parents 0fb21b3 + f3c802c commit 2c80d6d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ matrix:
1616
- php: 7.0
1717
env: SYMFONY_VERSION=2.8.* UNIT_TESTS=true
1818
- php: 5.6
19-
env: SYMFONY_VERSION=3.0.* UNIT_TESTS=true SYMFONY_DEPRECATIONS_HELPER=weak
19+
env: SYMFONY_VERSION=3.0.* UNIT_TESTS=true
2020
- php: 7.0
21-
env: SYMFONY_VERSION=3.0.* UNIT_TESTS=true SYMFONY_DEPRECATIONS_HELPER=weak
21+
env: SYMFONY_VERSION=3.0.* UNIT_TESTS=true
2222
- php: 7.1
2323
services: docker
2424
env: SYMFONY_VERSION=2.8.* FUNCTIONAL_TESTS=true

pkg/fs/FsContext.php

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Enqueue\Fs;
44

5+
use Doctrine\ORM\Cache\Lock;
56
use Interop\Queue\InvalidDestinationException;
67
use Interop\Queue\PsrContext;
78
use Interop\Queue\PsrDestination;
@@ -94,6 +95,11 @@ public function declareDestination(PsrDestination $destination)
9495
InvalidDestinationException::assertDestinationInstanceOf($destination, FsDestination::class);
9596

9697
set_error_handler(function ($severity, $message, $file, $line) {
98+
// do not throw on a deprecation notice.
99+
if (E_USER_DEPRECATED === $severity && false !== strpos($message, LockHandler::class)) {
100+
return;
101+
}
102+
97103
throw new \ErrorException($message, 0, $severity, $file, $line);
98104
});
99105

0 commit comments

Comments
 (0)