Assert
extends AbstractAssert
in package
Uses
AssertApiKeyTrait, AssertBase64DataTrait, AssertBaseUriTrait, AssertCultureTrait, AssertDateTimeTrait, AssertDocumentDividerTrait, AssertDocumentExtensionTrait, AssertDocumentThumbnailExtensionTrait, AssertFilenameExistsTrait, AssertImageFormatTrait, AssertLanguageTrait, AssertOneOfTrait, AssertPageTrait, AssertRangeTrait, AssertRemoveTrait, AssertReturnFormatTrait, AssertTemplateExtensionTrait, AssertTemplateFormatTrait, AssertTemplateNameTrait, AssertTimestampTrait, AssertZoomFactorTrait, ValueToStringTrait
Abstract AbstractAssert
This component is based on Webmozart\Assert. See: https://github.com/webmozart/assert
At the time of implementation (March 2019), the above component did not support strict types. Since the ReportingCloud PHP SDK does support strict types, the necessary functions where cherry-picked from Webmozart\Assert, strict typed, and insert into this component.
Table of Contents
Properties
- $apiKeyMaxLength : int
- Maximum length of API key
- $apiKeyMinLength : int
- Minimum length of API key
- $pageMax : int
- Maximum page number (PHP_INT_MAX)
- $pageMin : int
- Minimum page number
- $timestampMax : int
- Maximum timestamp (PHP_INT_MAX)
- $timestampMin : int
- Minimum timestamp (EPOC)
- $zoomFactorMax : int
- Maximum zoom factor
- $zoomFactorMin : int
- Minimum zoom factor
Methods
- assertApiKey() : void
- Check value is a syntactically valid API key
- assertBase64Data() : void
- Check value is valid base64 encoded data
- assertBaseUri() : void
- Check value is a known base URI
- assertCulture() : void
- Check value is a valid culture
- assertDateTime() : void
- Check value is a valid DateTime string
- assertDocumentDivider() : void
- Check value is a valid document divider
- assertDocumentExtension() : void
- Check value is a valid document format extension
- assertDocumentThumbnailExtension() : void
- Check value is a valid document thumbnail format extension
- assertFilenameExists() : void
- Check filename exists and is readable
- assertImageFormat() : void
- Check value is valid image format extension
- assertLanguage() : void
- Check value is a valid language
- assertOneOf() : void
- Check value is in values
- assertPage() : void
- Check value is a valid page number
- assertRange() : void
- Check value is in range min..max
- assertRemove() : void
- Check value is a "remove_*" value
- assertReturnFormat() : void
- Check value is a valid return format extension
- assertTemplateExtension() : void
- Check value is a valid template extension
- assertTemplateFormat() : void
- Check value is a valid template format
- assertTemplateName() : void
- Check value is a valid template name
- assertTimestamp() : void
- Check value is a valid timestamp
- assertZoomFactor() : void
- Check value is a valid zoom factor
- getCulturesFilename() : string
- Return the filename, containing cultures array
- getDictionariesFilename() : string
- Return the filename, containing languages aka dictionaries array
- valueToString() : string
- Convert value to string
- getCultures() : array<string|int, mixed>
- Return cultures array
- getDateTimeLength() : int
- Get the length of the required dateTime string
- getDictionaries() : array<string|int, mixed>
- Return languages aka dictionaries array
- getDocumentDividers() : array<string|int, mixed>
- Return document dividers array
Properties
$apiKeyMaxLength
Maximum length of API key
private
static int
$apiKeyMaxLength
= 45
$apiKeyMinLength
Minimum length of API key
private
static int
$apiKeyMinLength
= 20
$pageMax
Maximum page number (PHP_INT_MAX)
private
static int
$pageMax
= PHP_INT_MAX
$pageMin
Minimum page number
private
static int
$pageMin
= 1
$timestampMax
Maximum timestamp (PHP_INT_MAX)
private
static int
$timestampMax
= PHP_INT_MAX
$timestampMin
Minimum timestamp (EPOC)
private
static int
$timestampMin
= 0
$zoomFactorMax
Maximum zoom factor
private
static int
$zoomFactorMax
= 400
$zoomFactorMin
Minimum zoom factor
private
static int
$zoomFactorMin
= 1
Methods
assertApiKey()
Check value is a syntactically valid API key
public
static assertApiKey(string $value[, string $message = '' ]) : void
Parameters
- $value : string
- $message : string = ''
assertBase64Data()
Check value is valid base64 encoded data
public
static assertBase64Data(string $value[, string $message = '' ]) : void
Parameters
- $value : string
- $message : string = ''
assertBaseUri()
Check value is a known base URI
public
static assertBaseUri(string $value[, string $message = '' ]) : void
Parameters
- $value : string
- $message : string = ''
assertCulture()
Check value is a valid culture
public
static assertCulture(string $value[, string $message = '' ]) : void
Parameters
- $value : string
- $message : string = ''
assertDateTime()
Check value is a valid DateTime string
public
static assertDateTime(string $value[, string $message = '' ]) : void
Parameters
- $value : string
- $message : string = ''
assertDocumentDivider()
Check value is a valid document divider
public
static assertDocumentDivider(int $value[, string $message = '' ]) : void
Parameters
- $value : int
- $message : string = ''
assertDocumentExtension()
Check value is a valid document format extension
public
static assertDocumentExtension(string $value[, string $message = '' ]) : void
Parameters
- $value : string
- $message : string = ''
assertDocumentThumbnailExtension()
Check value is a valid document thumbnail format extension
public
static assertDocumentThumbnailExtension(string $value[, string $message = '' ]) : void
This is a special case assert method that is used only by TextControl\ReportingCloud\ReportingCloud::getDocumentThumbnails() as this method additionally accepts files in XLSX format. No other methods do.
Parameters
- $value : string
- $message : string = ''
assertFilenameExists()
Check filename exists and is readable
public
static assertFilenameExists(string $value[, string $message = '' ]) : void
Parameters
- $value : string
- $message : string = ''
assertImageFormat()
Check value is valid image format extension
public
static assertImageFormat(string $value[, string $message = '' ]) : void
Parameters
- $value : string
- $message : string = ''
assertLanguage()
Check value is a valid language
public
static assertLanguage(string $value[, string $message = '' ]) : void
Parameters
- $value : string
- $message : string = ''
assertOneOf()
Check value is in values
public
static assertOneOf(mixed $value, array<string|int, mixed> $values[, string $message = '' ]) : void
Parameters
- $value : mixed
- $values : array<string|int, mixed>
- $message : string = ''
assertPage()
Check value is a valid page number
public
static assertPage(int $value[, string $message = '' ]) : void
Parameters
- $value : int
- $message : string = ''
assertRange()
Check value is in range min..max
public
static assertRange(int $value, int $min, int $max[, string $message = '' ]) : void
Parameters
- $value : int
- $min : int
- $max : int
- $message : string = ''
assertRemove()
Check value is a "remove_*" value
public
static assertRemove(mixed $value[, string $message = '' ]) : void
Parameters
- $value : mixed
- $message : string = ''
assertReturnFormat()
Check value is a valid return format extension
public
static assertReturnFormat(string $value[, string $message = '' ]) : void
Parameters
- $value : string
- $message : string = ''
assertTemplateExtension()
Check value is a valid template extension
public
static assertTemplateExtension(string $value[, string $message = '' ]) : void
Parameters
- $value : string
- $message : string = ''
assertTemplateFormat()
Check value is a valid template format
public
static assertTemplateFormat(string $value[, string $message = '' ]) : void
Parameters
- $value : string
- $message : string = ''
assertTemplateName()
Check value is a valid template name
public
static assertTemplateName(string $value[, string $message = '' ]) : void
Parameters
- $value : string
- $message : string = ''
assertTimestamp()
Check value is a valid timestamp
public
static assertTimestamp(int $value[, string $message = '' ]) : void
Parameters
- $value : int
- $message : string = ''
assertZoomFactor()
Check value is a valid zoom factor
public
static assertZoomFactor(int $value[, string $message = '' ]) : void
Parameters
- $value : int
- $message : string = ''
getCulturesFilename()
Return the filename, containing cultures array
public
static getCulturesFilename() : string
Return values
stringgetDictionariesFilename()
Return the filename, containing languages aka dictionaries array
public
static getDictionariesFilename() : string
Return values
stringvalueToString()
Convert value to string
protected
static valueToString(mixed $value) : string
Parameters
- $value : mixed
Return values
stringgetCultures()
Return cultures array
private
static getCultures() : array<string|int, mixed>
Return values
array<string|int, mixed>getDateTimeLength()
Get the length of the required dateTime string
private
static getDateTimeLength() : int
Return values
intgetDictionaries()
Return languages aka dictionaries array
private
static getDictionaries() : array<string|int, mixed>
Return values
array<string|int, mixed>getDocumentDividers()
Return document dividers array
private
static getDocumentDividers() : array<string|int, mixed>