for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Digia\GraphQL\Type\Definition;
trait DeprecationTrait
{
/**
* @var ?string
*/
?string
0
private $deprecationReason;
* @var bool
private $isDeprecated = false;
* @return null|string
public function getDeprecationReason(): ?string
return $this->deprecationReason;
}
* @return bool
public function isDeprecated(): bool
return $this->isDeprecated;
* @param null|string $deprecationReason
* @return $this
protected function setDeprecationReason(?string $deprecationReason)
if ($deprecationReason) {
$this->isDeprecated = true;
$this->deprecationReason = $deprecationReason;
return $this;
* @param bool $isDeprecated
* @throws \TypeError
public function setIsDeprecated(bool $isDeprecated): void
$isDeprecated
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function setIsDeprecated(/** @scrutinizer ignore-unused */ bool $isDeprecated): void
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
throw new \TypeError('You should provide "deprecationReason" instead of "isDeprecated".');