1) return false; /** * Must be in $allowedValues array */ if (!in_array($errorCorrectionLevel, $allowedValues)) return false; return true; } } if (!function_exists('dropFilesBySubstring')) { /** * Deletes file(s) from a directory * * @param string $directory * @param string $substring */ function dropFilesBySubstring(string $directory, string $substring) : void { $files = scandir($directory); foreach ($files as $file) { if (inString($file, $substring)) { unlink ($directory . $file); } } } } if (!function_exists('startsWith')) { /** * Checks if string starts with substring * * @param string $needle * @param string $haystack * @return bool */ function startsWith (string $needle, string $haystack) : bool { return substr($haystack, 0, strlen($needle)) === $needle; } } if (!function_exists('strSet')) { /** * I have absolutely no idea what this does * * @param array $srctab * @param int $x * @param int $y * @param string $repl * @param bool|int $replLen */ function strSet (array &$srctab, int $x, int $y, string $repl, $replLen = false) : void { $srctab[$y] = substr_replace($srctab[$y], ($replLen !== false) ? substr($repl, 0, $replLen) : $repl, $x, ($replLen !== false) ? $replLen : strlen($repl)); } }