for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Shrikeh\PagerDuty\Entity\ContactMethod;
use Psr\Http\Message\UriInterface;
use Shrikeh\PagerDuty\Entity\ContactMethod as ContactMethodInterface;
final class ContactMethod implements ContactMethodInterface
{
private $resource;
private $self;
private $summary;
private $label;
public static function fromApi(
Resource $resource,
UriInterface $self,
$summary,
$label
) {
return new static(
$resource,
$label,
$self
);
}
private function __construct(
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
UriInterface $self = null
$this->resource = $resource;
$this->self = $self;
$this->summary = $summary;
public function __toString()
return (string) $this->resource();
public function method()
return $this->resource()->type();
public function resource()
return $this->resource;
public function summary()
return $this->summary;
public function self()
return $this->self;
public function label()
return $this->label;
public function blacklisted()
return $this->blacklisted;
blacklisted
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.