for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/**
* ReportingCloud PHP Wrapper
*
* PHP wrapper for ReportingCloud Web API. Authored and supported by Text Control GmbH.
* @link https://www.reporting.cloud to learn more about ReportingCloud
* @link https://github.com/TextControl/txtextcontrol-reportingcloud-php for the canonical source repository
* @license https://raw.githubusercontent.com/TextControl/txtextcontrol-reportingcloud-php/master/LICENSE.md
* @copyright © 2019 Text Control GmbH
*/
namespace TxTextControl\ReportingCloud\Assert;
* Trait AssertTemplateFormatTrait
* @package TxTextControl\ReportingCloud
trait AssertTemplateFormatTrait
{
* Validate template format
* @param string $value
* @param string $message
* @return null
public static function assertTemplateFormat(string $value, string $message = '')
$ucValue = strtoupper($value);
$format = '%s contains an unsupported template format file extension';
$message = sprintf($message ?: $format, static::valueToString($value));
return static::oneOf($ucValue, static::getTemplateFormats(), $message);
}