for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Joli\Jane\OpenApi\Operation;
use Joli\Jane\OpenApi\Model\Operation as OpenApiOperation;
class Operation
{
const DELETE = 'DELETE';
const GET = 'GET';
const POST = 'POST';
const PUT = 'PUT';
const PATCH = 'PATCH';
const OPTIONS = 'OPTIONS';
const HEAD = 'HEAD';
/**
* @var \Joli\Jane\OpenApi\Model\Operation
*/
private $operation;
* @var string
private $path;
private $method;
private $reference;
public function __construct(OpenApiOperation $operation, $path, $method, $reference, $basePath = "", $host = 'localhost')
$this->operation = $operation;
$this->path = preg_replace('#^/+#', '/', $basePath . $path);
$this->method = $method;
$this->host = $host;
host
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->reference = $reference;
}
* @return string
public function getMethod()
return $this->method;
* @return \Joli\Jane\OpenApi\Model\Operation
public function getOperation()
return $this->operation;
public function getPath()
return $this->path;
public function getHost()
return $this->host;
public function getReference()
return $this->reference;
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: