Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silenced deprecation errors #568

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function expiresAt($expiration, $replicateAsHeader = false)
private function convertToDate($value)
{
if (! $value instanceof DateTimeImmutable) {
trigger_error('Using integers for registered date claims is deprecated, please use DateTimeImmutable objects instead.', E_USER_DEPRECATED);
@trigger_error('Using integers for registered date claims is deprecated, please use DateTimeImmutable objects instead.', E_USER_DEPRECATED);

return new DateTimeImmutable('@' . $value);
}
Expand Down Expand Up @@ -331,7 +331,7 @@ protected function setRegisteredClaim($name, $value, $replicate)
$this->configureClaim($name, $value);

if ($replicate) {
trigger_error('Replicating claims as headers is deprecated and will removed from v4.0. Please manually set the header if you need it replicated.', E_USER_DEPRECATED);
@trigger_error('Replicating claims as headers is deprecated and will removed from v4.0. Please manually set the header if you need it replicated.', E_USER_DEPRECATED);

$this->headers[$name] = $value;
}
Expand Down Expand Up @@ -412,7 +412,7 @@ private function configureClaim($name, $value)
public function withClaim($name, $value)
{
if (in_array($name, RegisteredClaims::ALL, true)) {
trigger_error('The use of the method "withClaim" is deprecated for registered claims. Please use dedicated method instead.', E_USER_DEPRECATED);
@trigger_error('The use of the method "withClaim" is deprecated for registered claims. Please use dedicated method instead.', E_USER_DEPRECATED);
}

return $this->forwardCallToCorrectClaimMethod($name, $value);
Expand Down Expand Up @@ -468,7 +468,7 @@ public function set($name, $value)
public function sign(Signer $signer, $key)
{
if (! $key instanceof Key) {
trigger_error('Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes.', E_USER_DEPRECATED);
@trigger_error('Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes.', E_USER_DEPRECATED);

$key = new Key($key);
}
Expand Down Expand Up @@ -503,7 +503,7 @@ public function unsign()
public function getToken(Signer $signer = null, Key $key = null)
{
if ($signer === null || $key === null) {
trigger_error('Not specifying the signer and key to Builder#getToken() is deprecated. Please move the arguments from Builder#sign() to Builder#getToken().', E_USER_DEPRECATED);
@trigger_error('Not specifying the signer and key to Builder#getToken() is deprecated. Please move the arguments from Builder#sign() to Builder#getToken().', E_USER_DEPRECATED);
}

$signer = $signer ?: $this->signer;
Expand Down
2 changes: 1 addition & 1 deletion src/Signer/BaseSigner.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function verify($expected, $payload, $key)
private function getKey($key)
{
if (is_string($key)) {
trigger_error('Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes.', E_USER_DEPRECATED);
@trigger_error('Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes.', E_USER_DEPRECATED);

$key = new Key($key);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public function isExpired(DateTimeInterface $now = null)
}

if ($now === null) {
trigger_error('Not providing the current time is deprecated. Please pass an instance of DateTimeInterface.', E_USER_DEPRECATED);
@trigger_error('Not providing the current time is deprecated. Please pass an instance of DateTimeInterface.', E_USER_DEPRECATED);
}

$now = $now ?: new DateTimeImmutable();
Expand Down