for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the keinos/mastodon-streaming-api-config package.
*
* - Authors, copyright, license, usage and etc.:
* - See: https://github.com/KEINOS/Mastodon_StreamingAPI_Config/
*/
declare(strict_types=1);
namespace KEINOS\MSTDN_TOOLS;
* Parent class of \KEINOS\MSTDN_TOOLS\ConfigProtectedMethods Class.
* This class only contains static methods.
class ConfigStaticMethods extends ConfigConstants
{
* Checks if the URL protocol is "http:".
* @param string $url
* @return bool
public static function isUrlProtocolHttp(string $url): bool
$target = 'http:';
return ($target === substr($url, 0, strlen($target)));
}
public static function isAlphaNumeric(string $string): bool
// Some server doesn't enable ctype_alnum by default
//return ctype_alnum($string);
return (preg_match('/^[a-zA-Z0-9]+$/', $string) > 0);