Source of file HasFunctionCheck.php
Size: 0,834 Bytes - Last Modified: 2021-12-23T10:30:03+00:00
/var/www/docs.ssmods.com/process/src/src/Checks/HasFunctionCheck.php
12345678910111213141516171819202122232425262728293031323334353637383940 | <?php namespace SilverStripe\EnvironmentCheck\Checks; use SilverStripe\EnvironmentCheck\EnvironmentCheck; /** * Check that the given function exists. * * @package environmentcheck */ class HasFunctionCheck implements EnvironmentCheck { /** * @var string */ protected $functionName; /** * @param string $functionName The name of the function to look for. */ public function __construct($functionName) { $this->functionName = $functionName; } /** * {@inheritDoc} * * @return array */ public function check() { if (function_exists($this->functionName)) { return [EnvironmentCheck::OK, $this->functionName . '() exists']; } return [EnvironmentCheck::ERROR, $this->functionName . '() doesn\'t exist']; } } |