for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace kalanis\kw_mime\Check\Traits;
use kalanis\kw_mime\MimeException;
/**
* Trait TCheckCalls
* @package kalanis\kw_mime\Check\Traits
* Check some parts of the system - some things might not be available on selected instance
*/
trait TCheckCalls
{
use TLang;
* @throws MimeException
public function checkMimeClass(): void
if (!$this->isMimeClass()) {
// @codeCoverageIgnoreStart
throw new MimeException($this->getMiLang()->miNoClass());
}
// @codeCoverageIgnoreEnd
public function isMimeClass(): bool
return class_exists('\finfo');
public function checkMimeMethod(): void
if (!$this->isMimeMethod()) {
throw new MimeException($this->getMiLang()->miNoMethod());
public function isMimeMethod(): bool
return method_exists('\finfo', 'buffer');
public function checkMimeFunction(): void
if (!$this->isMimeFunction()) {
throw new MimeException($this->getMiLang()->miNoFunction());
protected function isMimeFunction(): bool
return function_exists('mime_content_type');