protected static function ensureType($type, $value, $errorMessage)
    {
        if (!($value instanceof $type)) {
            throw new PdfTypeException(
                $errorMessage,
                PdfTypeException::INVALID_DATA_TYPE
            );
        }

        return $value;
    }
protected static function ensureType($type, $value, $errorMessage)
    {
        if (!($value instanceof $type)) {
            throw new PdfTypeException(
                $errorMessage,
                PdfTypeException::INVALID_DATA_TYPE
            );
        }

        return $value;
    }
protected static function ensureType ( $ type , $ value , $ errorMessage ) { if ( ! ( $ value instanceof $ type ) ) { throw new PdfTypeException ( $ errorMessage , PdfTypeException :: INVALID_DATA_TYPE ) ; } return $ value ; }
Ensure that a value is an instance of a specific PDF type.

@param string $type
@param PdfType $value
@param string $errorMessage
@return mixed
@throws PdfTypeException
Ensure that a value is an instance of a specific PDF type .