for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Swaggest\JsonDiff;
use Swaggest\JsonDiff\JsonPatch\OpPath;
use Throwable;
class InvalidFieldTypeException extends Exception
{
/** @var string */
private $field;
private $expectedType;
/** @var OpPath|object */
private $operation;
/**
* @param string $field
* @param string $expectedType
* @param OpPath|object $operation
* @param int $code
* @param Throwable|null $previous
*/
public function __construct(
$field,
$expectedType,
$operation,
$code = 0,
Throwable $previous = null
)
parent::__construct(
'Invalid field type - "' . $field . '" should be of type: ' . $expectedType,
$code,
$previous
);
$this->field = $field;
$this->expectedType = $expectedType;
$this->operation = $operation;
}
* @return string
public function getField()
return $this->field;
public function getExpectedType()
return $this->expectedType;
* @return OpPath|object
public function getOperation()
return $this->operation;