/var/www/vhosts/ihelp.ro/httpdocs/vendor/mirko-pagliai/php-tools/src
NameSizeModeActions
Event/-0755rm
Exception/-0755rm
TestSuite/-0755rm
array_functions.php48230644editdlrm
BodyParser.php25580644editdlrm
debug_functions.php23200644editdlrm
deprecation_functions.php15630644editdlrm
Entity.php53690644editdlrm
Exceptionist.php158640644editdlrm
Filesystem.php130930644editdlrm
global_functions.php69880644editdlrm
network_functions.php32640644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/mirko-pagliai/php-tools/src/global_functions.php (6988B)
getShortName(); } } if (!function_exists('is_html')) { /** * Checks if a string is HTML * @param string $string String * @return bool * @since 1.1.13 */ function is_html(string $string): bool { return strcasecmp($string, strip_tags($string)) !== 0; } } if (!function_exists('is_json')) { /** * Checks if a string is JSON * @param string $string String * @return bool * @deprecated 1.7.4 Use instead `json_validate()` */ function is_json(string $string): bool { deprecationWarning('Deprecated. Use instead `json_validate()`'); return json_validate($string); } } if (!function_exists('is_positive')) { /** * Checks if a string is a positive number * @param float|string|int $string String * @return bool */ function is_positive($string): bool { return is_numeric($string) && $string > 0 && $string == round((float)$string); } } if (!function_exists('is_stringable')) { /** * Checks is a value can be converted to string. * * Arrays that can be converted to strings with `array_to_string ()` are stringable. * @param mixed $var A var you want to check * @return bool * @since 1.2.5 */ function is_stringable($var): bool { if (is_array($var)) { try { return (bool)array_to_string($var); } catch (LogicException $e) { return false; } } return !is_null($var) && (is_scalar($var) || method_exists($var, '__toString')); } } if (!function_exists('objects_map')) { /** * Executes an object method for all objects of the given arrays * @param array $objects An array of objects. Each object must have the method to be called * @param string $method The method to be called for each object * @param array $args Optional arguments for the method to be called * @return array Returns an array containing all the returned values of the called method applied to each object * @throws \Tools\Exception\MethodNotExistsException * @deprecated 1.7.4 deprecated, it will be removed in a later release * @since 1.1.11 */ function objects_map(array $objects, string $method, array $args = []): array { deprecationWarning('`objects_map()` is deprecated and will be removed in a later release'); return array_map(fn(object $object) => call_user_func_array(Exceptionist::methodExists($object, $method), $args), $objects); } } if (!function_exists('rtr')) { /** * Fast and convenient alias for `Filesystem::rtr()` * @param string $path Absolute path * @return string Relative path * @throws \ErrorException * @see \Tools\Filesystem::rtr() * @since 1.7.4 */ function rtr(string $path): string { return Filesystem::rtr($path); } } if (!function_exists('slug')) { /** * Gets a slug from a string * @param string $string The string you want to generate the slug from * @param bool $lowerCase With `true` the string will be lowercase * @return string * @see https://symfony.com/doc/current/components/string.html#slugger * @since 1.4.1 */ function slug(string $string, bool $lowerCase = true): string { $slug = (string)(new AsciiSlugger())->slug($string); return $lowerCase ? strtolower($slug) : $slug; } } if (!function_exists('uncamelcase')) { /** * Gets an "uncamelcase" string. * * For example, from `thisIsAString` to `this_is_a_string`. * @param string $string The string you want to uncamelcase * @return string * @since 1.4.2 */ function uncamelcase(string $string): string { return (string)u($string)->snake(); } } if (!function_exists('which')) { /** * Finds the executable of a command, like `which` on Unix systems * @param string $command Command * @return string * @throws \ErrorException * @deprecated 1.7.5 Use instead `Symfony\Component\Process\ExecutableFinder::find()` method * @codeCoverageIgnore */ function which(string $command): string { deprecationWarning('Deprecated. Use instead `' . ExecutableFinder::class . '::find()` method'); return Exceptionist::isTrue((new ExecutableFinder())->find($command) ?: '', 'Unable to find the executable for the `' . $command . '` command'); } }