repo stringlengths 7 63 | file_url stringlengths 81 284 | file_path stringlengths 5 200 | content stringlengths 0 32.8k | language stringclasses 1 value | license stringclasses 7 values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:02:33 2026-01-05 05:24:06 | truncated bool 2 classes |
|---|---|---|---|---|---|---|---|---|
RikudouSage/GogDownloader | https://github.com/RikudouSage/GogDownloader/blob/51828fd0d673e8f167e9baaf8636718b27a66950/src/Command/DownloadCloudSavesCommand.php | src/Command/DownloadCloudSavesCommand.php | <?php
namespace App\Command;
use App\DTO\GameDetail;
use App\DTO\OwnedItemInfo;
use App\Enum\MediaType;
use App\Enum\NamingConvention;
use App\Enum\Setting;
use App\Service\CloudSavesManager;
use App\Service\FileWriter\FileWriterLocator;
use App\Service\OwnedItemsManager;
use App\Service\Persistence\PersistenceManager;
use App\Service\RetryService;
use App\Trait\MigrationCheckerTrait;
use App\Trait\TargetDirectoryTrait;
use Rikudou\Iterables\Iterables;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Throwable;
#[AsCommand('download-saves', description: 'Download cloud saves for your games', aliases: ['saves'])]
final class DownloadCloudSavesCommand extends Command
{
use TargetDirectoryTrait;
use MigrationCheckerTrait;
public function __construct(
private readonly CloudSavesManager $cloudSaves,
private readonly PersistenceManager $persistence,
private readonly OwnedItemsManager $ownedItemsManager,
private readonly RetryService $retryService,
private readonly FileWriterLocator $writerLocator,
private readonly HttpClientInterface $httpClient,
) {
parent::__construct();
}
protected function configure(): void
{
$this
->addArgument(
'directory',
InputArgument::OPTIONAL,
'The target directory.',
)
->addOption(
'no-verify',
null,
InputOption::VALUE_NONE,
'Set this flag to disable verification of file content before downloading. Disables resuming of downloads.'
)
->addOption(
'update',
'u',
InputOption::VALUE_NONE,
"If you specify this flag the local database will be updated before each download and you don't need to update it separately"
)
->addOption(
'retry',
null,
InputOption::VALUE_REQUIRED,
'How many times should the download be retried in case of failure.',
3,
)
->addOption(
'retry-delay',
null,
InputOption::VALUE_REQUIRED,
'The delay in seconds between each retry.',
1,
)
->addOption(
'skip-errors',
null,
InputOption::VALUE_NONE,
"Skip saves that for whatever reason couldn't be downloaded"
)
->addOption(
'idle-timeout',
null,
InputOption::VALUE_REQUIRED,
'Set the idle timeout in seconds for http requests',
3,
)
;
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$this->showInfoIfMigrationsAreNeeded($io, $this->persistence);
if ($this->persistence->getSetting(Setting::NamingConvention) === NamingConvention::Custom->value) {
$io->warning("You're using the deprecated custom naming convention for game directories. To migrate your game directory to the new naming convention, please use the command 'migrate-naming-scheme'.");
}
$noVerify = $input->getOption('no-verify');
$update = $input->getOption('update');
$retryCount = $input->getOption('retry');
$retryDelay = $input->getOption('retry-delay');
$skipErrors = $input->getOption('skip-errors');
$timeout = $input->getOption('idle-timeout');
$games = $input->getOption('update')
? Iterables::filter(Iterables::map(
function (OwnedItemInfo $info) use ($timeout, $output): GameDetail {
if ($output->isVerbose()) {
$output->writeln("Updating metadata for {$info->getTitle()}...");
}
return $this->ownedItemsManager->getItemDetail($info, $timeout);
},
$this->ownedItemsManager->getOwnedItems(MediaType::Game, httpTimeout: $timeout),
))
: $this->ownedItemsManager->getLocalGameData();
foreach ($games as $game) {
if (!$this->cloudSaves->supports($game)) {
continue;
}
try {
$this->retryService->retry(function () use ($noVerify, $input, $io, $game) {
$progress = $io->createProgressBar();
$format = ' %current% / %max% [%bar%] %percent:3s%% - %message%';
$progress->setFormat($format);
$progress->setMessage("[{$game->title}] Fetching file list");
$saves = $this->cloudSaves->getGameSaves($game);
$progress->setMaxSteps(count($saves));
if (!count($saves)) {
if ($io->isVerbose()) {
$io->writeln("[{$game->title}] Skipping, because no save files were found");
}
return;
}
$targetDirectory = $this->getTargetDir($input, $game, subdirectory: 'SaveFiles');
$writer = $this->writerLocator->getWriter($targetDirectory);
if (!$writer->exists($targetDirectory)) {
$writer->createDirectory($targetDirectory);
}
foreach ($saves as $save) {
$progress->setMessage("[{$game->title}] Downloading {$save->name}");
$filename = "{$targetDirectory}/{$save->name}";
if (!$writer->exists(dirname($filename))) {
$writer->createDirectory(dirname($filename));
}
$targetFile = $writer->getFileReference($filename);
if (!$noVerify && $writer->exists($targetFile)) {
$calculatedMd5 = $writer->getMd5Hash($targetFile);
$calculatedMd5 = $this->persistence->getCompressedHash($calculatedMd5) ?? $calculatedMd5;
if ($calculatedMd5 === $save->hash) {
if ($io->isVerbose()) {
$io->writeln("[{$game->title}] ({$save->name}): Skipping because it exists and is valid", );
}
$progress->advance();
continue;
}
}
if ($writer->exists($targetFile)) {
$writer->remove($targetFile);
}
$content = $this->cloudSaves->downloadSave($save, $game);
if (!$noVerify && $save->hash && $save->hash !== $content->hash) {
$io->warning("[{$game->title}] {$save->name} failed hash check");
} elseif (!$noVerify) {
$this->persistence->storeUncompressedHash($content->hash, md5($content->content));
}
$writer->writeChunk($targetFile, $content->content);
$writer->finalizeWriting($targetFile, $content->hash);
$progress->advance();
}
$progress->finish();
$io->writeln('');
}, $retryCount, $retryDelay);
} catch (Throwable $e) {
if ($skipErrors) {
if ($output->isVerbose()) {
$io->comment("[{$game->title}] Skipping the game because there were errors and --skip-errors is enabled");
}
continue;
}
throw $e;
}
}
$io->success('All configured save files have been downloaded.');
return Command::SUCCESS;
}
}
| php | MIT | 51828fd0d673e8f167e9baaf8636718b27a66950 | 2026-01-05T05:23:42.986854Z | false |
RikudouSage/GogDownloader | https://github.com/RikudouSage/GogDownloader/blob/51828fd0d673e8f167e9baaf8636718b27a66950/src/Command/GamesCommand.php | src/Command/GamesCommand.php | <?php
namespace App\Command;
use App\DTO\GameDetail;
use App\Exception\ExitException;
use App\Service\DownloadManager;
use App\Service\OwnedItemsManager;
use App\Service\Persistence\PersistenceManager;
use App\Trait\MigrationCheckerTrait;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ChoiceQuestion;
use Symfony\Component\Console\Style\SymfonyStyle;
#[AsCommand('games', description: 'Gets details about a game you own, or lists your games.')]
final class GamesCommand extends Command
{
use MigrationCheckerTrait;
public function __construct(
private readonly OwnedItemsManager $ownedItemsManager,
private readonly DownloadManager $downloadManager,
private readonly PersistenceManager $persistence,
) {
parent::__construct();
}
protected function configure(): void
{
$this
->addArgument(
name: 'name',
mode: InputArgument::OPTIONAL,
description: 'The name of the game to get details for',
)
;
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$this->showInfoIfMigrationsAreNeeded($io, $this->persistence);
try {
$gameName = $input->getArgument('name') ?? $this->selectGame($input, $io);
if (!$input->getArgument('name') && $input->isInteractive()) {
$io->note("Tip: Next time you can add \"{$gameName}\" directly as an argument to this command.");
}
if (!$input->isInteractive() && !$gameName) {
$io->writeln(array_map(
fn (GameDetail $detail) => $detail->title,
$this->ownedItemsManager->getLocalGameData(),
));
return Command::SUCCESS;
}
$detail = $this->ownedItemsManager->getGameDetailByTitle($gameName);
if ($detail === null) {
$io->error("Could not find a game with title '{$gameName}' in your local database. Perhaps try running the update command first?");
return Command::FAILURE;
}
$io->table([
'ID', 'Title',
], [
[$detail->id, $detail->title],
]);
$headers = ['Language', 'Platform', 'Name', 'Size', 'MD5', 'URL'];
$rows = [];
foreach ($detail->downloads as $download) {
$rows[] = [
$download->language,
$download->platform,
$download->name,
($download->size / 1024 / 1024) . ' MB',
$download->md5,
$this->downloadManager->getDownloadUrl($download),
];
}
if (!count($rows)) {
$io->warning("The game does not contain any files to download. Perhaps try running the update command first?");
}
$io->table($headers, $rows);
return Command::SUCCESS;
} catch (ExitException $e) {
if ($e->getMessage()) {
$io->error($e->getMessage());
}
return $e->getCode();
}
}
private function selectGame(InputInterface $input, SymfonyStyle $io): ?string
{
$items = $this->ownedItemsManager->getLocalGameData();
if (!count($items)) {
$io->note("You don't have any games available. Perhaps try running the update command first?");
throw new ExitException(code: Command::SUCCESS);
}
$question = (new ChoiceQuestion(
'Please select the game you wish to get details for:',
array_map(fn (GameDetail $detail) => $detail->title, $items),
));
$helper = $this->getHelper('question');
return $helper->ask($input, $io, $question);
}
}
| php | MIT | 51828fd0d673e8f167e9baaf8636718b27a66950 | 2026-01-05T05:23:42.986854Z | false |
RikudouSage/GogDownloader | https://github.com/RikudouSage/GogDownloader/blob/51828fd0d673e8f167e9baaf8636718b27a66950/src/Command/UpdateDatabaseCommand.php | src/Command/UpdateDatabaseCommand.php | <?php
namespace App\Command;
use App\DTO\GameDetail;
use App\DTO\OwnedItemInfo;
use App\DTO\SearchFilter;
use App\Enum\Language;
use App\Enum\MediaType;
use App\Enum\NamingConvention;
use App\Enum\OperatingSystem;
use App\Enum\Setting;
use App\Exception\TooManyRetriesException;
use App\Service\OwnedItemsManager;
use App\Service\Persistence\PersistenceManager;
use App\Service\RetryService;
use App\Trait\EnumExceptionParserTrait;
use App\Trait\MigrationCheckerTrait;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use ValueError;
#[AsCommand('update-database')]
final class UpdateDatabaseCommand extends Command
{
use EnumExceptionParserTrait;
use MigrationCheckerTrait;
public function __construct(
private readonly OwnedItemsManager $ownedItemsManager,
private readonly RetryService $retryService,
private readonly PersistenceManager $persistence,
) {
parent::__construct();
}
protected function configure()
{
$this
->setDescription('Updates the games/files database.')
->addOption(
'new-only',
null,
InputOption::VALUE_NONE,
'Download information only about new games',
)
->addOption(
'updated-only',
'u',
InputOption::VALUE_NONE,
'Download information only about updated games',
)
->addOption(
'clear',
'c',
InputOption::VALUE_NONE,
'Clear local database before updating it',
)
->addOption(
'search',
's',
InputOption::VALUE_REQUIRED,
'Update only games that match the given search',
)
->addOption(
'os',
'o',
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
'Filter by OS, allowed values are: ' . implode(
', ',
array_map(
fn (OperatingSystem $os) => $os->value,
OperatingSystem::cases(),
)
),
)
->addOption(
'language',
'l',
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
'Filter by language, for list of languages run "languages"'
)
->addOption(
'include-hidden',
null,
InputOption::VALUE_NONE,
'Include hidden games in the update',
)
->addOption(
'retry',
null,
InputOption::VALUE_REQUIRED,
'How many times should the download be retried in case of failure.',
3,
)
->addOption(
'retry-delay',
null,
InputOption::VALUE_REQUIRED,
'The delay in seconds between each retry.',
1,
)
->addOption(
'skip-errors',
null,
InputOption::VALUE_NONE,
"Skip games that for whatever reason couldn't be downloaded"
)
->addOption(
'idle-timeout',
null,
InputOption::VALUE_REQUIRED,
'Set the idle timeout in seconds for http requests',
3,
)
->setAliases(['update'])
;
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$this->showInfoIfMigrationsAreNeeded($io, $this->persistence);
if ($this->persistence->getSetting(Setting::NamingConvention) === NamingConvention::Custom->value) {
$io->warning("You're using the deprecated custom naming convention for game directories. To migrate your game directory to the new naming convention, please use the command 'migrate-naming-scheme'.");
}
if ($input->getOption('clear')) {
$this->ownedItemsManager->storeGamesData([]);
}
$storedItems = $this->ownedItemsManager->getLocalGameData();
$storedItemIds = array_map(fn (GameDetail $detail) => $detail->id, $storedItems);
$timeout = $input->getOption('idle-timeout');
try {
$languages = array_map(
fn (string $langCode) => Language::from($langCode),
$input->getOption('language'),
);
} catch (ValueError $e) {
$invalid = $this->getInvalidOption($e);
$io->error(
$invalid
? 'Some of the languages you provided are not valid'
: "The language '{$invalid}' is not a supported language'"
);
return Command::FAILURE;
}
try {
$operatingSystems = array_map(
fn (string $operatingSystem) => OperatingSystem::from($operatingSystem),
$input->getOption('os'),
);
} catch (ValueError $e) {
$invalid = $this->getInvalidOption($e);
$io->error(
$invalid
? 'Some of the operating systems you provided are not valid'
: "The operating system '{$invalid}' is not a valid operating system"
);
return Command::FAILURE;
}
$filter = new SearchFilter(
operatingSystems: $operatingSystems,
languages: $languages,
search: $input->getOption('search'),
includeHidden: $input->getOption('include-hidden'),
);
foreach ($this->getTypes($input) as $type) {
$items = $this->ownedItemsManager->getOwnedItems(
mediaType: $type,
filter: $filter,
productsCount: $count,
httpTimeout: $timeout,
);
if ($input->getOption('new-only')) {
$items = array_filter([...$items], fn (OwnedItemInfo $item) => !in_array($item->getId(), $storedItemIds));
$count = count($items);
}
if ($input->getOption('updated-only')) {
$items = array_filter([...$items], function (OwnedItemInfo $item) use ($storedItemIds) {
return $item->hasUpdates() || !in_array($item->getId(), $storedItemIds);
});
$count = count($items);
}
$progressBar = null;
foreach ($items as $item) {
try {
$this->retryService->retry(function () use ($item, $count, $io, &$progressBar) {
if ($progressBar === null) {
$progressBar = $io->createProgressBar($count);
$progressBar->setFormat(
' %current%/%max% [%bar%] %percent:3s%% - %message%'
);
$progressBar->setMessage($item->getTitle());
$progressBar->advance();
}
$progressBar->setMessage($item->getTitle());
$detail = $this->ownedItemsManager->getItemDetail($item, cached: false);
if ($detail !== null) {
$this->ownedItemsManager->storeSingleGameData($detail);
}
$progressBar->advance();
}, $input->getOption('retry'), $input->getOption('retry-delay'));
} catch (TooManyRetriesException $e) {
if (!$input->getOption('skip-errors')) {
if (!count($e->exceptions)) {
throw $e;
}
throw $e->exceptions[array_key_last($e->exceptions)];
}
$io->note("{$item->getTitle()} couldn't be downloaded");
}
}
$progressBar?->finish();
}
$io->success('Local data successfully updated');
return self::SUCCESS;
}
/**
* @return array<MediaType>
*/
private function getTypes(InputInterface $input): array
{
//$games = $input->getOption('games');
//$movies = $input->getOption('movies');
//
$result = [];
//
//if ($games) {
// $result[] = MediaType::Game;
//}
//if ($movies) {
// $result[] = MediaType::Movie;
//}
//
if (!count($result)) {
$result = [MediaType::Game/*MediaType::Movie*/];
}
return $result;
}
}
| php | MIT | 51828fd0d673e8f167e9baaf8636718b27a66950 | 2026-01-05T05:23:42.986854Z | false |
RikudouSage/GogDownloader | https://github.com/RikudouSage/GogDownloader/blob/51828fd0d673e8f167e9baaf8636718b27a66950/bin/app.php | bin/app.php | #!/usr/bin/env php
<?php
use App\AppKernel;
use Symfony\Component\Console\Application;
require_once __DIR__ . "/../vendor/autoload.php";
$kernel = new AppKernel("cli", $_ENV['GOG_DOWNLOADER_DEBUG'] ?? false);
$kernel->boot();
$container = $kernel->getContainer();
$application = $container->get(Application::class);
assert($application instanceof Application);
$application->setName('gog-downloader');
$application->setVersion(
file_exists(__DIR__ . '/appversion')
? trim(file_get_contents(__DIR__ . '/appversion'))
: 'dev-version',
);
$application->run();
| php | MIT | 51828fd0d673e8f167e9baaf8636718b27a66950 | 2026-01-05T05:23:42.986854Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/bootstrap/middleware.php | bootstrap/middleware.php | <?php
use CliFyi\Middleware\GoogleAnalyticsMiddleware;
use CliFyi\Middleware\TrailingSlash;
use RKA\Middleware\IpAddress;
$app->add(new TrailingSlash());
$app->add(new IpAddress());
if ($googleAnalyticsId = getenv('GOOGLE_ANALYTICS_ID')) {
$app->add(GoogleAnalyticsMiddleware::class);
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/bootstrap/dependencies.php | bootstrap/dependencies.php | <?php
use CliFyi\ErrorHandler\ErrorHandler;
use CliFyi\Middleware\GoogleAnalyticsMiddleware;
use CliFyi\Service\CryptoCurrency\CryptoComparePriceFetcher;
use CliFyi\Service\Hash\HasherInterface;
use CliFyi\Service\Hash\HasherService;
use GuzzleHttp\Client as HttpClient;
use GuzzleHttp\ClientInterface;
use Monolog\Handler\RotatingFileHandler;
use Monolog\Logger;
use Predis\Client;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LoggerInterface;
use Psr\SimpleCache\CacheInterface;
use CliFyi\Cache\RedisAdapter;
return [
RequestInterface::class => \DI\get('request'),
ResponseInterface::class => \DI\get('response'),
Client::class => function () {
return new Client([
'scheme' => 'tcp',
'host' => getenv('REDIS_HOST'),
'port' => getenv('REDIS_PORT'),
]);
},
ClientInterface::class => \DI\object(HttpClient::class),
LoggerInterface::class => function () {
return (new Logger('Cli.Fyi Log'))
->pushHandler(new RotatingFileHandler(__DIR__ . '/../logs/logs.log', 30, Logger::INFO));
},
RedisAdapter::class => \DI\object(RedisAdapter::class)->constructor(\DI\get(Client::class)),
CacheInterface::class => \DI\object(RedisAdapter::class),
CryptoComparePriceFetcher::class => \DI\object()->constructor(\DI\get(HttpClient::class)),
'errorHandler' => \DI\object(ErrorHandler::class)
->constructor(\DI\get(LoggerInterface::class), getenv('DEBUG_MODE')),
'phpErrorHandler' => \DI\object(ErrorHandler::class)
->constructor(\DI\get(LoggerInterface::class), getenv('DEBUG_MODE')),
GoogleAnalyticsMiddleware::class => \DI\object()->constructor(
\DI\get(ClientInterface::class), \DI\get(LoggerInterface::class),
\DI\object(\CliFyi\Service\UuidGenerator::class), getenv('GOOGLE_ANALYTICS_ID')
),
HasherInterface::class => DI\object(HasherService::class)
];
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/bootstrap/routes.php | bootstrap/routes.php | <?php
use CliFyi\Controller\ApiController;
use CliFyi\Controller\HomePageController;
$app->get('/', HomePageController::class);
$app->get('/{searchQuery}[/{additionalParams:.*}]', ApiController::class);
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/bootstrap/settings.php | bootstrap/settings.php | <?php
return [
'settings.responseChunkSize' => 4096,
'settings.outputBuffering' => 'append',
'settings.determineRouteBeforeAppMiddleware' => true,
'settings.displayErrorDetails' => true
];
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/bootstrap/environment.php | bootstrap/environment.php | <?php
(new \Dotenv\Dotenv(__DIR__ . '/../'))->load(); | php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/CliFyi.php | src/CliFyi.php | <?php
declare(strict_types=1);
namespace CliFyi;
use DI\Bridge\Slim\App;
use DI\ContainerBuilder;
class CliFyi extends App
{
/** @var array */
private $appConfig;
/**
* @param array $appConfig
*/
public function __construct(array $appConfig)
{
$this->appConfig = $appConfig;
parent::__construct();
}
/**
* @param ContainerBuilder $builder
*/
protected function configureContainer(ContainerBuilder $builder): void
{
$builder->addDefinitions($this->appConfig);
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Builder/ResponseBuilder.php | src/Builder/ResponseBuilder.php | <?php
declare(strict_types=1);
namespace CliFyi\Builder;
use Psr\Http\Message\ResponseInterface;
class ResponseBuilder
{
const HTTP_STATUS_OK = 200;
const HTTP_STATUS_NOT_FOUND = 404;
/** @var ResponseInterface */
private $response;
/** @var int */
private $statusCode = self::HTTP_STATUS_OK;
/** @var array */
private $jsonArray;
/** @var array */
private $headers;
/**
* @param ResponseInterface $response
*
* @return ResponseBuilder
*/
public function withResponse(ResponseInterface $response): self
{
$this->response = $response;
return $this;
}
/**
* @param string $headerKey
* @param string $headerValue
*
* @return ResponseBuilder
*/
public function withHeader(string $headerKey, string $headerValue): self
{
$this->headers[$headerKey] = $headerValue;
return $this;
}
/**
* @param array $jsonArray
*
* @return ResponseBuilder
*/
public function withJsonArray(array $jsonArray): self
{
$this->jsonArray = $jsonArray;
return $this;
}
/**
* @param int $statusCode
*
* @return ResponseBuilder
*/
public function withStatus(int $statusCode): self
{
$this->statusCode = $statusCode;
return $this;
}
/**
* @return ResponseInterface
*/
public function getBuiltResponse(): ResponseInterface
{
$this->buildHeaders();
return $this->response->withJson(
$this->jsonArray,
$this->statusCode,
JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_LINE_TERMINATORS
);
}
/**
* @return void
*/
private function buildHeaders(): void
{
if ($this->headers) {
foreach ($this->headers as $headerKey => $headerValue) {
$this->response->withHeader($headerKey, $headerValue);
}
}
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Controller/HomePageController.php | src/Controller/HomePageController.php | <?php
declare(strict_types=1);
namespace CliFyi\Controller;
class HomePageController
{
const HOMEPAGE_FILE = __DIR__ . '/../../public/homepage.php';
public function __invoke()
{
return include self::HOMEPAGE_FILE;
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Controller/ApiController.php | src/Controller/ApiController.php | <?php
declare(strict_types=1);
namespace CliFyi\Controller;
use CliFyi\Builder\ResponseBuilder;
use CliFyi\Exception\ErrorParsingQueryException;
use CliFyi\Exception\NoAvailableHandlerException;
use CliFyi\Factory\HandlerFactory;
use CliFyi\Handler\AbstractHandler;
use CliFyi\Value\SearchTerm;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LoggerInterface;
use Throwable;
class ApiController
{
const UNABLE_TO_PARSE_MESSAGE = 'Sorry, we don\'t know how to parse \'%s\' at this time';
const ERROR_WHILE_PARSING_MESSAGE = 'Sorry, we encountered an error while parsing \'%s\'';
/** @var SearchTerm */
private $searchQuery;
/** @var HandlerFactory */
private $handlerFactory;
/** @var AbstractHandler */
private $handler;
/** @var ResponseBuilder */
private $responseBuilder;
/** @var LoggerInterface */
private $logger;
/**
* @param ResponseBuilder $responseBuilder
* @param HandlerFactory $handlerFactory
* @param LoggerInterface $logger
*/
public function __construct(
ResponseBuilder $responseBuilder,
HandlerFactory $handlerFactory,
LoggerInterface $logger
) {
$this->handlerFactory = $handlerFactory;
$this->responseBuilder = $responseBuilder;
$this->logger = $logger;
}
/**
* @param RequestInterface $request
* @param ResponseInterface $response
*
* @throws ErrorParsingQueryException
* @throws NoAvailableHandlerException
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
* @throws \Psr\SimpleCache\InvalidArgumentException
*
* @return ResponseInterface
*/
public function __invoke(RequestInterface $request, ResponseInterface $response)
{
$this->searchQuery = $this->getSearchTerm($request);
if ($this->handler = $this->isHandlerAvailable()) {
if ($output = $this->getParsedData()) {
return $this->responseBuilder
->withResponse($response)
->withJsonArray($output)
->getBuiltResponse();
}
}
throw new NoAvailableHandlerException(sprintf(self::UNABLE_TO_PARSE_MESSAGE, urldecode($this->searchQuery->toString())));
}
/**
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*
* @return null|AbstractHandler
*/
private function isHandlerAvailable(): ?AbstractHandler
{
foreach ($this->handlerFactory->getAvailableHandlers() as $availableHandler) {
if ($availableHandler::isHandlerEligible($this->searchQuery)) {
return $this->handlerFactory->create($availableHandler);
}
}
return null;
}
/**
* @throws ErrorParsingQueryException
* @throws \Psr\SimpleCache\InvalidArgumentException
*
* @return array
*/
private function getParsedData(): array
{
try {
return $this->handler->setSearchTerm($this->searchQuery)->getData();
} catch (Throwable $exception) {
throw new ErrorParsingQueryException(
sprintf(self::ERROR_WHILE_PARSING_MESSAGE, urldecode($this->searchQuery->toString())),
$exception
);
}
}
/**
* @param RequestInterface $request
*
* @return SearchTerm
*/
private function getSearchTerm(RequestInterface $request): SearchTerm
{
return new SearchTerm(trim(ltrim($request->getRequestTarget(), '/')));
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/ErrorHandler/ErrorHandler.php | src/ErrorHandler/ErrorHandler.php | <?php
namespace CliFyi\ErrorHandler;
use CliFyi\Exception\ApiExceptionInterface;
use CliFyi\Exception\ErrorParsingQueryException;
use CliFyi\Exception\NoAvailableHandlerException;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LoggerInterface;
use Slim\Http\Response;
use Throwable;
class ErrorHandler
{
const GENERIC_ERROR_MESSAGE = '<h2>Something has gone wrong on our server! We will look into it ASAP</h2>';
const HTTP_INTERNAL_SERVER_ERROR = 500;
/** @var LoggerInterface */
private $logger;
/** @var bool */
private $debug;
/**
* @param LoggerInterface $logger
* @param bool $debug
*/
public function __construct(LoggerInterface $logger, bool $debug = false)
{
$this->logger = $logger;
$this->debug = $debug;
}
/**
* @param RequestInterface $request
* @param ResponseInterface|Response $response
* @param Throwable $exception
*
* @return ResponseInterface
*/
public function __invoke(
RequestInterface $request,
ResponseInterface $response,
Throwable $exception
): ResponseInterface {
$this->logException($exception);
if ($exception instanceof ApiExceptionInterface) {
return $response
->withStatus($exception->getStatusCode())
->withJson(
['error' => $this->debug ? $this->getFormattedExceptionData($exception) : $exception->getMessage()]
);
}
$response = $response
->withStatus(self::HTTP_INTERNAL_SERVER_ERROR)
->withHeader('Content-Type', 'text/html');
$debugData = $this->debug
? '<pre>' . json_encode($this->getFormattedExceptionData($exception), JSON_PRETTY_PRINT) . '</pre>'
: '';
$response->getBody()->write(self::GENERIC_ERROR_MESSAGE . $debugData);
return $response;
}
/**
* @param Throwable $exception
*
* @return array
*/
private function getFormattedExceptionData(Throwable $exception): array
{
return [
'message' => $exception->getMessage(),
'file' => $exception->getFile() . ':' . $exception->getLine(),
'exceptionType' => get_class($exception),
'trace' => $exception->getTrace(),
'previous' => $exception->getPrevious()
];
}
/**
* @param Throwable $exception
*/
private function logException(Throwable $exception): void
{
if ($exception instanceof NoAvailableHandlerException) {
$this->logger->debug($exception->getMessage(), ['message' => $exception->getMessage()]);
} else {
$this->logger->critical(
$exception->getMessage(),
$this->getFormattedExceptionData(
($exception instanceof ErrorParsingQueryException)
? $exception->getPrevious()
: $exception
)
);
}
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Transformer/EmailDataTransformer.php | src/Transformer/EmailDataTransformer.php | <?php
declare(strict_types=1);
namespace CliFyi\Transformer;
class EmailDataTransformer implements TransformerInterface
{
/**
* @param array $data
*
* @return array
*/
public function transform(array $data): array
{
$transformed = [
'validMxRecords' => $data['valid_mx_records'],
'freeProvider' => $data['free_email_provider'],
'disposableEmail' => $data['disposable_email_provider'],
'businessOrRoleEmail' => $data['role_or_business_email'],
'validHost' => $data['valid_host']
];
if ($data['possible_email_correction']) {
$transformed['possibleSpellingCorrection'] = $data['possible_email_correction'];
}
return $transformed;
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Transformer/CountryDataTransformer.php | src/Transformer/CountryDataTransformer.php | <?php
declare(strict_types=1);
namespace CliFyi\Transformer;
class CountryDataTransformer implements TransformerInterface
{
/**
* @param array $data
*
* @return array
*/
public function transform(array $data): array
{
return [
'commonName' => $data['name']['common'],
'officialName' => $data['name']['official'],
'topLevelDomain' => $data['tld'][0],
'currency' => $data['currency'][0],
'callingCode' => '+' . $data['callingCode'][0],
'capitalCity' => $data['capital'],
'region' => $data['region'],
'subRegion' => $data['subregion'],
'latitude' => $data['latlng'][0],
'longitude' => $data['latlng'][1],
'demonym' => $data['demonym'],
'isLandlocked' => $data['landlocked'] ? 'Yes' : 'No',
'areaKm' => $data['area'],
'officialLanguages' => implode(',', array_values($data['languages']))
];
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Transformer/MediaDataTransformer.php | src/Transformer/MediaDataTransformer.php | <?php
declare(strict_types=1);
namespace CliFyi\Transformer;
class MediaDataTransformer implements TransformerInterface
{
/**
* @param array $data
*
* @return array
*/
public function transform(array $data): array
{
$data = array_filter($data, function ($value) {
return !empty($value);
});
if (isset($data['tags'])) {
$data['tags'] = implode(', ', $data['tags']);
}
unset($data['linkedData'], $data['providerIcons']);
return $data;
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Transformer/DomainNameDataTransformer.php | src/Transformer/DomainNameDataTransformer.php | <?php
declare(strict_types=1);
namespace CliFyi\Transformer;
class DomainNameDataTransformer implements TransformerInterface
{
/**
* @param array $data
*
* @return array
*/
public function transform(array $data): array
{
return [
'dns' => $this->transformDnsData($data),
'whois' => $this->transformWhoisData($data)
];
}
/**
* @param array $data
*
* @return array
*/
private function transformWhoisData(array $data): array
{
$whoisData = array_map(function ($whoisLine) {
return trim($whoisLine);
}, $data['whois']);
$whoisData = array_values(array_filter($whoisData, function ($whoisLine) {
return !empty($whoisLine);
}));
return $whoisData;
}
/**
* @param array $data
*
* @return array
*/
private function transformDnsData(array $data): array
{
$dnsData = array_map(function ($dnsLine) {
return str_replace("\t", " ", $dnsLine);
}, $data['dns']);
$dnsData = array_values(array_filter($dnsData, function ($dnsLine) {
return !empty($dnsLine);
}));
return $dnsData;
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Transformer/TransformerInterface.php | src/Transformer/TransformerInterface.php | <?php
declare(strict_types=1);
namespace CliFyi\Transformer;
interface TransformerInterface
{
/**
* @param array $data
*
* @return array
*/
public function transform(array $data): array;
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Value/SearchTerm.php | src/Value/SearchTerm.php | <?php
namespace CliFyi\Value;
class SearchTerm
{
/** @var string */
private $searchTerm;
/**
* @param string $searchTerm
*/
public function __construct(string $searchTerm)
{
$this->searchTerm = $searchTerm;
}
/**
* @return string
*/
public function toString(): string
{
return $this->searchTerm;
}
/**
* @return string
*/
public function toLowerCaseString(): string
{
return strtolower($this->searchTerm);
}
/**
* @return string
*/
public function toUpperCaseString(): string
{
return strtoupper($this->searchTerm);
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Cache/RedisAdapter.php | src/Cache/RedisAdapter.php | <?php
declare(strict_types=1);
namespace CliFyi\Cache;
use Predis\Client;
use Psr\SimpleCache\CacheInterface;
class RedisAdapter implements CacheInterface
{
/** @var Client */
private $redis;
/**
* @param Client $redis
*/
public function __construct(Client $redis)
{
$this->redis = $redis;
}
/**
* @param string $key
* @param null $default
*
* @return mixed|null
*/
public function get($key, $default = null)
{
if ($value = $this->redis->get($key)) {
return unserialize($value);
}
return $default;
}
/**
* @param string $key
* @param mixed $value
* @param int|null $ttl
*
* @return int
*/
public function set($key, $value, $ttl = null)
{
return $this->redis->setex($key, $ttl, serialize($value));
}
/**
* @param string $key
*
* @return bool|int
*/
public function delete($key)
{
return $this->redis->del($key);
}
public function clear()
{
}
public function getMultiple($keys, $default = null)
{
}
public function setMultiple($values, $ttl = null)
{
}
public function deleteMultiple($keys)
{
}
public function has($key)
{
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Handler/EmailHandler.php | src/Handler/EmailHandler.php | <?php
declare(strict_types=1);
namespace CliFyi\Handler;
use CliFyi\Transformer\TransformerInterface;
use CliFyi\Value\SearchTerm;
use EmailValidation\EmailValidatorFactory as EmailDataExtractor;
use Psr\SimpleCache\CacheInterface;
class EmailHandler extends AbstractHandler
{
/** @var EmailDataExtractor */
private $emailDataExtractor;
/**
* @param CacheInterface $cache
* @param TransformerInterface $transformer
* @param EmailDataExtractor $emailDataExtractor
*/
public function __construct(
CacheInterface $cache,
TransformerInterface $transformer,
EmailDataExtractor $emailDataExtractor
) {
parent::__construct($cache, $transformer);
$this->emailDataExtractor = $emailDataExtractor;
}
/**
* @return string
*/
public function getHandlerName(): string
{
return 'Email Address Query';
}
/**
* @param SearchTerm $value
*
* @return bool
*/
public static function isHandlerEligible(SearchTerm $value): bool
{
return filter_var($value->toString(), FILTER_VALIDATE_EMAIL) !== false;
}
/**
* @param SearchTerm $searchTerm
*
* @return array
*/
public function processSearchTerm(SearchTerm $searchTerm): array
{
$emailData = $this->emailDataExtractor->create($searchTerm->toString())->getValidationResults();
if ($emailData->hasResults()) {
return $emailData->asArray();
}
return [];
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Handler/DateTimeHandler.php | src/Handler/DateTimeHandler.php | <?php
namespace CliFyi\Handler;
use CliFyi\Value\SearchTerm;
use Psr\SimpleCache\CacheInterface;
class DateTimeHandler extends AbstractHandler
{
const KEYWORDS = [
'time',
'date',
'datetime'
];
/**
* @param CacheInterface $cache
*/
public function __construct(CacheInterface $cache)
{
parent::__construct($cache);
$this->disableCache();
}
/**
* @return string
*/
public function getHandlerName(): string
{
return 'Date/Time Information (UTC)';
}
/**
* @param SearchTerm $searchQuery
*
* @return bool
*/
public static function isHandlerEligible(SearchTerm $searchQuery): bool
{
return in_array($searchQuery->toLowerCaseString(), self::KEYWORDS, true);
}
/**
* @param SearchTerm $searchTerm
*
* @return array
*/
public function processSearchTerm(SearchTerm $searchTerm): array
{
return [
'day' => date('d'),
'month' => date('m'),
'year' => date('Y'),
'hour' => date('H'),
'minutes' => date('i'),
'seconds' => date('s'),
'dayName' => date('l'),
'monthName' => date('F'),
'amOrPm' => date('a'),
'unixEpoch' => time(),
'formattedDate' => date('r')
];
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Handler/MediaHandler.php | src/Handler/MediaHandler.php | <?php
declare(strict_types=1);
namespace CliFyi\Handler;
use CliFyi\Service\Media\MediaExtractorInterface;
use CliFyi\Transformer\TransformerInterface;
use CliFyi\Value\SearchTerm;
use Psr\SimpleCache\CacheInterface;
class MediaHandler extends AbstractHandler
{
/** @var MediaExtractorInterface */
private $mediaExtractor;
/** @var string */
private $handlerName = 'Media';
/**
* @param CacheInterface $cache
* @param TransformerInterface $transformer
* @param MediaExtractorInterface $mediaExtractor
*/
public function __construct(
CacheInterface $cache,
TransformerInterface $transformer,
MediaExtractorInterface $mediaExtractor
) {
parent::__construct($cache, $transformer);
$this->mediaExtractor = $mediaExtractor;
}
/**
* @return string
*/
public function getHandlerName(): string
{
return $this->handlerName;
}
/**
* @param SearchTerm $searchQuery
*
* @return bool
*/
public static function isHandlerEligible(SearchTerm $searchQuery): bool
{
return filter_var($searchQuery->toString(), FILTER_VALIDATE_URL) !== false;
}
/**
* @param SearchTerm $searchQuery
*
* @return array
*/
public function processSearchTerm(SearchTerm $searchQuery): array
{
if ($extractedData = $this->mediaExtractor->extract($searchQuery->toString())) {
$this->setHandlerName($extractedData['providerName']);
return $extractedData;
}
return [];
}
/**
* @param string $providerName
*/
private function setHandlerName(string $providerName): void
{
$this->handlerName = ucwords($providerName) . ' URL';
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Handler/ClientInformationHandler.php | src/Handler/ClientInformationHandler.php | <?php
declare(strict_types=1);
namespace CliFyi\Handler;
use CliFyi\Service\Client\ClientParserInterface;
use CliFyi\Service\IpAddress\IpAddressInfoProviderInterface;
use CliFyi\Value\SearchTerm;
use Psr\SimpleCache\CacheInterface;
class ClientInformationHandler extends AbstractHandler
{
private const KEYWORDS = [
'me',
'self',
'ip'
];
/** @var IpAddressInfoProviderInterface */
private $ipInfoService;
/** @var ClientParserInterface */
private $clientParser;
/**
* @param ClientParserInterface $clientParser
* @param IpAddressInfoProviderInterface $ipAddressInfoProvider
* @param CacheInterface $cache
*/
public function __construct(
ClientParserInterface $clientParser,
IpAddressInfoProviderInterface $ipAddressInfoProvider,
CacheInterface $cache
) {
parent::__construct($cache);
$this->clientParser = $clientParser;
$this->ipInfoService = $ipAddressInfoProvider;
$this->disableCache();
}
/**
* @return string
*/
public function getHandlerName(): string
{
return 'Client Information Query';
}
/**
* @param SearchTerm $searchQuery
*
* @return bool
*/
public static function isHandlerEligible(SearchTerm $searchQuery): bool
{
return in_array($searchQuery->toLowerCaseString(), self::KEYWORDS, true);
}
/**
* @param SearchTerm $searchTerm
*
* @return array
*/
public function processSearchTerm(SearchTerm $searchTerm): array
{
$data = [
'iPAddress' => $this->clientParser->getIpAddress(),
'userAgent' => $this->clientParser->getUserAgent(),
'browser' => $this->clientParser->getBrowserName(),
'operatingSystem' => $this->clientParser->getOperatingSystemName()
];
if ($ipInfo = $this->getIpInfo()) {
$data['iPAddressInfo'] = $ipInfo;
}
return array_filter($data);
}
/**
* @return array|null
*/
private function getIpInfo(): ?array
{
$this->ipInfoService->setIpAddress($this->clientParser->getIpAddress());
return array_filter([
'organisation' => $this->ipInfoService->getOrganisation(),
'country' => $this->ipInfoService->getCountry(),
'countryCode' => $this->ipInfoService->getCountryCode(),
'city' => $this->ipInfoService->getCity(),
'continent' => $this->ipInfoService->getContinent(),
'latitude' => $this->ipInfoService->getLatitude(),
'longitude' => $this->ipInfoService->getLongitude()
]);
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Handler/DomainNameHandler.php | src/Handler/DomainNameHandler.php | <?php
declare(strict_types=1);
namespace CliFyi\Handler;
use CliFyi\Service\DomainName\DomainNameServiceProviderInterface;
use CliFyi\Transformer\TransformerInterface;
use CliFyi\Value\SearchTerm;
use Psr\SimpleCache\CacheInterface;
class DomainNameHandler extends AbstractHandler
{
private const DOMAIN_REGEX = '/^(?!\-)(?:[a-zA-Z\d\-]{0,62}[a-zA-Z\d]\.){1,126}(?!\d+)[a-zA-Z\d]{1,63}$/';
/** @var DomainNameServiceProviderInterface */
private $domainNameServiceProvider;
/**
* @param DomainNameServiceProviderInterface $domainNameServiceProvider
* @param CacheInterface $cache
* @param TransformerInterface $transformer
*/
public function __construct(
DomainNameServiceProviderInterface $domainNameServiceProvider,
CacheInterface $cache,
TransformerInterface $transformer
) {
parent::__construct($cache, $transformer);
$this->domainNameServiceProvider = $domainNameServiceProvider;
}
/**
* @return string
*/
public function getHandlerName(): string
{
return 'Domain Name Information';
}
/**
* @param SearchTerm $searchQuery
*
* @return bool
*/
public static function isHandlerEligible(SearchTerm $searchQuery): bool
{
return preg_match(self::DOMAIN_REGEX, $searchQuery->toLowerCaseString()) === 1;
}
/**
* @param SearchTerm $searchQuery
*
* @return array
*/
public function processSearchTerm(SearchTerm $searchQuery): array
{
return [
'whois' => $this->domainNameServiceProvider->getWhoisData($searchQuery->toLowerCaseString()),
'dns' => $this->domainNameServiceProvider->getDnsData($searchQuery->toLowerCaseString())
];
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Handler/HelpHandler.php | src/Handler/HelpHandler.php | <?php
namespace CliFyi\Handler;
use CliFyi\Value\SearchTerm;
class HelpHandler extends AbstractHandler
{
const KEYWORD = 'help';
/**
* @return string
*/
public function getHandlerName(): string
{
return 'Help';
}
/**
* @param SearchTerm $searchQuery
*
* @return bool
*/
public static function isHandlerEligible(SearchTerm $searchQuery): bool
{
return $searchQuery->toLowerCaseString() === self::KEYWORD;
}
/**
* @param SearchTerm $searchTerm
*
* @return array
*/
public function processSearchTerm(SearchTerm $searchTerm): array
{
return [
'IP Address Query' => [
'example' => 'https://cli.fyi/8.8.8.8'
],
'Media/Url Query' => [
'example' => 'https://cli.fyi/https://google.com'
],
'Email Address Query' => [
'example' => 'https://cli.fyi/test@10minutemail.com'
],
'Client (you) Query' => [
'example' => 'https://cli.fyi/me'
],
'Domain DNS & Whois Query' => [
'example' => 'https://cli.fyi/google.com'
],
'Crypto Prices Query' => [
'example' => 'https://cli.fyi/btc'
],
'Date/Time Query' => [
'example' => 'https://cli.fyi/time'
],
'Country Query' => [
'example' => 'https://cli.fyi/united-states'
],
'Programming Language Query' => [
'example' => 'https://cli.fyi/java'
],
'Emoji Query' => [
'example' => 'https://cli.fyi/emoji'
]
];
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Handler/CryptoCurrencyHandler.php | src/Handler/CryptoCurrencyHandler.php | <?php
declare(strict_types=1);
namespace CliFyi\Handler;
use CliFyi\Service\CryptoCurrency\PriceFetchInterface;
use CliFyi\Value\SearchTerm;
use Psr\SimpleCache\CacheInterface;
class CryptoCurrencyHandler extends AbstractHandler
{
const CRYPTO_DATA_LOCATION = __DIR__ . '/../../data/crypto_currency_data.php';
/** @var PriceFetchInterface */
private $priceFetcher;
/** @var array */
private static $cryptoCurrencyData;
/** @var string */
private $handlerName = 'Crypto Currency';
/**
* @param CacheInterface $cache
* @param PriceFetchInterface $priceFetch
*/
public function __construct(CacheInterface $cache, PriceFetchInterface $priceFetch)
{
parent::__construct($cache);
$this->priceFetcher = $priceFetch;
}
/**
* @return string
*/
public function getHandlerName(): string
{
return $this->handlerName;
}
/**
* @param SearchTerm $searchQuery
*
* @return bool
*/
public static function isHandlerEligible(SearchTerm $searchQuery): bool
{
return in_array($searchQuery->toUpperCaseString(), array_keys(self::getCryptoCurrencyData()), true);
}
/**
* @param SearchTerm $searchQuery
*
* @return array
*/
public function processSearchTerm(SearchTerm $searchQuery): array
{
if ($prices = $this->priceFetcher->getPrices($searchQuery->toUpperCaseString())) {
$this->handlerName = self::getCryptoCurrencyData()[$searchQuery->toUpperCaseString()] . ' Prices';
return $prices;
}
return null;
}
/**
* @return array
*/
private static function getCryptoCurrencyData(): array
{
if (self::$cryptoCurrencyData) {
return self::$cryptoCurrencyData;
}
self::$cryptoCurrencyData = include self::CRYPTO_DATA_LOCATION;
return self::$cryptoCurrencyData;
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Handler/EmojiHandler.php | src/Handler/EmojiHandler.php | <?php
declare(strict_types=1);
namespace CliFyi\Handler;
use CliFyi\Value\SearchTerm;
class EmojiHandler extends AbstractHandler
{
const EMOJI_KEYWORDS = [
'emoji',
'emojis',
'emoticons',
'smileys'
];
/**
* @return string
*/
public function getHandlerName(): string
{
return 'Popular Emojis';
}
/**
* @param SearchTerm $searchQuery
*
* @return bool
*/
public static function isHandlerEligible(SearchTerm $searchQuery): bool
{
return in_array($searchQuery->toLowerCaseString(), self::EMOJI_KEYWORDS, true);
}
/**
* @param SearchTerm $searchQuery
*
* @return array
*/
public function processSearchTerm(SearchTerm $searchQuery): array
{
return [
'huggingFace' => '🤗',
'tearsOfJoy' => '😂',
'grinningFace' => '😀',
'rofl' => '🤣',
'smiling' => '😊',
'tongueOut' => '😋',
'kissingFace' => '😘',
'thinking' => '🤔',
'neutralFace' => '😐'
];
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Handler/AbstractHandler.php | src/Handler/AbstractHandler.php | <?php
declare(strict_types=1);
namespace CliFyi\Handler;
use CliFyi\Exception\NoDataReturnedFromHandlerException;
use CliFyi\Transformer\TransformerInterface;
use CliFyi\Value\SearchTerm;
use Psr\SimpleCache\CacheInterface;
use Psr\SimpleCache\InvalidArgumentException;
abstract class AbstractHandler
{
private const NO_DATA_ERROR_MESSAGE = 'No data returned from handler.';
protected const DEFAULT_CACHE_TTL_IN_SECONDS = 60 * 15;
/** @var TransformerInterface */
private $transformer;
/** @var SearchTerm */
private $searchTerm;
/** @var CacheInterface */
private $cache;
/** @var int */
private $cacheTtlInSeconds = self::DEFAULT_CACHE_TTL_IN_SECONDS;
/** @var bool */
private $cacheEnabled = true;
/**
* @param CacheInterface $cache
* @param TransformerInterface|null $transformer
*/
public function __construct(CacheInterface $cache, TransformerInterface $transformer = null)
{
$this->cache = $cache;
$this->transformer = $transformer;
}
/**
* @return string
*/
abstract public function getHandlerName(): string;
/**
* @param SearchTerm $searchQuery
*
* @return bool
*/
abstract public static function isHandlerEligible(SearchTerm $searchQuery): bool;
/**
* @param SearchTerm $searchTerm
*
* @return array
*/
abstract public function processSearchTerm(SearchTerm $searchTerm): array;
/**
* @throws InvalidArgumentException
* @throws NoDataReturnedFromHandlerException
*
* @return array
*/
public function getData(): array
{
if ($this->cacheEnabled && $cachedValue = $this->cache->get($this->getCacheKey())) {
return $cachedValue;
}
return $this->cacheAndReturn($this->buildResponseArray());
}
/**
* @param SearchTerm $searchTerm
*
* @return AbstractHandler
*/
public function setSearchTerm(SearchTerm $searchTerm): AbstractHandler
{
$this->searchTerm = $searchTerm;
return $this;
}
/**
* @return SearchTerm
*/
public function getSearchTerm(): SearchTerm
{
return $this->searchTerm;
}
/**
* @return int
*/
protected function getCacheTtl(): int
{
return $this->cacheTtlInSeconds;
}
/**
* @param int $cacheTtl
*
* @return int
*/
protected function setCacheTtl(int $cacheTtl): int
{
$this->cacheTtlInSeconds = $cacheTtl;
}
/**
* @return void
*/
protected function disableCache(): void
{
$this->cacheEnabled = false;
}
/**
* @return string
*/
private function getCacheKey(): string
{
return md5($this->searchTerm->toString());
}
/**
* @param array $data
*
* @throws InvalidArgumentException
*
* @return mixed
*/
private function cacheAndReturn(array $data): array
{
if ($this->cacheEnabled) {
$this->cache->set($this->getCacheKey(), $data, $this->getCacheTtl());
}
return $data;
}
/**
* @throws NoDataReturnedFromHandlerException
*
* @return array
*/
private function buildResponseArray(): array
{
$handlerData = $this->processSearchTerm($this->getSearchTerm());
$handlerName = $this->getHandlerName();
if (empty($handlerData)) {
throw new NoDataReturnedFromHandlerException(self::NO_DATA_ERROR_MESSAGE);
}
if ($this->transformer) {
$handlerData = $this->transformer->transform($handlerData);
}
return [
'type' => $handlerName,
'data' => $handlerData
];
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Handler/HashHandler.php | src/Handler/HashHandler.php | <?php
namespace CliFyi\Handler;
use CliFyi\Service\Hash\HasherInterface;
use CliFyi\Value\SearchTerm;
use Psr\SimpleCache\CacheInterface;
class HashHandler extends AbstractHandler
{
public const TRIGGER_KEYWORD = 'hash/';
/** @var HasherInterface */
private $hasher;
private $handlerName = 'String Hash Values For: ';
/**
* @param CacheInterface $cache
* @param HasherInterface $hasher
*/
public function __construct(CacheInterface $cache, HasherInterface $hasher)
{
parent::__construct($cache);
$this->hasher = $hasher;
}
/**
* @return string
*/
public function getHandlerName(): string
{
return $this->handlerName;
}
/**
* @param SearchTerm $searchQuery
*
* @return bool
*/
public static function isHandlerEligible(SearchTerm $searchQuery): bool
{
return (stripos($searchQuery->toLowerCaseString(), self::TRIGGER_KEYWORD) === 0);
}
/**
* @param SearchTerm $searchTerm
*
* @return array
*/
public function processSearchTerm(SearchTerm $searchTerm): array
{
$valueToHash = $this->formatSearchTerm($searchTerm->toString());
$this->setHandlerName($valueToHash);
return $this->hasher->getHashValuesFromString($valueToHash);
}
/**
* @param string $searchTerm
*
* @return string
*/
private function formatSearchTerm(string $searchTerm): string
{
return str_replace(self::TRIGGER_KEYWORD, '', $searchTerm);
}
/**
* @param string $searchTerm
*/
private function setHandlerName(string $searchTerm)
{
$this->handlerName .= ' ('. $searchTerm . ')';
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Handler/CountryHandler.php | src/Handler/CountryHandler.php | <?php
declare(strict_types=1);
namespace CliFyi\Handler;
use CliFyi\Value\SearchTerm;
class CountryHandler extends AbstractHandler
{
const COUNTRY_DATA_LOCATION = __DIR__ . '/../../data/countries_data.php';
/** @var mixed */
private static $countryData;
/**
* @return string
*/
public function getHandlerName(): string
{
return 'Country Query';
}
/**
* @param SearchTerm $searchQuery
*
* @return bool
*/
public static function isHandlerEligible(SearchTerm $searchQuery): bool
{
if (self::isCountry($searchQuery->toLowerCaseString())) {
return true;
}
return false;
}
/**
* @param string $searchQuery
*
* @return bool
*/
private static function isCountry(string $searchQuery): bool
{
return isset(self::getCountryData()[trim($searchQuery)]);
}
/**
* @return array
*/
private static function getCountryData(): array
{
if (self::$countryData) {
return self::$countryData;
}
self::$countryData = include self::COUNTRY_DATA_LOCATION;
return self::$countryData;
}
/**
* @param SearchTerm $searchTerm
*
* @return array
*/
public function processSearchTerm(SearchTerm $searchTerm): array
{
return self::getCountryData()[trim($searchTerm->toLowerCaseString())];
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Handler/IpAddressHandler.php | src/Handler/IpAddressHandler.php | <?php
declare(strict_types=1);
namespace CliFyi\Handler;
use CliFyi\Service\IpAddress\IpAddressInfoProviderInterface;
use CliFyi\Value\SearchTerm;
use Psr\SimpleCache\CacheInterface;
class IpAddressHandler extends AbstractHandler
{
const IP_VALIDATION_FLAGS = FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6;
const RESERVED_OR_PRIVATE_IP_MESSAGE = '%s falls within a %s IP range and therefore no data is available.';
/** @var IpAddressInfoProviderInterface */
private $ipInfoService;
/**
* @param IpAddressInfoProviderInterface $ipService
* @param CacheInterface $cache
*/
public function __construct(IpAddressInfoProviderInterface $ipService, CacheInterface $cache)
{
parent::__construct($cache);
$this->ipInfoService = $ipService;
$this->disableCache();
}
/**
* @param SearchTerm $ipAddress
*
* @return bool
*/
public static function isHandlerEligible(SearchTerm $ipAddress): bool
{
return filter_var($ipAddress->toString(), FILTER_VALIDATE_IP, self::IP_VALIDATION_FLAGS) !== false;
}
/**
* @return string
*/
public function getHandlerName(): string
{
return 'IP Address';
}
/**
* @param SearchTerm $searchQuery
*
* @return array|null
*/
public function processSearchTerm(SearchTerm $searchQuery): array
{
$this->ipInfoService->setIpAddress($searchQuery->toString());
return array_filter([
'organisation' => $this->ipInfoService->getOrganisation(),
'country' => $this->ipInfoService->getCountry(),
'countryCode' => $this->ipInfoService->getCountryCode(),
'city' => $this->ipInfoService->getCity(),
'continent' => $this->ipInfoService->getContinent(),
'latitude' => $this->ipInfoService->getLatitude(),
'longitude' => $this->ipInfoService->getLongitude(),
'isIpInPrivateRange' => $this->isInPrivateIpRange($searchQuery->toString()),
'isIpInReservedRange' => $this->isInReservedIpRange($searchQuery->toString())
]);
}
/**
* @param string $ipAddress
*
* @return bool
*/
private function isInPrivateIpRange(string $ipAddress): bool
{
return filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE) !== $ipAddress;
}
/**
* @param string $ipAddress
*
* @return bool
*/
private function isInReservedIpRange(string $ipAddress): bool
{
return filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE) !== $ipAddress;
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Handler/ProgrammingLanguageHandler.php | src/Handler/ProgrammingLanguageHandler.php | <?php
declare(strict_types=1);
namespace CliFyi\Handler;
use CliFyi\Value\SearchTerm;
class ProgrammingLanguageHandler extends AbstractHandler
{
const PROGRAMMING_LANGUAGE_DATA_LOCATION = __DIR__ . '/../../data/programming_language_data.php';
private $handlerName = 'Programming Language Links';
/**
* @return string
*/
public function getHandlerName(): string
{
return $this->handlerName;
}
/**
* @param SearchTerm $searchQuery
*
* @return bool
*/
public static function isHandlerEligible(SearchTerm $searchQuery): bool
{
return isset(self::getProgrammingLanguageData()[$searchQuery->toLowerCaseString()]);
}
/**
* @param SearchTerm $searchQuery
*
* @return array
*/
public function processSearchTerm(SearchTerm $searchQuery): array
{
$this->handlerName = strtoupper($searchQuery->toString()) . ' Query';
return self::getProgrammingLanguageData()[$searchQuery->toLowerCaseString()];
}
/**
* @return array
*/
private static function getProgrammingLanguageData(): array
{
return include self::PROGRAMMING_LANGUAGE_DATA_LOCATION;
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Exception/InvalidHandlerException.php | src/Exception/InvalidHandlerException.php | <?php
declare(strict_types=1);
namespace CliFyi\Exception;
use InvalidArgumentException;
class InvalidHandlerException extends InvalidArgumentException
{
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Exception/NoDataReturnedFromHandlerException.php | src/Exception/NoDataReturnedFromHandlerException.php | <?php
namespace CliFyi\Exception;
use Exception;
class NoDataReturnedFromHandlerException extends Exception
{
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Exception/ApiExceptionInterface.php | src/Exception/ApiExceptionInterface.php | <?php
namespace CliFyi\Exception;
interface ApiExceptionInterface
{
/**
* @return int
*/
public function getStatusCode(): int;
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Exception/NoAvailableHandlerException.php | src/Exception/NoAvailableHandlerException.php | <?php
namespace CliFyi\Exception;
use Exception;
class NoAvailableHandlerException extends Exception implements ApiExceptionInterface
{
/**
* @return int
*/
public function getStatusCode(): int
{
return 404;
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Exception/EnvValueException.php | src/Exception/EnvValueException.php | <?php
namespace CliFyi\Exception;
use RuntimeException;
class EnvValueException extends RuntimeException implements ApiExceptionInterface
{
/**
* @return int
*/
public function getStatusCode(): int
{
return 500;
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Exception/ErrorParsingQueryException.php | src/Exception/ErrorParsingQueryException.php | <?php
namespace CliFyi\Exception;
use Exception;
use Throwable;
class ErrorParsingQueryException extends Exception implements ApiExceptionInterface
{
/**
* @param string $message
* @param Throwable|null $previous
*/
public function __construct(string $message, Throwable $previous)
{
parent::__construct($message, 0, $previous);
}
/**
* @return int
*/
public function getStatusCode(): int
{
return 500;
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Middleware/TrailingSlash.php | src/Middleware/TrailingSlash.php | <?php
declare(strict_types=1);
namespace CliFyi\Middleware;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
class TrailingSlash
{
/**
* @param RequestInterface $request
* @param ResponseInterface $response
* @param callable $next
*
* @return mixed
*/
public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next)
{
$uri = $request->getUri();
$path = $uri->getPath();
if ($path !== '/' && substr($path, -1) === '/') {
$uri = $uri->withPath(substr($path, 0, -1));
return $request->getMethod() === 'GET'
? $response->withRedirect((string)$uri, 301)
: $next($request->withUri($uri), $response);
}
return $next($request, $response);
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Middleware/GoogleAnalyticsMiddleware.php | src/Middleware/GoogleAnalyticsMiddleware.php | <?php
namespace CliFyi\Middleware;
use CliFyi\Service\UuidGenerator;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\GuzzleException;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LoggerInterface;
use Slim\Http\Request;
class GoogleAnalyticsMiddleware
{
const GOOGLE_URI = 'www.google-analytics.com/collect';
const ERROR_MESSAGE = 'Failed to send data to Google Analytics';
const HTTP_SUCCESSFUL_RESPONSE = 200;
const HTTP_NOT_FOUND_RESPONSE = 404;
/** @var string */
private $googleAnalyticsId;
/** @var LoggerInterface */
private $logger;
/** @var ClientInterface */
private $httpClient;
/** @var UuidGenerator */
private $uuidGenerator;
/**
* @param ClientInterface $httpClient
* @param LoggerInterface $logger
* @param UuidGenerator $uuidGenerator
* @param string $googleAnalyticsId
*/
public function __construct(
ClientInterface $httpClient,
LoggerInterface $logger,
UuidGenerator $uuidGenerator,
string $googleAnalyticsId
) {
$this->googleAnalyticsId = $googleAnalyticsId;
$this->logger = $logger;
$this->httpClient = $httpClient;
$this->uuidGenerator = $uuidGenerator;
}
/**
* @param RequestInterface|Request $request
* @param ResponseInterface $response
* @param callable $next
*
* @return ResponseInterface
*/
public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next)
{
/** @var ResponseInterface $response */
$response = $next($request, $response);
if ($this->isSuccessfulResponse($request, $response)) {
$this->handleSuccessfulResponse($request);
}
if ($this->isNotFoundResponse($response)) {
$this->handleNotFoundResponse($request);
}
return $response;
}
/**
* @param RequestInterface|Request $request
*
* @return string
*/
private function buildRequestBody(RequestInterface $request): string
{
$ip = $request->getAttribute('ip_address') ?: $request->getServerParam('REMOTE_ADDR');
$userAgent = $request->getServerParam('HTTP_USER_AGENT') ?: null;
$referer = $this->getReferer($request);
$userIdentifier = $this->uuidGenerator->v5(md5($ip . $userAgent));
$fullUri = $request->getUri()->getScheme()
. '://' . $request->getUri()->getHost()
. $request->getRequestTarget();
return http_build_query(array_filter([
'v' => '1',
'tid' => $this->googleAnalyticsId,
'cid' => $userIdentifier,
'dl' => $fullUri,
'uip' => $ip,
'ua' => $userAgent,
't' => 'pageview',
'dr' => $referer,
'ds' => 'web'
]));
}
/**
* @param RequestInterface $request
* @param ResponseInterface $response
*
* @return bool
*/
private function isSuccessfulResponse(RequestInterface $request, ResponseInterface $response): bool
{
return ($response->getStatusCode() === self::HTTP_SUCCESSFUL_RESPONSE) && $request->getRequestTarget() !== '/';
}
/**
* @param ResponseInterface $response
*
* @return bool
*/
private function isNotFoundResponse(ResponseInterface $response): bool
{
return ($response->getStatusCode() === self::HTTP_NOT_FOUND_RESPONSE);
}
/**
* @param RequestInterface $request
*
* @return null|string
*/
private function getReferer(RequestInterface $request): ?string
{
return !empty($request->getHeader('HTTP_REFERER')) ? $request->getHeader('HTTP_REFERER')[0] : null;
}
/**
* @param RequestInterface $request
*/
private function handleSuccessfulResponse(RequestInterface $request): void
{
try {
$this->httpClient->request('POST', self::GOOGLE_URI, [
'body' => $this->buildRequestBody($request)
]);
} catch (GuzzleException $e) {
$this->logger->error(self::ERROR_MESSAGE, [$e]);
}
}
/**
* @param $request
*/
private function handleNotFoundResponse($request): void
{
//Don't log 404s to GA for the time being
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Middleware/CacheMiddleware.php | src/Middleware/CacheMiddleware.php | <?php
declare(strict_types=1);
namespace CliFyi\Middleware;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\SimpleCache\CacheInterface;
/**
* This Middleware indiscriminately caches every GET request
*/
class CacheMiddleware
{
const CACHE_TIMEOUT_IN_SECONDS = 0;
/** @var CacheInterface */
private $cache;
/**
* @param CacheInterface $cache
*/
public function __construct(CacheInterface $cache)
{
$this->cache = $cache;
}
/**
* @param RequestInterface $request
* @param ResponseInterface $response
* @param callable $next
*
* @throws \Psr\SimpleCache\InvalidArgumentException
*
* @return ResponseInterface
*/
public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next)
{
if ($request->getMethod() !== 'GET') {
return $next($request, $response);
}
$requestPath = $request->getRequestTarget();
$cacheKey = sha1($requestPath);
if ($cachedResponse = $this->cache->get($cacheKey)) {
return $this->getCachedResponse($response, $cachedResponse);
}
$response = $next($request, $response);
$this->setCachedResponse($response, $cachedResponse, $cacheKey);
return $response;
}
/**
* @param ResponseInterface $response
* @param $cachedResponse
*
* @return ResponseInterface
*/
private function getCachedResponse(ResponseInterface $response, $cachedResponse): ResponseInterface
{
$cachedValue = unserialize($cachedResponse);
if (isset($cachedValue['headers'])) {
foreach ($cachedValue['headers'] as $headerKey => $headerValue) {
$response = $response->withHeader($headerKey, $headerValue);
}
}
$response->getBody()->write($cachedValue['body']);
return $response->withHeader('X-isCached', '1');
}
/**
* @param ResponseInterface $response
* @param $cachedResponse
* @param $cacheKey
*
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
private function setCachedResponse(ResponseInterface $response, $cachedResponse, $cacheKey): void
{
$response->getBody()->rewind();
$cachedResponse['headers'] = $response->getHeaders();
$cachedResponse['body'] = $response->getBody()->getContents();
$this->cache->set($cacheKey, serialize($cachedResponse), self::CACHE_TIMEOUT_IN_SECONDS);
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Middleware/keenTrackingMiddleware.php | src/Middleware/keenTrackingMiddleware.php | <?php
namespace CliFyi\Middleware;
use KeenIO\Client\KeenIOClient;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
class keenTrackingMiddleware
{
const HTTP_SUCCESSFUL_RESPONSE = 200;
/** @var string */
private $projectId;
/** @var string */
private $writeId;
public function __construct(string $keenProjectId, string $keenWriteId)
{
$this->projectId = $keenWriteId;
$this->writeId = $keenWriteId;
}
/**
* @param RequestInterface $request
* @param ResponseInterface $response
* @param callable $next
*
* @return ResponseInterface
*/
public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next)
{
/** @var ResponseInterface $response */
$response = $next($request, $response);
if ($response->getStatusCode() === self::HTTP_SUCCESSFUL_RESPONSE) {
$client = KeenIOClient::factory([
'projectId' => getenv('KEEN_PROJECT_ID'),
'writeKey' => getenv('KEEN_WRITE_ID')
]);
$client->addEvent(
'query',
[
'term' => ltrim($request->getRequestTarget(), '/'),
'user_agent' => $_SERVER['HTTP_USER_AGENT'] ?: 'Unknown',
'ip' => $_SERVER['REMOTE_ADDR'] ?: 'Unknown'
]
);
}
return $response;
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Factory/HandlerFactory.php | src/Factory/HandlerFactory.php | <?php
declare(strict_types=1);
namespace CliFyi\Factory;
use CliFyi\Exception\InvalidHandlerException;
use CliFyi\Handler\AbstractHandler;
use CliFyi\Handler\ClientInformationHandler;
use CliFyi\Handler\CountryHandler;
use CliFyi\Handler\CryptoCurrencyHandler;
use CliFyi\Handler\DateTimeHandler;
use CliFyi\Handler\DomainNameHandler;
use CliFyi\Handler\EmailHandler;
use CliFyi\Handler\EmojiHandler;
use CliFyi\Handler\HashHandler;
use CliFyi\Handler\HelpHandler;
use CliFyi\Handler\IpAddressHandler;
use CliFyi\Handler\MediaHandler;
use CliFyi\Handler\ProgrammingLanguageHandler;
use CliFyi\Service\Client\ClientParser;
use CliFyi\Service\CryptoCurrency\CryptoComparePriceFetcher;
use CliFyi\Service\DomainName\DomainNameServiceProvider;
use CliFyi\Service\Hash\HasherInterface;
use CliFyi\Service\IpAddress\GeoIpProvider;
use CliFyi\Service\Media\MediaExtractor;
use CliFyi\Transformer\CountryDataTransformer;
use CliFyi\Transformer\DomainNameDataTransformer;
use CliFyi\Transformer\EmailDataTransformer;
use CliFyi\Transformer\MediaDataTransformer;
use EmailValidation\EmailValidatorFactory;
use Psr\Container\ContainerInterface;
use Psr\SimpleCache\CacheInterface;
class HandlerFactory
{
/** @var array */
private static $availableHandlers = [
DateTimeHandler::class,
ClientInformationHandler::class,
CryptoCurrencyHandler::class,
ProgrammingLanguageHandler::class,
EmojiHandler::class,
EmailHandler::class,
CountryHandler::class,
DomainNameHandler::class,
MediaHandler::class,
IpAddressHandler::class,
HelpHandler::class,
HashHandler::class
];
/** @var ContainerInterface */
private $container;
/**
* @param ContainerInterface $container
*
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*/
public function __construct(ContainerInterface $container)
{
$this->container = $container;
}
/**
* @param string $handlerName
*
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*
* @return AbstractHandler
*/
public function create(string $handlerName): AbstractHandler
{
switch ($handlerName) {
case EmailHandler::class:
return new EmailHandler(
$this->container->get(CacheInterface::class),
$this->container->get(EmailDataTransformer::class),
$this->container->get(EmailValidatorFactory::class)
);
case CountryHandler::class:
return new CountryHandler(
$this->container->get(CacheInterface::class),
$this->container->get(CountryDataTransformer::class)
);
case DomainNameHandler::class:
return new DomainNameHandler(
$this->container->get(DomainNameServiceProvider::class),
$this->container->get(CacheInterface::class),
$this->container->get(DomainNameDataTransformer::class)
);
case MediaHandler::class:
return new MediaHandler(
$this->container->get(CacheInterface::class),
$this->container->get(MediaDataTransformer::class),
$this->container->get(MediaExtractor::class)
);
case EmojiHandler::class:
return new EmojiHandler($this->container->get(CacheInterface::class));
case ProgrammingLanguageHandler::class:
return new ProgrammingLanguageHandler($this->container->get(CacheInterface::class));
case CryptoCurrencyHandler::class:
return new CryptoCurrencyHandler(
$this->container->get(CacheInterface::class),
$this->container->get(CryptoComparePriceFetcher::class)
);
case ClientInformationHandler::class:
return new ClientInformationHandler(
$this->container->get(ClientParser::class),
$this->container->get(GeoIpProvider::class),
$this->container->get(CacheInterface::class)
);
case IpAddressHandler::class:
return new IpAddressHandler(
$this->container->get(GeoIpProvider::class),
$this->container->get(CacheInterface::class)
);
case DateTimeHandler::class:
return new DateTimeHandler($this->container->get(CacheInterface::class));
case HelpHandler::class:
return new HelpHandler($this->container->get(CacheInterface::class));
case HashHandler::class:
return new HashHandler(
$this->container->get(CacheInterface::class),
$this->container->get(HasherInterface::class)
);
}
throw new InvalidHandlerException(sprintf('%s is not a valid handler name', $handlerName));
}
/**
* @return string[]
*/
public function getAvailableHandlers(): array
{
return self::$availableHandlers;
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Service/Env.php | src/Service/Env.php | <?php
namespace CliFyi\Service;
use CliFyi\Exception\EnvValueException;
class Env
{
/**
* @param string $key
*
* @return string
*/
public function getStringValue(string $key): string
{
return (string) $this->getValue($key);
}
/**
* @param string $key
*
* @return int
*/
public function getIntValue(string $key): int
{
return (int) $this->getValue($key);
}
/**
* @param string $key
*
* @return array|false|string
*/
private function getValue(string $key)
{
if ($value = getenv($key)) {
return $value;
}
throw new EnvValueException(sprintf('%s value not set in .env', $key), 500);
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Service/UuidGenerator.php | src/Service/UuidGenerator.php | <?php
namespace CliFyi\Service;
/**
* UUID class
*
* The following class generates VALID RFC 4122 COMPLIANT
* Universally Unique IDentifiers (UUID) version 3, 4 and 5.
*
* UUIDs generated validates using OSSP UUID Tool, and output
* for named-based UUIDs are exactly the same. This is a pure
* PHP implementation.
*
* @author Andrew Moore
* @link http://www.php.net/manual/en/function.uniqid.php#94959
*/
class UuidGenerator
{
const DEFAULT_NAMESPACE = '1546058f-5a25-4334-85ae-e68f2a44bbaf';
/**
* Generate v5 UUID
*
* Version 5 UUIDs are named based. They require a namespace (another
* valid UUID) and a value (the name). Given the same namespace and
* name, the output is always the same.
*
* @param string $name
* @param string $namespace
*
* @return bool|string
*/
public function v5(string $name, string $namespace = self::DEFAULT_NAMESPACE)
{
if (!self::is_valid($namespace)) {
return false;
}
// Get hexadecimal components of namespace
$nhex = str_replace(['-', '{', '}'], '', $namespace);
// Binary Value
$nstr = '';
// Convert Namespace UUID to bits
for ($i = 0; $i < strlen($nhex); $i += 2) {
$nstr .= chr(hexdec($nhex[$i] . $nhex[$i + 1]));
}
// Calculate hash value
$hash = sha1($nstr . $name);
return sprintf(
'%08s-%04s-%04x-%04x-%12s',
// 32 bits for "time_low"
substr($hash, 0, 8),
// 16 bits for "time_mid"
substr($hash, 8, 4),
// 16 bits for "time_hi_and_version",
// four most significant bits holds version number 5
(hexdec(substr($hash, 12, 4)) & 0x0fff) | 0x5000,
// 16 bits, 8 bits for "clk_seq_hi_res",
// 8 bits for "clk_seq_low",
// two most significant bits holds zero and one for variant DCE1.1
(hexdec(substr($hash, 16, 4)) & 0x3fff) | 0x8000,
// 48 bits for "node"
substr($hash, 20, 12)
);
}
public static function is_valid($uuid)
{
return preg_match('/^\{?[0-9a-f]{8}\-?[0-9a-f]{4}\-?[0-9a-f]{4}\-?' .
'[0-9a-f]{4}\-?[0-9a-f]{12}\}?$/i', $uuid) === 1;
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Service/CryptoCurrency/CryptoComparePriceFetcher.php | src/Service/CryptoCurrency/CryptoComparePriceFetcher.php | <?php
declare(strict_types=1);
namespace CliFyi\Service\CryptoCurrency;
use CliFyi\Service\Env;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\GuzzleException;
use InvalidArgumentException;
class CryptoComparePriceFetcher implements PriceFetchInterface
{
const API_KEY_ENV_NAME = 'CRYPTOCOMPARE_KEY';
const API_END_POINT = 'https://min-api.cryptocompare.com/data/price?fsym=%s&tsyms=%s&api_key=%s';
const HTTP_STATUS_OK = 200;
/** @var ClientInterface */
private $client;
/** @var array */
private static $availableFiatCurrencies = [
'USD' => '$',
'EUR' => '€',
'GBP' => '£',
'AUD' => '$',
'CAD' => '$',
'BRL' => 'R$',
'CHF' => 'CHF',
'CLP' => '$',
'CNY' => '¥',
'DKK' => 'kr',
'HKD' => '$',
'INR' => '₹',
'ISK' => 'kr',
'JPY' => '¥',
'KRW' => '₩',
'NZD' => '$',
'PLN' => 'zł',
'RUB' => 'RUB',
'SEK' => 'kr',
'SGD' => '$',
'THB' => '฿',
'TWD' => 'NT$'
];
/** @var string */
private $cryptoCurrency;
/** @var Env */
private $env;
/**
* @param ClientInterface $client
* @param Env $env
*/
public function __construct(ClientInterface $client, Env $env)
{
$this->client = $client;
$this->env = $env;
}
/**
* @param string $cryptoCurrency
*
* @return array
*/
public function getPrices(string $cryptoCurrency): array
{
$this->cryptoCurrency = $cryptoCurrency;
$result = [];
if ($prices = $this->fetchPrices()) {
foreach ($prices as $currency => $price) {
$result[$currency . ' (' . self::getAvailableFiatCurrencies()[$currency] . ')'] = $price;
}
}
return $result;
}
/**
* @param string $jsonBody
*
* @return array
*/
private function formatResponse(string $jsonBody): array
{
try {
$responseArray = \GuzzleHttp\json_decode($jsonBody, true);
} catch (InvalidArgumentException $exception) {
return [];
}
return $responseArray;
}
/**
* @return array
*/
public static function getAvailableFiatCurrencies(): array
{
return self::$availableFiatCurrencies;
}
/**
* @return array
*/
private function fetchPrices(): array
{
try {
$response = $this->client->request('GET', $this->buildEndpointUrl());
} catch (GuzzleException $e) {
return [];
}
if ($response->getStatusCode() === self::HTTP_STATUS_OK) {
return $this->formatResponse($response->getBody()->getContents());
}
return [];
}
/**
* @return string
*/
private function buildEndpointUrl(): string
{
return sprintf(
self::API_END_POINT,
strtoupper($this->cryptoCurrency),
implode(',', array_keys(self::getAvailableFiatCurrencies())),
$this->env->getStringValue(self::API_KEY_ENV_NAME)
);
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Service/CryptoCurrency/PriceFetchInterface.php | src/Service/CryptoCurrency/PriceFetchInterface.php | <?php
declare(strict_types=1);
namespace CliFyi\Service\CryptoCurrency;
interface PriceFetchInterface
{
/**
* @param string $cryptoCurrency
*
* @return array [['USD' => '7666.4']]
*/
public function getPrices(string $cryptoCurrency): array;
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Service/Client/ClientParserInterface.php | src/Service/Client/ClientParserInterface.php | <?php
declare(strict_types=1);
namespace CliFyi\Service\Client;
interface ClientParserInterface
{
/**
* @return string
*/
public function getBrowserName(): ?string;
/**
* @return string
*/
public function getOperatingSystemName(): ?string;
/**
* @return string
*/
public function getUserAgent(): ?string ;
/**
* @return string
*/
public function getIpAddress(): ?string ;
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Service/Client/ClientParser.php | src/Service/Client/ClientParser.php | <?php
namespace CliFyi\Service\Client;
use Psr\Http\Message\RequestInterface;
use WhichBrowser\Parser;
class ClientParser implements ClientParserInterface
{
/** @var Parser */
private $clientParser;
/** @var RequestInterface */
private $request;
/**
* @param RequestInterface $request
* @param Parser $clientParser
*/
public function __construct(RequestInterface $request, Parser $clientParser)
{
$this->request = $request;
$this->clientParser = $clientParser;
$this->clientParser->analyse($this->getUserAgent());
}
/**
* @return string
*/
public function getBrowserName(): ?string
{
return $this->clientParser->browser->toString();
}
/**
* @return string
*/
public function getOperatingSystemName(): ?string
{
return $this->clientParser->os->toString();
}
/**
* @return string
*/
public function getUserAgent(): ?string
{
return $this->request->getHeaderLine('HTTP_USER_AGENT');
}
/**
* @return string
*/
public function getIpAddress(): ?string
{
return $this->request->getAttribute('ip_address') ?: $_SERVER['REMOTE_ADDR'];
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Service/IpAddress/GeoIpProvider.php | src/Service/IpAddress/GeoIpProvider.php | <?php
declare(strict_types=1);
namespace CliFyi\Service\IpAddress;
use Exception;
use GeoIp2\Database\Reader;
class GeoIpProvider implements IpAddressInfoProviderInterface
{
private const ASN_DATABASE = __DIR__ . '/../../../data/geoip/GeoLite2-ASN.mmdb';
private const CITY_DATABASE = __DIR__ . '/../../../data/geoip/GeoLite2-City.mmdb';
/** @var $ipAddress */
private $ipAddress;
/** @var Reader */
private $cityReader;
/** @var Reader */
private $asnReader;
/**
* @param string $ipAddress
*/
public function setIpAddress(string $ipAddress): void
{
$this->ipAddress = $ipAddress;
}
/**
* @return null|string
*/
public function getOrganisation(): ?string
{
try {
$record = $this->getAsnReader()->asn($this->ipAddress);
} catch (Exception $e) {
return null;
}
return $record->autonomousSystemOrganization;
}
/**
* @return null|string
*/
public function getCity(): ?string
{
return $this->getCityRecord('city');
}
/**
* @return null|string
*/
public function getCountry(): ?string
{
return $this->getCityRecord('country');
}
/**
* @return null|string
*/
public function getCountryCode(): ?string
{
return $this->getCityRecord('countryCode');
}
/**
* @return null|string
*/
public function getLatitude(): ?string
{
return $this->getCityRecord('latitude');
}
/**
* @return null|string
*/
public function getLongitude(): ?string
{
return $this->getCityRecord('longitude');
}
/**
* @return null|string
*/
public function getContinent(): ?string
{
return $this->getCityRecord('continent');
}
/**
* @return Reader
*/
private function getCityReader(): Reader
{
if ($this->cityReader instanceof Reader) {
return $this->cityReader;
}
$this->cityReader = new Reader(self::CITY_DATABASE);
return $this->cityReader;
}
/**
* @return Reader
*/
private function getAsnReader(): Reader
{
if ($this->asnReader instanceof Reader) {
return $this->asnReader;
}
$this->asnReader = new Reader(self::ASN_DATABASE);
return $this->asnReader;
}
/**
* @param string $recordType
*
* @return null|string
*/
private function getCityRecord(string $recordType): ?string
{
try {
$record = $this->getCityReader()->city($this->ipAddress);
} catch (Exception $e) {
return null;
}
switch ($recordType) {
case 'latitude':
return (string)$record->location->latitude;
case 'longitude':
return (string)$record->location->longitude;
case 'country':
return (string)$record->country->name;
case 'countryCode':
return (string)$record->country->isoCode;
case 'city':
return (string)$record->city->name;
case 'continent':
return (string)$record->continent->name;
default:
return null;
}
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Service/IpAddress/IpAddressInfoProviderInterface.php | src/Service/IpAddress/IpAddressInfoProviderInterface.php | <?php
declare(strict_types=1);
namespace CliFyi\Service\IpAddress;
interface IpAddressInfoProviderInterface
{
/**
* @param string $ipAddress
*/
public function setIpAddress(string $ipAddress): void;
/**
* @return null|string
*/
public function getCity(): ?string;
/**
* @return null|string
*/
public function getCountry(): ?string;
/**
* @return null|string
*/
public function getCountryCode(): ?string;
/**
* @return null|string
*/
public function getContinent(): ?string;
/**
* @return null|string
*/
public function getOrganisation(): ?string;
/**
* @return null|string
*/
public function getLatitude(): ?string;
/**
* @return null|string
*/
public function getLongitude(): ?string;
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Service/Hash/HasherService.php | src/Service/Hash/HasherService.php | <?php
namespace CliFyi\Service\Hash;
class HasherService implements HasherInterface
{
/** @var array */
private $hashedKeyValues = [];
/**
* @param string $stringToHash
*
* @return array
*/
public function getHashValuesFromString(string $stringToHash): array
{
foreach (hash_algos() as $algo) {
$hash = hash($algo, $stringToHash, false);
$this->hashedKeyValues[$algo] = $hash;
}
return $this->hashedKeyValues;
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Service/Hash/HasherInterface.php | src/Service/Hash/HasherInterface.php | <?php
namespace CliFyi\Service\Hash;
interface HasherInterface
{
/**
* @param string $stringToHash
*
* @return array eg. ['md5' => '86fb269d190d2c85f6e0468ceca42a20', 'sha1' => '...']
*/
public function getHashValuesFromString(string $stringToHash): array;
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Service/DomainName/DomainNameServiceProvider.php | src/Service/DomainName/DomainNameServiceProvider.php | <?php
namespace CliFyi\Service\DomainName;
class DomainNameServiceProvider implements DomainNameServiceProviderInterface
{
private const DIG_QUERY = 'dig +nocmd %s %s +multiline +noall +answer';
private const WHOIS_QUERY = 'whois %s';
private const DNS_TYPES = [
'DNSKEY',
'MX',
'A',
'AAAA',
'NS',
'SOA',
'TXT',
];
/**
* @param string $hostName
*
* @return array
*/
public function getDnsData(string $hostName): array
{
$data = [];
foreach (self::DNS_TYPES as $dnsType) {
if ($dnsResult = shell_exec(sprintf(self::DIG_QUERY, escapeshellarg(trim($hostName)), $dnsType))) {
$data[] = $dnsResult;
}
}
return explode(PHP_EOL, implode('', $data));
}
/**
* @param string $hostName
*
* @return array
*/
public function getWhoisData(string $hostName): array
{
$whoisResult = shell_exec(sprintf(self::WHOIS_QUERY, escapeshellarg(trim($hostName))));
return $whoisResult ? explode(PHP_EOL, $whoisResult) : [];
}
/**
* @return array
*/
public static function getDnsTypes()
{
return self::DNS_TYPES;
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Service/DomainName/DomainNameServiceProviderInterface.php | src/Service/DomainName/DomainNameServiceProviderInterface.php | <?php
declare(strict_types=1);
namespace CliFyi\Service\DomainName;
interface DomainNameServiceProviderInterface
{
/**
* @param string $hostName
*
* @return array
*/
public function getDnsData(string $hostName): array;
/**
* @param string $hostName
*
* @return array
*/
public function getWhoisData(string $hostName): array;
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Service/Media/MediaExtractor.php | src/Service/Media/MediaExtractor.php | <?php
declare(strict_types=1);
namespace CliFyi\Service\Media;
use Embed\Adapters\Adapter;
use Embed\Embed;
use Exception;
class MediaExtractor implements MediaExtractorInterface
{
/** @var Adapter */
private $extractedData;
/**
* @param string $url
*
* @return array
*/
public function extract(string $url): array
{
try {
$this->extractedData = Embed::create($url);
} catch (Exception $exception) {
return [];
}
return $this->getExtractedValues();
}
/**
* @return array
*/
private function getExtractedValues(): array
{
if ($this->extractedData::check($this->extractedData->getResponse())) {
return [
'title' => $this->extractedData->title,
'description' => $this->extractedData->description,
'url' => $this->extractedData->url,
'type' => $this->extractedData->type,
'tags' => $this->extractedData->tags,
'images' => $this->extractedData->images,
'image' => $this->extractedData->image,
'imageWidth' => $this->extractedData->imageWidth,
'imageHeight' => $this->extractedData->imageHeight,
'code' => $this->extractedData->code,
'width' => $this->extractedData->width,
'height' => $this->extractedData->height,
'aspectRatio' => $this->extractedData->aspectRatio,
'authorName' => $this->extractedData->authorName,
'authorUrl' => $this->extractedData->authorUrl,
'providerName' => $this->extractedData->providerName,
'providerUrl' => $this->extractedData->providerUrl,
'providerIcons' => $this->extractedData->providerIcons,
'providerIcon' => $this->extractedData->providerIcon,
'publishedDate' => $this->extractedData->publishedDate,
'license' => $this->extractedData->license,
'linkedData' => $this->extractedData->linkedData,
'feeds' => $this->extractedData->feeds
];
}
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/src/Service/Media/MediaExtractorInterface.php | src/Service/Media/MediaExtractorInterface.php | <?php
declare(strict_types=1);
namespace CliFyi\Service\Media;
interface MediaExtractorInterface
{
/**
* @param string $url
*
* @return array
*/
public function extract(string $url): array;
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Builder/ResponseBuilderTest.php | tests/unit/Builder/ResponseBuilderTest.php | <?php
namespace Test\Builder;
use CliFyi\Builder\ResponseBuilder;
use GuzzleHttp\Psr7\Response;
use Mockery;
use PHPUnit\Framework\TestCase;
class ResponseBuilderTest extends TestCase
{
/** @var ResponseBuilder */
private $responseBuilder;
protected function setUp()
{
parent::setUp();
$this->responseBuilder = new ResponseBuilder();
}
public function testBuildResponse()
{
/** @var Response|Mockery\MockInterface $response */
$response = Mockery::mock(Response::class);
$response->shouldReceive('withHeader')
->withArgs(['key', 'value'])
->andReturn($response);
$response->shouldReceive('withJson')
->withArgs([
['some' => 'data'],
200,
JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_LINE_TERMINATORS
])
->andReturn($response);
$builtResponse = $this->responseBuilder
->withResponse($response)
->withHeader('key', 'value')
->withJsonArray(['some' => 'data'])
->getBuiltResponse();
$this->assertSame($response, $builtResponse);
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Transformer/MediaTransformerTest.php | tests/unit/Transformer/MediaTransformerTest.php | <?php
namespace Test\Transformer;
use CliFyi\Transformer\MediaDataTransformer;
use PHPUnit\Framework\TestCase;
class MediaTransformerTest extends TestCase
{
/** @var MediaDataTransformer */
private $mediaTransformer;
protected function setUp()
{
parent::setUp();
$this->mediaTransformer = new MediaDataTransformer();
}
public function testTransformMedia()
{
$actual = $this->mediaTransformer->transform([
'empty' => '',
'title' => 'some title',
'tags' => [
'tag1',
'tag2'
],
'linkedData' => 'some-data',
'providerIcons' => 'unwanted icons'
]);
$expected = [
'title' => 'some title',
'tags' => 'tag1, tag2'
];
$this->assertSame($expected, $actual);
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Transformer/EmailDataTransformerTest.php | tests/unit/Transformer/EmailDataTransformerTest.php | <?php
namespace Test\Transformer;
use CliFyi\Transformer\EmailDataTransformer;
use PHPUnit\Framework\TestCase;
class EmailDataTransformerTest extends TestCase
{
public function testTransform()
{
$data = [];
$data['valid_mx_records'] = true;
$data['free_email_provider'] = true;
$data['disposable_email_provider'] = true;
$data['role_or_business_email'] = false;
$data['possible_email_correction'] = '';
$data['valid_host'] = true;
$expected = [
'validMxRecords' => $data['valid_mx_records'],
'freeProvider' => $data['free_email_provider'],
'disposableEmail' => $data['disposable_email_provider'],
'businessOrRoleEmail' => $data['role_or_business_email'],
'validHost' => $data['valid_host']
];
$actual = (new EmailDataTransformer())->transform($data);
$this->assertSame($expected, $actual);
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Value/SearchTermTest.php | tests/unit/Value/SearchTermTest.php | <?php
namespace Test\Value;
use CliFyi\Value\SearchTerm;
use PHPUnit\Framework\TestCase;
class SearchTermTest extends TestCase
{
const TEST_SEARCH_TERM = 'This-Is-A-test';
/** @var SearchTerm */
private $searchTerm;
protected function setUp()
{
parent::setUp();
$this->searchTerm = new SearchTerm(self::TEST_SEARCH_TERM);
}
public function testToLowerCase()
{
$this->assertSame(strtolower(self::TEST_SEARCH_TERM), $this->searchTerm->toLowerCaseString());
}
public function testToUpperCase()
{
$this->assertSame(strtoupper(self::TEST_SEARCH_TERM), $this->searchTerm->toUpperCaseString());
}
public function testToOriginal()
{
$this->assertSame(self::TEST_SEARCH_TERM, $this->searchTerm->toString());
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Handler/ClientInformationHandlerTest.php | tests/unit/Handler/ClientInformationHandlerTest.php | <?php
namespace Test\Handler;
use CliFyi\Handler\ClientInformationHandler;
use CliFyi\Handler\IpAddressHandler;
use CliFyi\Service\Client\ClientParserInterface;
use CliFyi\Service\IpAddress\IpAddressInfoProviderInterface;
use CliFyi\Value\SearchTerm;
use Mockery;
use Mockery\MockInterface;
class ClientInformationHandlerTest extends BaseHandlerTestCase
{
/** @var ClientParserInterface|MockInterface */
private $clientParser;
/** @var IpAddressInfoProviderInterface|MockInterface */
private $ipInfoService;
/** @var IpAddressHandler */
private $clientInfoHandler;
protected function setUp()
{
parent::setUp();
$this->clientParser = Mockery::mock(ClientParserInterface::class);
$this->ipInfoService = Mockery::mock(IpAddressInfoProviderInterface::class);
$this->clientInfoHandler = new ClientInformationHandler(
$this->clientParser,
$this->ipInfoService,
$this->cache
);
}
public function testGetHandlerName()
{
$this->assertSame('Client Information Query', $this->clientInfoHandler->getHandlerName());
}
public function testIsHandlerEligibleForValidKeywords()
{
foreach (['ME', 'me', 'self'] as $keyword) {
$this->assertTrue(ClientInformationHandler::ishandlerEligible((new SearchTerm($keyword))));
}
}
public function testIsHandlerEligibleForInvalidKeywords()
{
foreach (['not', 'valid', 'keywords'] as $keyword) {
$this->assertFalse(ClientInformationHandler::isHandlerEligible((new SearchTerm($keyword))));
}
}
public function testParseSearchTerm()
{
$this->clientParser->shouldReceive('getUserAgent')->andReturn('curl');
$this->clientParser->shouldReceive('getIpAddress')->andReturn('123.123.123.123');
$this->clientParser->shouldReceive('getBrowserName')->andReturn('curl');
$this->clientParser->shouldReceive('getOperatingSystemName')->andReturn('Linux');
$this->ipInfoService->shouldReceive('setIpAddress', '123.123.123.123')->andReturn();
$this->ipInfoService->shouldReceive('getOrganisation')->andReturn('Acme');
$this->ipInfoService->shouldReceive('getCountry')->andReturn('Ireland');
$this->ipInfoService->shouldReceive('getCountryCode')->andReturn('IE');
$this->ipInfoService->shouldReceive('getCity')->andReturn('Dublin');
$this->ipInfoService->shouldReceive('getContinent')->andReturn('Europe');
$this->ipInfoService->shouldReceive('getLatitude')->andReturn('123');
$this->ipInfoService->shouldReceive('getLongitude')->andReturn('123');
$expected = [
'iPAddress' => '123.123.123.123',
'userAgent' => 'curl',
'browser' => 'curl',
'operatingSystem' => 'Linux',
'iPAddressInfo' => [
'organisation' => 'Acme',
'country' => 'Ireland',
'countryCode' => 'IE',
'city' => 'Dublin',
'continent' => 'Europe',
'latitude' => '123',
'longitude' => '123'
]
];
$this->assertSame($expected, $this->clientInfoHandler->processSearchTerm((new SearchTerm('me'))));
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Handler/ProgrammingLanguageHandlerTest.php | tests/unit/Handler/ProgrammingLanguageHandlerTest.php | <?php
namespace Test\Handler;
use CliFyi\Handler\ProgrammingLanguageHandler;
use CliFyi\Value\SearchTerm;
class ProgrammingLanguageHandlerTest extends BaseHandlerTestCase
{
/** @var ProgrammingLanguageHandler */
private $programmingLanguageHandler;
protected function setUp()
{
parent::setUp();
$this->programmingLanguageHandler = new ProgrammingLanguageHandler($this->cache);
}
public function testGetHandlerName()
{
$this->assertSame('Programming Language Links', $this->programmingLanguageHandler->getHandlerName());
}
public function testIsHandlerEligibleForValidKeywords()
{
foreach (['PhP', 'php', 'java', 'javascript', 'JAVAscRipt'] as $keyword) {
$this->assertTrue(ProgrammingLanguageHandler::ishandlerEligible((new SearchTerm($keyword))));
}
}
public function testIsHandlerEligibleForInvalidKeywords()
{
foreach (['not', 'valid', 'keywords'] as $keyword) {
$this->assertFalse(ProgrammingLanguageHandler::ishandlerEligible((new SearchTerm($keyword))));
}
}
public function testProcessSearchTerm()
{
$data = $this->programmingLanguageHandler->processSearchTerm((new SearchTerm('php')));
$this->assertArrayHasKey('documentation', $data);
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Handler/DomainNameHandlerTest.php | tests/unit/Handler/DomainNameHandlerTest.php | <?php
namespace Test\Handler;
use CliFyi\Handler\DomainNameHandler;
use CliFyi\Service\DomainName\DomainNameServiceProviderInterface;
use CliFyi\Value\SearchTerm;
use Mockery;
use Mockery\MockInterface;
class DomainNameHandlerTest extends BaseHandlerTestCase
{
/** @var DomainNameServiceProviderInterface|MockInterface */
private $serviceProvider;
/** @var DomainNameHandler */
private $domainNameHandler;
protected function setUp()
{
parent::setUp();
$this->serviceProvider = Mockery::mock(DomainNameServiceProviderInterface::class);
$this->domainNameHandler = new DomainNameHandler($this->serviceProvider, $this->cache, $this->transformer);
}
public function testGetHandlerName()
{
$this->assertSame('Domain Name Information', $this->domainNameHandler->getHandlerName());
}
public function testProcessSearchTerm()
{
$domain = 'google.com';
$expectedWhois = [
'some who is info'
];
$expectedDns = [
'some DNS is info'
];
$expectedResult = [
'whois' => $expectedWhois,
'dns' => $expectedDns
];
$this->serviceProvider
->shouldReceive('getWhoisData', $domain)
->andReturn($expectedWhois);
$this->serviceProvider
->shouldReceive('getDnsData', $domain)
->andReturn($expectedDns);
$actual = $this->domainNameHandler->processSearchTerm((new SearchTerm($domain)));
$this->assertSame($expectedResult, $actual);
}
/**
* @dataProvider eligibleHandlerDataProvider
*
* @param mixed $actual
* @param bool $expected
*/
public function testIsEligibleHandler($actual, $expected)
{
$this->assertSame(DomainNameHandler::ishandlerEligible((new SearchTerm($actual))), $expected);
}
/**
* @return array
*/
public function eligibleHandlerDataProvider()
{
return [
['dave.com', true],
['cli.fyi', true],
['CAPS.com', true],
['cli.fyi.com', true],
['dave+hello@yahoo.com', false],
['@notanemail.com', false],
['---^@ yahoo.com', false],
[1234, false]
];
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Handler/HelpHandlerTest.php | tests/unit/Handler/HelpHandlerTest.php | <?php
namespace Test\Handler;
use CliFyi\Handler\HelpHandler;
use CliFyi\Value\SearchTerm;
class HelpHandlerTest extends BaseHandlerTestCase
{
/** @var HelpHandler */
private $helpHandler;
protected function setUp()
{
parent::setUp();
$this->helpHandler = new HelpHandler($this->cache);
}
public function testIsHandlerEligible()
{
$this->assertTrue(HelpHandler::ishandlerEligible((new SearchTerm('help'))));
}
public function testHandlerName()
{
$this->assertSame('Help', $this->helpHandler->getHandlerName());
}
public function testProcessSearchTerm()
{
$actual = $this->helpHandler->processSearchTerm((new SearchTerm('help')));
$this->assertArrayHasKey('IP Address Query', $actual);
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Handler/DateTimeHandlerTest.php | tests/unit/Handler/DateTimeHandlerTest.php | <?php
namespace Test\Handler;
use CliFyi\Handler\DateTimeHandler;
use CliFyi\Value\SearchTerm;
class DateTimeHandlerTest extends BaseHandlerTestCase
{
/** @var DateTimeHandler */
private $dateTimeHandler;
protected function setUp()
{
parent::setUp();
$this->dateTimeHandler = new DateTimeHandler($this->cache);
}
public function testGetHandlerName()
{
$this->assertSame('Date/Time Information (UTC)', $this->dateTimeHandler->getHandlerName());
}
public function testIsHandlerEligibleForValidKeywords()
{
foreach (DateTimeHandler::KEYWORDS as $keyword) {
$this->assertTrue(DateTimeHandler::ishandlerEligible((new SearchTerm($keyword))));
}
}
public function testIsHandlerEligibleForInvalidKeywords()
{
foreach (['not', 'valid', 'keywords'] as $keyword) {
$this->assertFalse(DateTimeHandler::ishandlerEligible((new SearchTerm($keyword))));
}
}
public function testProcessSearchTerm()
{
$data = $this->dateTimeHandler->processSearchTerm((new SearchTerm('time')));
$this->assertArrayHasKey('day', $data);
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Handler/EmailHandlerTest.php | tests/unit/Handler/EmailHandlerTest.php | <?php
namespace Test\Handler;
use CliFyi\Handler\EmailHandler;
use CliFyi\Transformer\EmailDataTransformer;
use CliFyi\Value\SearchTerm;
use EmailValidation\EmailValidator;
use EmailValidation\EmailValidatorFactory;
use EmailValidation\ValidationResults;
use Mockery;
class EmailHandlerTest extends BaseHandlerTestCase
{
/** @var EmailDataTransformer|Mockery\MockInterface */
private $emailTransformer;
/** @var EmailValidatorFactory|Mockery\MockInterface */
private $emailDataExtractor;
/** @var EmailHandler */
private $emailHandler;
protected function setUp()
{
parent::setUp();
$this->emailTransformer = Mockery::mock(EmailDataTransformer::class);
$this->emailDataExtractor = Mockery::mock('alias:' . EmailValidatorFactory::class);
$this->emailHandler = new EmailHandler($this->cache, $this->emailTransformer, $this->emailDataExtractor);
}
public function testGetHandlerName()
{
$this->assertSame('Email Address Query', $this->emailHandler->getHandlerName());
}
public function testProcessSearchTerms()
{
$expected = [
'validEmail' => true
];
$emailValidator = Mockery::mock(EmailValidator::class);
$validationResults = Mockery::mock(ValidationResults::class);
$this->emailDataExtractor
->shouldReceive('create', 'dave@test.com')
->andReturn($emailValidator);
$emailValidator
->shouldReceive('getValidationResults')
->andReturn($validationResults);
$validationResults
->shouldReceive('hasResults')
->andReturn(true);
$validationResults
->shouldReceive('asArray')
->andReturn($expected);
$actual = $this->emailHandler->processSearchTerm((new SearchTerm('dave@test.com')));
$this->assertSame($expected, $actual);
}
/**
* @dataProvider eligibleHandlerDataProvider
*
* @param mixed $actual
* @param bool $expected
*/
public function testIsEligibleHandler($actual, $expected)
{
$this->assertSame(EmailHandler::ishandlerEligible((new SearchTerm($actual))), $expected);
}
/**
* @return array
*/
public function eligibleHandlerDataProvider()
{
return [
['dave@email.com', true],
['email@something.ie', true],
['CAPS@something.ie', true],
['dave+hello@yahoo.com', true],
['@notanemail.com', false],
['---^@ yahoo.com', false],
['dave+hello @ yahoo.com', false]
];
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Handler/MediaHandlerTest.php | tests/unit/Handler/MediaHandlerTest.php | <?php
namespace Test\Handler;
use CliFyi\Handler\MediaHandler;
use CliFyi\Service\Media\MediaExtractorInterface;
use CliFyi\Transformer\MediaDataTransformer;
use CliFyi\Value\SearchTerm;
use Mockery;
class MediaHandlerTest extends BaseHandlerTestCase
{
/** @var MediaExtractorInterface|Mockery\MockInterface */
private $mediaExtractor;
/** @var MediaDataTransformer|Mockery */
private $mediaTransformer;
/** @var MediaHandler */
private $mediaHandler;
protected function setUp()
{
parent::setUp();
$this->mediaExtractor = Mockery::mock(MediaExtractorInterface::class);
$this->mediaTransformer = Mockery::mock(MediaDataTransformer::class);
$this->mediaHandler = new MediaHandler($this->cache, $this->mediaTransformer, $this->mediaExtractor);
}
public function testGetName()
{
$this->assertSame('Media', $this->mediaHandler->getHandlerName());
}
/**
* @dataProvider eligibleHandlerDataProvider
*/
public function testIsEligibleHandler($actual, $expected)
{
$this->assertSame(MediaHandler::ishandlerEligible((new SearchTerm($actual))), $expected);
}
public function testSetHandler()
{
$this->mediaExtractor->shouldReceive('extract', 'http://dave.com')->andReturn([
'providerName' => 'Dave'
]);
$this->mediaHandler->processSearchTerm((new SearchTerm('http://dave.com')));
$this->assertSame('Dave URL', $this->mediaHandler->getHandlerName());
}
public function testProcessSearchTerm()
{
$expected = ['providerName' => 'Testy Mc Test', 'some' => 'data'];
$this->mediaExtractor->shouldReceive('extract', 'http://dave.com')->andReturn($expected);
$actual = $this->mediaHandler->processSearchTerm((new SearchTerm('http://dave.com')));
$this->assertSame($expected, $actual);
}
/**
* @return array
*/
public function eligibleHandlerDataProvider()
{
return [
['https://www.youtube.com/watch?v=bgmiLMVAG7g', true],
['https://youtu.be/meCZ5hWNRFU', true],
['https://YOUTUBE.me/meCZ5hWNRFU', true],
['https://vimeo.com/213421', true],
['vimeo.com/213421', false],
['not good', false],
[12, false]
];
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Handler/EmojiHandlerTest.php | tests/unit/Handler/EmojiHandlerTest.php | <?php
namespace Test\Handler;
use CliFyi\Handler\EmojiHandler;
use CliFyi\Value\SearchTerm;
class EmojiHandlerTest extends BaseHandlerTestCase
{
/** @var EmojiHandler */
private $emojiHandler;
protected function setUp()
{
parent::setUp();
$this->emojiHandler = new EmojiHandler($this->cache);
}
public function testGetHandlerName()
{
$this->assertSame('Popular Emojis', $this->emojiHandler->getHandlerName());
}
public function testIsHandlerEligibleForValidKeywords()
{
foreach (EmojiHandler::EMOJI_KEYWORDS as $keyword) {
$this->assertTrue(EmojiHandler::ishandlerEligible((new SearchTerm($keyword))));
}
}
public function testIsHandlerEligibleForInvalidKeywords()
{
foreach (['not', 'valid', 'keywords'] as $keyword) {
$this->assertFalse(EmojiHandler::ishandlerEligible((new SearchTerm($keyword))));
}
}
public function testProcessSearchTerm()
{
$data = $this->emojiHandler->processSearchTerm((new SearchTerm('emoji')));
$this->assertArrayHasKey('rofl', $data);
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Handler/CountryHandlerTest.php | tests/unit/Handler/CountryHandlerTest.php | <?php
namespace Test\Handler;
use CliFyi\Handler\CountryHandler;
use CliFyi\Value\SearchTerm;
class CountryHandlerTest extends BaseHandlerTestCase
{
/** @var CountryHandler */
private $countryHandler;
protected function setUp()
{
parent::setUp();
$this->countryHandler = new CountryHandler($this->cache);
}
public function testGetName()
{
$this->assertSame('Country Query', $this->countryHandler->getHandlerName());
}
public function testProcessSearchTerm()
{
$data = $this->countryHandler->processSearchTerm((new SearchTerm('Ireland')));
$this->assertSame('Ireland', $data['name']['common']);
}
public function testIsEligibleCountryForValidCountry()
{
$this->assertTrue(CountryHandler::ishandlerEligible((new SearchTerm('Ireland'))));
}
public function testIsEligibleCountryForValidCountryWithSpaces()
{
$this->assertTrue(CountryHandler::ishandlerEligible((new SearchTerm('UNITED-STATES'))));
}
public function testIsEligibleCountryForInvalidCountry()
{
$this->assertFalse(CountryHandler::ishandlerEligible((new SearchTerm('Magicland'))));
}
public function testGetData()
{
$data = $this->countryHandler->processSearchTerm((new SearchTerm('Ireland')));
$this->assertArrayHasKey('name', $data);
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Handler/IpAddressHandlerTest.php | tests/unit/Handler/IpAddressHandlerTest.php | <?php
namespace Test\Handler;
use CliFyi\Handler\IpAddressHandler;
use CliFyi\Service\IpAddress\IpAddressInfoProviderInterface;
use CliFyi\Value\SearchTerm;
use Mockery;
use Mockery\MockInterface;
class IpAddressHandlerTest extends BaseHandlerTestCase
{
/** @var IpAddressInfoProviderInterface|MockInterface */
private $ipAddressService;
/** @var IpAddressHandler */
private $ipHandler;
public function setUp()
{
parent::setUp();
$this->ipAddressService = Mockery::mock(IpAddressInfoProviderInterface::class);
$this->ipHandler = new IpAddressHandler($this->ipAddressService, $this->cache);
}
public function testGetHandlerName()
{
$this->assertSame('IP Address', $this->ipHandler->getHandlerName());
}
/**
* @dataProvider eligibleHandlerDataProvider
*
* @param mixed $actual
* @param bool $expected
*/
public function testIsEligibleHandler($actual, $expected)
{
$this->assertSame(IpAddressHandler::ishandlerEligible((new SearchTerm($actual))), $expected);
}
public function testProcessSearchTerm()
{
$this->ipAddressService->shouldReceive('setIpAddress', '8.8.8.8')->andReturn();
$this->ipAddressService->shouldReceive('getOrganisation')->andReturn('Google');
$this->ipAddressService->shouldReceive('getCountry')->andReturn('Ireland');
$this->ipAddressService->shouldReceive('getCountryCode')->andReturn('IE');
$this->ipAddressService->shouldReceive('getCity')->andReturn('Dublin');
$this->ipAddressService->shouldReceive('getContinent')->andReturn('Europe');
$this->ipAddressService->shouldReceive('getLatitude')->andReturn('123');
$this->ipAddressService->shouldReceive('getLongitude')->andReturn('123');
$this->assertSame([
'organisation' => 'Google',
'country' => 'Ireland',
'countryCode' => 'IE',
'city' => 'Dublin',
'continent' => 'Europe',
'latitude' => '123',
'longitude' => '123'
], $this->ipHandler->processSearchTerm((new SearchTerm('8.8.8.8'))));
}
public function testPrivateIpAddress()
{
$this->ipAddressService->shouldReceive('setIpAddress', '192.168.2.1')->andReturn();
$this->ipAddressService->shouldReceive('getOrganisation')->andReturn(null);
$this->ipAddressService->shouldReceive('getCountry')->andReturn(null);
$this->ipAddressService->shouldReceive('getCountryCode')->andReturn(null);
$this->ipAddressService->shouldReceive('getCity')->andReturn(null);
$this->ipAddressService->shouldReceive('getContinent')->andReturn(null);
$this->ipAddressService->shouldReceive('getLatitude')->andReturn(null);
$this->ipAddressService->shouldReceive('getLongitude')->andReturn(null);
$this->assertSame(
[
'isIpInPrivateRange' => true
],
$this->ipHandler->processSearchTerm((new SearchTerm('192.168.2.1')))
);
}
public function testReservedIpAddress()
{
$this->ipAddressService->shouldReceive('setIpAddress', '0.0.0.6')->andReturn();
$this->ipAddressService->shouldReceive('getOrganisation')->andReturn(null);
$this->ipAddressService->shouldReceive('getCountry')->andReturn(null);
$this->ipAddressService->shouldReceive('getCountryCode')->andReturn(null);
$this->ipAddressService->shouldReceive('getCity')->andReturn(null);
$this->ipAddressService->shouldReceive('getContinent')->andReturn(null);
$this->ipAddressService->shouldReceive('getLatitude')->andReturn(null);
$this->ipAddressService->shouldReceive('getLongitude')->andReturn(null);
$this->assertSame(
[
'isIpInReservedRange' => true
],
$this->ipHandler->processSearchTerm((new SearchTerm('0.0.0.6')))
);
}
/**
* @return array
*/
public function eligibleHandlerDataProvider()
{
return [
['8.8.8.8', true],
['109.123.1.102', true],
['127.0.0.1', true],
['192.168.2.1', true],
['10.0.0.1', true],
['123.2.3', false],
['hello.12.3.3', false],
[12, false]
];
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Handler/BaseHandlerTestCase.php | tests/unit/Handler/BaseHandlerTestCase.php | <?php
namespace Test\Handler;
use CliFyi\Transformer\TransformerInterface;
use Mockery;
use PHPUnit\Framework\TestCase;
use Psr\SimpleCache\CacheInterface;
abstract class BaseHandlerTestCase extends TestCase
{
/** @var CacheInterface|Mockery\MockInterface */
protected $cache;
/** @var TransformerInterface|Mockery\MockInterface */
protected $transformer;
protected function setUp()
{
parent::setUp();
$this->cache = Mockery::mock(CacheInterface::class);
$this->transformer = Mockery::mock(TransformerInterface::class);
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Handler/HashHandlerTest.php | tests/unit/Handler/HashHandlerTest.php | <?php
namespace Test\Handler;
use CliFyi\Handler\AbstractHandler;
use CliFyi\Handler\HashHandler;
use CliFyi\Service\Hash\HasherInterface;
use CliFyi\Value\SearchTerm;
use Mockery;
class HashHandlerTest extends BaseHandlerTestCase
{
/** @var HasherInterface|Mockery\MockInterface */
private $hashService;
/** @var AbstractHandler */
private $hashHandler;
protected function setUp()
{
parent::setUp();
$this->hashService = Mockery::mock(HasherInterface::class);
$this->hashHandler = new HashHandler($this->cache, $this->hashService);
}
public function testGetHandlerName()
{
$this->assertSame('String Hash Values For: ', $this->hashHandler->getHandlerName());
}
public function testIsHandlerEligibleForValidKeywords()
{
$this->assertTrue(HashHandler::isHandlerEligible((new SearchTerm(HashHandler::TRIGGER_KEYWORD))));
}
public function testIsHandlerEligibleForInvalidKeywords()
{
foreach (['not', 'valid', 'keywords'] as $keyword) {
$this->assertFalse(HashHandler::ishandlerEligible((new SearchTerm($keyword))));
}
}
public function testParseSearchTerm()
{
$expected = [
'md5' => '...',
'sha1' => '...'
];
$this->hashService->shouldReceive('getHashValuesFromString')->andReturn($expected);
$this->assertSame($expected, $this->hashHandler->processSearchTerm((new SearchTerm(HashHandler::TRIGGER_KEYWORD))));
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Factory/HandlerFactoryTest.php | tests/unit/Factory/HandlerFactoryTest.php | <?php
namespace Test\Factory;
use CliFyi\Factory\HandlerFactory;
use CliFyi\Handler\ClientInformationHandler;
use CliFyi\Handler\CountryHandler;
use CliFyi\Handler\CryptoCurrencyHandler;
use CliFyi\Handler\DateTimeHandler;
use CliFyi\Handler\DomainNameHandler;
use CliFyi\Handler\EmojiHandler;
use CliFyi\Handler\HashHandler;
use CliFyi\Handler\HelpHandler;
use CliFyi\Handler\IpAddressHandler;
use CliFyi\Handler\MediaHandler;
use CliFyi\Handler\ProgrammingLanguageHandler;
use CliFyi\Service\Client\ClientParser;
use CliFyi\Service\CryptoCurrency\CryptoComparePriceFetcher;
use CliFyi\Service\DomainName\DomainNameServiceProvider;
use CliFyi\Service\Hash\HasherInterface;
use CliFyi\Service\IpAddress\GeoIpProvider;
use CliFyi\Service\Media\MediaExtractor;
use CliFyi\Transformer\CountryDataTransformer;
use CliFyi\Transformer\DomainNameDataTransformer;
use CliFyi\Transformer\MediaDataTransformer;
use Mockery;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerInterface;
use Psr\SimpleCache\CacheInterface;
class HandlerFactoryTest extends TestCase
{
/** @var ContainerInterface|Mockery\MockInterface */
private $container;
/** @var HandlerFactory */
private $handlerFactory;
protected function setUp()
{
parent::setUp();
$this->container = Mockery::mock(ContainerInterface::class);
$this->handlerFactory = new HandlerFactory($this->container);
}
/**
* @param string $objectName
* @param array $expectedArguments
*
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*
* @dataProvider handlerFactoryDataProvider
*/
public function testCreate($objectName, $expectedArguments)
{
foreach ($expectedArguments as $expectedArgument) {
$mock = Mockery::mock($expectedArgument);
$this->container
->shouldReceive('get')
->with($expectedArgument)
->andReturn($mock);
}
$actual = $this->handlerFactory->create($objectName);
$this->assertInstanceOf($objectName, $actual);
}
/**
* @expectedException CliFyi\Exception\InvalidHandlerException
*/
public function testCreateWithInvalidString()
{
$this->handlerFactory->create('not a valid handler');
}
public function testGetAvailableHandler()
{
$this->assertContains(DateTimeHandler::class, $this->handlerFactory->getAvailableHandlers());
}
/**
* @return array
*/
public function handlerFactoryDataProvider(): array
{
return [
[
IpAddressHandler::class,
[GeoIpProvider::class, CacheInterface::class]
],
[
ClientInformationHandler::class,
[ClientParser::class, GeoIpProvider::class, CacheInterface::class]
],
[
DomainNameHandler::class,
[DomainNameDataTransformer::class, DomainNameServiceProvider::class, CacheInterface::class]
],
[
EmojiHandler::class,
[CacheInterface::class]
],
[
MediaHandler::class,
[MediaDataTransformer::class, MediaExtractor::class, CacheInterface::class]
],
[
DateTimeHandler::class,
[CacheInterface::class]
],
[
DateTimeHandler::class,
[CacheInterface::class]
],
[
CryptoCurrencyHandler::class,
[CacheInterface::class, CryptoComparePriceFetcher::class]
],
[
CountryHandler::class,
[CacheInterface::class, CountryDataTransformer::class]
],
[
ProgrammingLanguageHandler::class,
[CacheInterface::class]
],
[
HelpHandler::class,
[CacheInterface::class]
],
[
HashHandler::class,
[CacheInterface::class, HasherInterface::class]
],
];
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/tests/unit/Service/Hash/HashServiceTest.php | tests/unit/Service/Hash/HashServiceTest.php | <?php
namespace Test\Service\Hash;
use CliFyi\Service\Hash\HasherInterface;
use CliFyi\Service\Hash\HasherService;
use PHPUnit\Framework\TestCase;
class HashServiceTest extends TestCase
{
/** @var HasherInterface */
private $hashService;
protected function setUp()
{
parent::setUp();
$this->hashService = new HasherService();
}
public function testHashValuesReturned()
{
$expectedKeys = [
'md4',
'md5',
'sha1'
];
$actualResult = $this->hashService->getHashValuesFromString('test string');
foreach ($expectedKeys as $expectedKey) {
$this->assertTrue(array_key_exists($expectedKey, $actualResult));
}
}
}
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/public/header-snippets.php | public/header-snippets.php | <?php
if ($googleAnalyticsId = getenv('GOOGLE_ANALYTICS_ID')) { ?>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=<?=$googleAnalyticsId?>"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', '<?=$googleAnalyticsId?>');
</script>
<?php } ?>
<script>window.twttr = (function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0],
t = window.twttr || {};
if (d.getElementById(id)) return t;
js = d.createElement(s);
js.id = id;
js.src = "https://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);
t._e = [];
t.ready = function(f) {
t._e.push(f);
};
return t;
}(document, "script", "twitter-wjs"));
</script>
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/public/index.php | public/index.php | <?php
use CliFyi\CliFyi;
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../bootstrap/environment.php';
// Container / General settings
$settings = require __DIR__ . '/../bootstrap/settings.php';
$dependencies = require __DIR__ . '/../bootstrap/dependencies.php';
$appConfiguration = array_merge($settings, $dependencies);
$app = new CliFyi($appConfiguration);
require __DIR__ . '/../bootstrap/middleware.php';
require __DIR__ . '/../bootstrap/routes.php';
$app->run();
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/public/homepage.php | public/homepage.php | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Cli.Fyi - A Potentially Useful Command Line Query Tool</title>
<meta name="description" content="Quickly get information about emails, IP addresses, URLs and lots more
from the command line (or Browser)">
<link href="https://fonts.googleapis.com/css?family=Quicksand" rel="stylesheet">
<link rel="stylesheet" href="/assets/vendor/bulma.min.css">
<link rel="stylesheet" href="/assets/vendor/highlightjs.theme.css">
<link rel="stylesheet" href="/assets/styles.css">
<link rel="apple-touch-icon" sizes="180x180" href="/assets/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/icons/favicon-16x16.png">
<link rel="manifest" href="/assets/icons/manifest.json">
<link rel="mask-icon" href="/assets/icons/safari-pinned-tab.svg" color="#2a4c55">
<link rel="shortcut icon" href="/assets/icons/favicon.ico">
<meta name="msapplication-config" content="/assets/icons/browserconfig.xml">
<meta name="theme-color" content="#2a4c55">
<?php include __DIR__ . '/header-snippets.php'; ?>
</head>
<body>
<section class="hero is-medium custom-hero">
<div class="hero-head">
<nav class="navbar">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item logo" href="../">
<img src="/assets/logo.png" alt="Cli.fyi"/>
</a>
<span class="navbar-burger burger" data-target="navbarMenu">
<span></span>
<span></span>
<span></span>
</span>
</div>
<div id="navbarMenu" class="navbar-menu">
<div class="navbar-end">
<a href="#available-commands" class="navbar-item">
Available Commands
</a>
<a href="#faq" class="navbar-item">
About
</a>
<a target="_blank" href="https://github.com/daveearley/cli.fyi" class="navbar-item">
GitHub
</a>
</div>
</div>
</div>
</nav>
</div>
<div class="hero-body">
<div class="container has-text-centered">
<div class="columns">
<div class="column is-two-thirds">
<h1 class="title is-spaced">
A Potentially Useful Command Line Query Tool
</h1>
<h2 class="subtitle">
<b>cli.fyi</b> lets you to quickly retrieve information about emails, IP addresses, URLs and
lots
more
from the command line (or Browser)
</h2>
<div class="buttons">
<div class="button">
<a class="twitter-share-button"
href="https://twitter.com/intent/tweet?text=Cli.fyi - A Useful Command Line Query Tool">
Tweet</a>
</div>
<a href="#available-commands" class="button is-dark">Available Commands</a>
</div>
</div>
<div class="column is-one-third">
<pre class="terminal"><code class="json"><span style="color:#fff;"><b>$</b> curl cli.fyi/<b>btc</b></span>
{
"type": "Bitcoin (BTC) Prices",
"data": {
"USD ($)": 6973.74,
"EUR (€)": 6087.48,
"GBP (£)": 5416.63
...
}
}</code></pre>
</div>
</div>
</div>
</div>
</section>
<div class="container">
<div class="main">
<div class="columns">
<div class="column is-one-quarter">
<div class="toggle-sidebar">
<a class="button is-small" href="javascript:void(0);">
Toggle Menu
</a>
</div>
<aside class="menu sidebar">
<p class="menu-label">
Available Commands
</p>
<ul class="menu-list">
<li><a href="#crypto-currency-prices">Crypto Currency Prices</a></li>
<li><a href="#email-address">Email Address Information</a></li>
<li><a href="#ip-address">IP Address Information</a></li>
<li><a href="#media-information">Media/URL Information</a></li>
<li><a href="#client-information">Client Information</a></li>
<li><a href="#string-hash-values">String Hash Values</a></li>
<li><a href="#domain-name-information">Domain Name Information</a></li>
<li><a href="#datatime-information">Date/Time Information</a></li>
<li><a href="#programming-lang-information">Programming Language Links</a></li>
<li><a href="#country-information">Country Information</a></li>
<li><a href="#popular-emojis">Popular Emojis</a></li>
<li><a href="#help">Help</a></li>
</ul>
<p class="menu-label">
General
</p>
<ul class="menu-list">
<li><a href="#faq">FAQ</a></li>
<li><a href="#credits">Credits</a></li>
<li><a target="_blank" href="https://github.com/daveearley/cli.fyi">GitHub</a></li>
</ul>
<div class="sharing-buttons">
<!-- AddToAny BEGIN -->
<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
<a class="a2a_dd" href="https://www.addtoany.com/share"></a>
<a class="a2a_button_twitter"></a>
<a class="a2a_button_facebook"></a>
<a class="a2a_button_reddit"></a>
<a class="a2a_button_hacker_news"></a>
</div>
<script async src="https://static.addtoany.com/menu/page.js"></script>
<!-- AddToAny END -->
</div>
</aside>
</div>
<div class="column is-three-quarters">
<div class="main-content">
<h1 id="available-commands">Available Commands</h1>
<section class="command-section" id="crypto-currency-prices">
<h2>Crypto Currency Prices</h2>
<p>
Returns the latest prices for 1000+ crypto currencies.
</p>
<h3>Example Request</h3>
<pre class="highlight shell"><code>$ curl cli.fyi/<b>BTC</b></code></pre>
<h3>Example Response</h3>
<pre class="highlight json"><code>{
"type": "Bitcoin (BTC) Prices",
"data": {
"USD ($)": 7299.97,
"EUR (€)": 6338.15,
"GBP (£)": 5636.17,
"AUD ($)": 9642.69,
"CAD ($)": 9415.97,
"BRL (R$)": 24559.16,
"CHF (CHF)": 7528.65,
"CLP ($)": 4675371.21,
"CNY (¥)": 51398.69,
"DKK (kr)": 51231.61,
"HKD ($)": 57194.57,
"INR (₹)": 490045.94,
"ISK (kr)": 843540.55,
"JPY (¥)": 833628.57,
"KRW (₩)": 8250226.92,
"NZD ($)": 12189.99,
"PLN (zł)": 26717.84,
"RUB (RUB)": 416001.11,
"SEK (kr)": 60000.02,
"SGD ($)": 10016.97,
"THB (฿)": 230183.34,
"TWD (NT$)": 219596.24
}
}</code></pre>
<p>
<span class="codesnip">BTC</span> can be replaced with almost any crypto currency symbol.
Data is provided by
<a href="https://www.cryptocompare.com/" target="_blank">CryptoCompare.com</a>.
</p>
</section>
<section class="command-section" id="email-address">
<h2>Email Address Information</h2>
<p>
Returns information about an email address.
</p>
<h3>Example Request</h3>
<pre class="highlight shell"><code>$ curl cli.fyi/<b>john.doe@10minutemail.com</b></code></pre>
<h3>Example Response</h3>
<pre class="highlight json"><code>{
"type": "Email Query",
"data": {
"validMxRecords": true,
"freeProvider": false,
"disposableEmail": true,
"businessOrRoleEmail": false,
"validHost": true
}
}
</code></pre>
</section>
<section class="command-section" id="ip-address">
<h2>IP Address Information</h2>
<p>
Returns geo-location and ASN/Organisation information related to an IP address.
</p>
<h3>Example Request</h3>
<pre class="highlight shell"><code>$ curl cli.fyi/<b>8.8.8.8</b></code></pre>
<h3>Example Response</h3>
<pre class="highlight json"><code>{
"type": "IP Address",
"data": {
"organisation": "Google Inc.",
"country": "United States",
"countryCode": "US",
"city": "Mountain View, California",
"continent": "North America",
"latitude": "37.751",
"longitude": "-97.822"
}
}</code></pre>
</section>
<section class="command-section" id="media-information">
<h2>Media/URL Information</h2>
<p>
Returns detailed information about virtually any URL. Supports extracting data
from oEmbed, TwitterCards, OpenGraph, LinkPulse, Sailthru Meta-data, HTML and Dublin Core.
</p>
<h3>Example Request</h3>
<pre class="highlight shell"><code>$ curl cli.fyi/<b>https://vimeo.com/231191863</b></code></pre>
<h3>Example Response</h3>
<pre class="highlight json"><code>{
"type": "Vimeo Url",
"data": {
"title": "Low Earth Orbit",
"description": "Orbital drone movements are theorbits...",
"url": "https://vimeo.com/231191863",
"type": "video",
"tags": "Drone",
"image": "https://i.vimeocdn.com/video/651947838_640.jpg",
"imageWidth": 640,
"imageHeight": 360,
"code": "[embed code...]",
"width": 640,
"height": 360,
"authorName": "Visual Suspect",
"authorUrl": "https://vimeo.com/vsuspect",
"providerName": "Vimeo",
"providerUrl": "https://vimeo.com/",
.......
}</code></pre>
</section>
<section class="command-section" id="client-information">
<h2>Client Information</h2>
<p>
Returns information about the person/machine making the request.
</p>
<h3>Example Request</h3>
<pre class="highlight shell"><code>$ curl cli.fyi/<b>me</b></code></pre>
<h3>Example Response</h3>
<pre class="highlight json"><code>{
"type": "Client Query",
"data": {
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36",
"iPAddress": "109.255.10.10",
"browser": "Chrome Dev 62.0.3202.75",
"operatingSystem": "Linux",
"iPAddressInformation": {
"organisation": "Liberty Global Operations B.V.",
"country": "Ireland",
"countryCode": "IE",
"city": "Dublin",
"continent": "Europe",
"latitude": "53.3472",
"longitude": "-6.2439"
}
}
}</code></pre>
</section>
<section class="command-section" id="domain-name-information">
<h2>Domain Whois / DNS information</h2>
<p>
Returns whois and DNS information for a given domain.
</p>
<h3>Example Request</h3>
<pre class="highlight shell"><code>$ curl cli.fyi/<b>github.com</b></code></pre>
<h3>Example Response</h3>
<pre class="highlight json"><code>{
"type": "Domain Name",
"data": {
"dns": [
"github.com. 3600 IN MX 5 ALT2.ASPMX.L.GOOGLE.com.",
"github.com. 3600 IN MX 5 ALT1.ASPMX.L.GOOGLE.com.",
"github.com. 40 IN A 192.30.253.113",
"github.com. 40 IN A 192.30.253.112",
"github.com. 651 IN NS ns-520.awsdns-01.net.",
"github.com. 651 IN NS ns-421.awsdns-52.com.",
"github.com. 651 IN NS ns-1283.awsdns-32.org.",
"github.com. 900 IN SOA ns-1707.awsdns-21.co.uk. awsdns-hostmaster.amazon.com. (",
" 1 ; serial",
" 7200 ; refresh (2 hours)",
" 900 ; retry (15 minutes)",
" 1209600 ; expire (2 weeks)",
" 86400 ; minimum (1 day)",
" )",
"github.com. 2350 IN TXT \"docusign=087098e3-3d46-47b7-9b4e-8a23028154cd\"",
"github.com. 2350 IN TXT \"v=spf1 ip4:192.30.252.0/22 ip4:208.74.204.0/22 ip4:46.19.168.0/23 include:_spf.google.com include:esp.github.com include:_spf.createsend.com include:mail.zendesk.com include:servers.mcsv.net ~all\""
],
"whois": [
"Domain Name: GITHUB.COM",
"Registry Domain ID: 1264983250_DOMAIN_COM-VRSN",
"Registrar WHOIS Server: whois.markmonitor.com",
"Registrar URL: http://www.markmonitor.com",
....
]
}
}</code></pre>
</section>
<section class="command-section" id="string-hash-values">
<h2>String Hash Values</h2>
<p>
Returns various hash values for a given string.
</p>
<h3>Example Request</h3>
<pre class="highlight shell"><code>$ curl cli.fyi/hash/<b>HelloWorld</b></code></pre>
<h3>Example Response</h3>
<pre class="highlight json"><code>{
"type": "String Hash Values",
"data": {
"md2": "74655651e01700a25fff9c0127382098",
"md4": "f4e0ffdf5d6d530edb234b381805efc1",
"md5": "292e4a0acc0fb7179dcf58ef02cc2f76",
"sha1": "65cc79bfae2cf9f63475727ee35fd5b4fedeed38",
"sha224": "6a89b325fe53d631a92a75ba43ee8829d686cf135f129af24f9de0ba",
"sha256": "ddec6733cd3fd3fe0ffd13bb477cc28220e8fdbafb217eb16b586af2ea9baa8f",
"sha384": "c83fcbc94b784da0f3223e2c6c69dbc610de24697f7fe26597705af3b946a1dc8d8dcc7aca349579fbea8abab7ecd148",
"sha512/224": "5177294c0c14d3fd34672bb4cad4de3a82454247fcdb1b4b6800c4e6",
"sha512/256": "e373b3e9a3600b5bd7b9609fd0c0fd3cc47e192c0525cff7b197b683bc2b04f0",
.................
}
}
</code></pre>
<p>
Available Hashes:
<span class="codesnip"><?= implode('</span>, <span class="codesnip">',
hash_algos()) ?></span>
</p>
</section>
<section class="command-section" id="datatime-information">
<h2>Date/Time Information</h2>
<p>
Returns information about the current <span class="codesnip">UTC</span> date and time.
</p>
<h3>Example Request</h3>
<pre class="highlight shell"><code>$ curl cli.fyi/<b>time</b></code></pre>
<h3>Example Response</h3>
<pre class="highlight json"><code>{
"type": "Date/Time Information (UTC)",
"data": {
"day": "03",
"month": "11",
"year": "2017",
"hour": "16",
"minutes": "11",
"seconds": "22",
"dayName": "Friday",
"MonthName": "November",
"amOrPm": "pm",
"unixEpoch": 1509728122,
"formattedDate": "Fri, 03 Nov 2017 16:55:22 +0000"
}
}</code></pre>
</section>
<section class="command-section" id="programming-lang-information">
<h2>Programming Language Links</h2>
<p>
Returns useful and up-to-date links for programming languages.
</p>
<p>
<span class="codesnip">PHP</span>, <span class="codesnip">Javascript</span> &
<span class="codesnip">Java</span> currently supported.
</p>
<h3>Example Request</h3>
<pre class="highlight shell"><code>$ curl cli.fyi/<b>PHP</b></code></pre>
<h3>Example Response</h3>
<pre class="highlight json"><code>{
"type": "PHP Query",
"data": {
"documentation": "http://php.net/docs.php",
"links": {
"Awesome PHP": "https://github.com/ziadoz/awesome-php",
"PHP The Right Way": "http://www.phptherightway.com",
"Docker Repository": "https://hub.docker.com/_/php/",
"PHP Fig": "http://www.php-fig.org/",
"PHP Security": "http://phpsecurity.readthedocs.io/en/latest/index.html"
}
}
}</code></pre>
</section>
<section class="command-section" id="country-information">
<h2>Country Information</h2>
<p>
Returns useful information about a given country.
</p>
<h3>Example Request</h3>
<pre class="highlight shell"><code>$ curl cli.fyi/<b>united-states</b></code></pre>
<h3>Example Response</h3>
<pre class="highlight json"><code>{
"type": "Country Query",
"data": {
"commonName": "United States",
"officialName": "United States of America",
"topLevelDomain": ".us",
"currency": "USD",
"callingCode": "+1",
"capitalCity": "Washington D.C.",
"region": "Americas",
"subRegion": "Northern America",
"latitude": 38,
"longitude": -97,
"demonym": "American",
"isLandlocked": "No",
"areaKm": 9372610,
"officialLanguages": "English"
}
}</code></pre>
</section>
<section class="command-section" id="popular-emojis">
<h2>Popular Emojis</h2>
<p>
Returns a selection of popular unicode emojis.
</p>
<h3>Example Request</h3>
<pre class="highlight shell"><code>$ curl cli.fyi/<b>emojis</b></code></pre>
<h3>Example Response</h3>
<pre class="highlight json"><code>{
"type": "Emoji",
"data": {
"huggingFace": "🤗",
"tearsOfJoy": "😂",
"grinningFace": "😀",
"rofl": "🤣",
"smiling": "😊",
"tongueOut": "😋",
"kissingFace": "😘",
"thinking": "🤔",
"neutralFace": "😐"
}
}</code></pre>
</section>
<section class="command-section" id="help">
<h2>Help</h2>
<p>
Returns all possible query types and example queries.
</p>
<h3>Example Request</h3>
<pre class="highlight shell"><code>$ curl cli.fyi/<b>help</b></code></pre>
<h3>Example Response</h3>
<pre class="highlight json"><code>{
"type": "Help",
"data": {
"IP Address Query": {
"example": "https://cli.fyi/8.8.8.8"
},
"Media/Url Query": {
"example": "https://cli.fyi/https://google.com"
},
"Email Address Query": {
"example": "https://cli.fyi/test@10minutemail.com"
},
"Client (you) Query": {
"example": "https://cli.fyi/me"
},
...
}
}</code></pre>
</section>
<h1>General Information</h1>
<section class="command-section" id="faq">
<h2>FAQ</h2>
<h3>Why?</h3>
<p>
<b>cli.fyi</b>'s goal is to create a quick an easy way to fetch information
about IPs, emails, domains etc. directly from the command line.
</p>
<h3>Colourised Output?</h3>
<p>
Unfortunately Curl currently doesn't support colourised output<sup>1</sup>.
<a href="https://github.com/jakubroztocil/httpie" target="_blank">HTTPie</a>
is a good alternative which does support colour output.
</p>
<p>The <a href="https://github.com/callumlocke/json-formatter"
target="_blank">JSON-Formatter</a>
Chrome extension is a good solution for in-browser JSON formatting.
</p>
<h3>Rate Limits?</h3>
<p>
There are no rate limits, however we will block any IP which is abusing the service. If you
need to make a significant number of requests you can always
<a target="_blank" href="https://github.com/daveearley/cli.fyi">host your own version</a>.
</p>
<h3>Who?</h3>
<p>
<b>cli.fyi</b> is developed by <a href="mailto:dave@earley.email">Dave Earley</a>
</p>
<p class="is-size-7">
<sup>1</sup> To the best of my knowledge, please
<a href="mailto:dave@earley.email">correct me</a> if I'm wrong.
</p>
</section>
<section class="command-section" id="credits">
<h2>Credits</h2>
<h3>Data</h3>
<p>
<b>Cli.fyi</b> relies on the following services & projects for its data:
</p>
<p>
<ul>
<li>
<a target="_blank" href="https://github.com/mledoze/countries">Country Data</a>
</li>
<li>
<a target="_blank" href="https://www.maxmind.com/en/geoip2-isp-database">IP Data</a>
</li>
<li>
<a target="_blank" href="https://github.com/oscarotero/Embed">Media/URL Data</a>
</li>
<li>
<a target="_blank" href="http://cryptocompare.com/">Crypto Currency Data</a>
</li>
</ul>
<h3>Hosting</h3>
<p>
Cli.fyi is hosted by
<a href="https://www.linode.com/?r=9d988681aaef5c5a2a6754ba6b0d810c4b4af690" title="Linode">
Linode
</a>.
</p>
</section>
<section class="command-section" id="terms-of-use">
<h2>Terms of Service</h2>
<p>
Cli.fyi is provided as-is. Cli.fyi makes no guarantees about the quality of the service or
the accuracy of data provided by the service.
</p>
</section>
</div>
</div>
</div>
</div>
</div>
</div>
<a class="toTop" href="#available-commands">
^ Back To Top
</a>
</body>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/assets/vendor/zepto.min.js"></script>
<script src="/assets/vendor/jquery.sticky-sidebar.min.js"></script>
<script src="/assets/app.js"></script>
</html>
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/data/programming_language_data.php | data/programming_language_data.php | <?php
return [
'php' => [
'documentation' => 'http://php.net/docs.php',
'links' => [
'Awesome PHP' => 'https://github.com/ziadoz/awesome-php',
'PHP The Right Way' => 'http://www.phptherightway.com',
'Docker Repository' => 'https://hub.docker.com/_/php/',
'PHP Fig' => 'http://www.php-fig.org/',
'PHP Security' => 'http://phpsecurity.readthedocs.io/en/latest/index.html'
]
],
'java' => [
'documentation' => [
'v7' => 'https://docs.oracle.com/javase/7/docs/',
'v8' => 'https://docs.oracle.com/javase/8/docs/'
],
'links' => [
'Awesome Java' => 'https://github.com/akullpp/awesome-java',
'Useful Links' => 'https://github.com/Vedenin/useful-java-links'
]
],
'javascript' => $js = [
'links' => [
'Mozilla JS Reference' => 'https://developer.mozilla.org/en-US/docs/Web/JavaScript',
'React' => [
'Documentation' => 'https://reactjs.org/docs/hello-world.html',
'React patterns, tips & tricks' => 'https://github.com/vasanthk/react-bits'
]
]
],
'js' => $js,
'python' => [
'documentation' => [
'2.7' => 'https://docs.python.org/2.7/',
'3.5' => 'https://docs.python.org/3.5/',
'3.6' => 'https://docs.python.org/3.6/',
'3.7' => 'https://docs.python.org/3.7/',
],
'links' => [
'Awesome Python' => 'https://github.com/vinta/awesome-python',
'Django Docs' => 'https://docs.djangoproject.com/en/1.11/',
'Flask Docs' => 'http://flask.pocoo.org/docs/0.12/'
]
]
]; | php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | false |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/data/crypto_currency_data.php | data/crypto_currency_data.php | <?php /* This file is auto-generated */ return array (
'007' => '007 coin (007)',
'1CR' => '1Credit (1CR)',
'1ST' => 'FirstBlood (1ST)',
'2BACCO' => '2BACCO Coin (2BACCO)',
'2GIVE' => '2GiveCoin (2GIVE)',
'32BIT' => '32Bitcoin (32BIT)',
'3DES' => '3DES (3DES)',
'4CHN' => 'ChanCoin (4CHN)',
'8BIT' => '8BIT Coin (8BIT)',
'8BT' => '8 Circuit Studios (8BT)',
'8S' => 'Elite 888 (8S)',
'ABC' => 'AB-Chain (ABC)',
'ABY' => 'ArtByte (ABY)',
'AC' => 'Asia Coin (AC)',
'ACC' => 'AdCoin (ACC)',
'ACE' => 'TokenStars (ACE)',
'ACES' => 'AcesCoin (ACES)',
'ACID' => 'AcidCoin (ACID)',
'ACN' => 'AvonCoin (ACN)',
'ACOIN' => 'ACoin (ACOIN)',
'ACP' => 'Anarchists Prime (ACP)',
'ACT' => 'ACT (ACT)',
'ADA' => 'Cardano (ADA)',
'ADC' => 'AudioCoin (ADC)',
'ADCN' => 'Asiadigicoin (ADCN)',
'ADL' => 'Adelphoi (ADL)',
'ADN' => 'Aiden (ADN)',
'ADST' => 'Adshares (ADST)',
'ADT' => 'AdToken (ADT)',
'ADX' => 'AdEx (ADX)',
'ADZ' => 'Adzcoin (ADZ)',
'AE' => 'Aeternity (AE)',
'AEC' => 'AcesCoin (AEC)',
'AEON' => 'AeonCoin (AEON)',
'AERO' => 'Aero Coin (AERO)',
'AGRS' => 'Agoras Token (AGRS)',
'AGS' => 'Aegis (AGS)',
'AHT' => 'Ahoolee (AHT)',
'AHT*' => 'Bowhead Health (AHT*)',
'AIB' => 'AdvancedInternetBlock (AIB)',
'AID' => 'AidCoin (AID)',
'AIR' => 'AirToken (AIR)',
'AIR*' => 'Aircoin (AIR*)',
'ALC' => 'Arab League Coin (ALC)',
'ALEX' => 'Alexandrite (ALEX)',
'ALF' => 'AlphaCoin (ALF)',
'ALIS' => 'ALISmedia (ALIS)',
'ALN' => 'AlienCoin (ALN)',
'ALTCOM' => 'AltCommunity Coin (ALTCOM)',
'ALTOCAR' => 'AltoCar (ALTOCAR)',
'AM' => 'AeroMe (AM)',
'AMB' => 'Ambrosus (AMB)',
'AMBER' => 'AmberCoin (AMBER)',
'AMC' => 'AmericanCoin (AMC)',
'AMIS' => 'AMIS (AMIS)',
'AMMO' => 'Ammo Rewards (AMMO)',
'AMP' => 'Synereo (AMP)',
'AMS' => 'Amsterdam Coin (AMS)',
'AMT' => 'Acumen (AMT)',
'AMY' => 'Amygws (AMY)',
'ANAL' => 'AnalCoin (ANAL)',
'ANC' => 'Anoncoin (ANC)',
'ANCP' => 'Anacrypt (ANCP)',
'AND' => 'AndromedaCoin (AND)',
'ANNC' => 'AnonCoin (ANNC)',
'ANT' => 'Aragon (ANT)',
'ANTC' => 'AntiLitecoin (ANTC)',
'ANTI' => 'Anti Bitcoin (ANTI)',
'APC' => 'AlpaCoin (APC)',
'APEX' => 'ApexCoin (APEX)',
'APPC' => 'AppCoins (APPC)',
'APT' => 'Aptcoin (APT)',
'APX' => 'Apx (APX)',
'AR' => 'Cappasity (AR)',
'AR*' => 'Ar.cash (AR*)',
'ARB' => 'Arbit Coin (ARB)',
'ARBI' => 'Arbi (ARBI)',
'ARC' => 'ArcticCoin (ARC)',
'ARCH' => 'ArchCoin (ARCH)',
'ARCO' => 'AquariusCoin (ARCO)',
'ARDR' => 'Ardor (ARDR)',
'ARENA' => 'Arena (ARENA)',
'ARG' => 'Argentum (ARG)',
'ARGUS' => 'ArgusCoin (ARGUS)',
'ARI' => 'AriCoin (ARI)',
'ARI*' => 'BeckSang (ARI*)',
'ARK' => 'ARK (ARK)',
'ARM' => 'Armory Coin (ARM)',
'ARN' => 'Aeron (ARN)',
'ARNA*' => 'ARNA Panacea (ARNA)',
'ARPA' => 'ArpaCoin (ARPA)',
'ART' => 'Maecenas (ART)',
'ASAFE' => 'Allsafe (ASAFE)',
'ASN' => 'Ascension Coin (ASN)',
'AST' => 'AirSwap (AST)',
'AST*' => 'Astral (AST*)',
'ATB' => 'ATB coin (ATB)',
'ATCC' => 'ATC Coin (ATCC)',
'ATFS' => 'ATFS Project (ATFS)',
'ATKN' => 'A-Token (ATKN)',
'ATL' => 'ATLANT (ATL)',
'ATM' => 'ATMChain (ATM*)',
'ATMS' => 'Atmos (ATMS)',
'ATOM' => 'Atomic Coin (ATOM)',
'ATOM*' => 'Cosmos (ATOM*)',
'ATS' => 'Authorship (ATS)',
'ATX' => 'ArtexCoin (ATX)',
'AUR' => 'Aurora Coin (AUR)',
'AURS' => 'Aureus (AURS)',
'AUT' => 'Autoria (AUT)',
'AUTH' => 'Authoreon (AUTH)',
'AV' => 'Avatar Coin (AV)',
'AVA' => 'Avalon (AVA)',
'AVE' => 'Avesta (AVE)',
'AVT' => 'AventCoin (AVT)',
'AXIOM' => 'Axiom Coin (AXIOM)',
'AXR' => 'AXRON (AXR)',
'AXT' => 'AIX (AXT)',
'B3' => 'B3 Coin (B3)',
'B@' => 'BankCoin (B@)',
'BAC' => 'BitalphaCoin (BAC)',
'BAC*' => 'LakeBanker (BAC*)',
'BAN' => 'Babes and Nerds (BAN)',
'BAR' => 'TBIS token (BAR)',
'BASH' => 'LuckChain (BASH)',
'BAT' => 'Basic Attention Token (BAT)',
'BAY' => 'BitBay (BAY)',
'BBCC' => 'BaseballCardCoin (BBCC)',
'BBR' => 'Boolberry (BBR)',
'BBT' => 'BrickBlock (BBT)',
'BCAP' => 'Blockchain Capital (BCAP)',
'BCCOIN' => 'BitConnect Coin (BCCOIN)',
'BCF' => 'BitcoinFast (BCF)',
'BCH' => 'Bitcoin Cash / BCC (BCH)',
'BCN' => 'ByteCoin (BCN)',
'BCPT' => 'BlockMason Credit Protocol (BCPT)',
'BCR' => 'BitCredit (BCR)',
'BCX' => 'BattleCoin (BCX)',
'BCY' => 'BitCrystals (BCY)',
'BDL' => 'Bitdeal (BDL)',
'BDR' => 'BlueDragon (BDR)',
'BELA' => 'BelaCoin (BELA)',
'BEN' => 'Benjamins (BEN)',
'BENJI' => 'BenjiRolls (BENJI)',
'BERN' => 'BERNcash (BERN)',
'BEST' => 'BestChain (BEST)',
'BET' => 'BetaCoin (BET)',
'BET*' => 'DAO.casino (BET*)',
'BFX' => 'BitFinex Tokens (BFX)',
'BHC' => 'BighanCoin (BHC)',
'BHC*' => 'BlackholeCoin (BHC*)',
'BIC' => 'Bikercoins (BIC)',
'BIGUP' => 'BigUp (BIGUP)',
'BIOB' => 'BioBar (BIOB)',
'BIOS' => 'BiosCrypto (BIOS)',
'BIP' => 'BipCoin (BIP)',
'BIS' => 'Bismuth (BIS)',
'BIT16' => '16BitCoin (BIT16)',
'BITB' => 'BitBean (BITB)',
'BITCNY' => 'bitCNY (BITCNY)',
'BITOK' => 'BitOKX (BITOK)',
'BITS' => 'BitstarCoin (BITS)',
'BITSD' => 'Bits Digit (BITSD)',
'BITUSD' => 'bitUSD (BITUSD)',
'BITZ' => 'Bitz Coin (BITZ)',
'BKX' => 'BANKEX (BKX)',
'BLAS' => 'BlakeStar (BLAS)',
'BLAZR' => 'BlazerCoin (BLAZR)',
'BLC' => 'BlakeCoin (BLC)',
'BLITZ' => 'BlitzCoin (BLITZ)',
'BLK' => 'BlackCoin (BLK)',
'BLOCK' => 'BlockNet (BLOCK)',
'BLOCKPAY' => 'BlockPay (BLOCKPAY)',
'BLRY' => 'BillaryCoin (BLRY)',
'BLU' => 'BlueCoin (BLU)',
'BLUE' => 'Ethereum Blue (BLUE)',
'BLX' => 'Blockchain Index (BLX)',
'BM' => 'BitMoon (BM)',
'BM*' => 'Bitcomo (BM*)',
'BMC' => 'Blackmoon Crypto (BMC)',
'BMXT' => 'Bitmxittz (BMXT)',
'BNB' => 'Binance Coin (BNB)',
'BNB*' => 'Boats and Bitches (BNB*)',
'BNC' => 'Benjacoin (BNC)',
'BNT' => 'Bancor Network Token (BNT)',
'BNX' => 'BnrtxCoin (BNX)',
'BOAT' => 'Doubloon (BOAT)',
'BOB' => 'Bob Coin (BOB)',
'BOG' => 'Bogcoin (BOG)',
'BOLI' => 'BolivarCoin (BOLI)',
'BOMB' => 'BombCoin (BOMB)',
'BON' => 'BonesCoin (BON*)',
'BON*' => 'Bonpay (BON)',
'BOOM' => 'BOOM Coin (BOOM)',
'BOS' => 'BOScoin (BOS)',
'BOSON' => 'BosonCoin (BOSON)',
'BOSS' => 'BitBoss (BOSS)',
'BOST' => 'BoostCoin (BOST)',
'BOTS' => 'ArkDAO (BOTS)',
'BOU' => 'Boulle (BOU)',
'BQ' => 'Bitqy (BQ)',
'BQC' => 'BQCoin (BQC)',
'BQX' => 'Bitquence (BQX)',
'BRAIN' => 'BrainCoin (BRAIN)',
'BRAT' => 'Brat (BRAT)',
'BRDD' => 'BeardDollars (BRDD)',
'BRIT' => 'BritCoin (BRIT)',
'BRK' => 'BreakoutCoin (BRK)',
'BRO' => 'Bitradio (BRO)',
'BRONZ' => 'BitBronze (BRONZ)',
'BRX' => 'Breakout Stake (BRX)',
'BS' => 'BlackShadowCoin (BS)',
'BSC' => 'BowsCoin (BSC)',
'BSD' => 'BitSend (BSD)',
'BST' => 'BitStone (BST)',
'BSTAR' => 'Blackstar (BSTAR)',
'BSTK' => 'BattleStake (BSTK)',
'BSTY' => 'GlobalBoost (BSTY)',
'BT' => 'BuildTeam (BT)',
'BT1' => 'Bitfinex Bitcoin Future (BT1)',
'BT2' => 'Bitcoin SegWit2X (BT2)',
'BTA' => 'Bata (BTA)',
'BTB' => 'BitBar (BTB)',
'BTC' => 'Bitcoin (BTC)',
'BTCD' => 'BitcoinDark (BTCD)',
'BTCL' => 'BitluckCoin (BTCL)',
'BTCR' => 'BitCurrency (BTCR)',
'BTCRED' => 'Bitcoin Red (BTCRED)',
'BTCRY' => 'BitCrystal (BTCRY)',
'BTCS' => 'Bitcoin Scrypt (BTCS)',
'BTCZ' => 'BitcoinZ (BTCZ)',
'BTD' => 'Bitcloud (BTD)',
'BTDX' => 'Bitcloud 2.0 (BTDX)',
'BTE' => 'ByteCoin (BTE)',
'BTG' => 'Bitcoin Gold (BTG)',
'BTG*' => 'BitGem (BTG*)',
'BTLC' => 'BitLuckCoin (BTLC)',
'BTM' => 'BitMark (BTM)',
'BTM*' => 'Bytom (BTM*)',
'BTMI' => 'BitMiles (BTMI)',
'BTPL' => 'Bitcoin Planet (BTPL)',
'BTQ' => 'BitQuark (BTQ)',
'BTS' => 'Bitshares (BTS)',
'BTTF' => 'Coin to the Future (BTTF)',
'BTX' => 'Bitcore (BTX)',
'BTX*' => 'BitcoinTX (BTX*)',
'BTZ' => 'BitzCoin (BTZ)',
'BUCKS' => 'SwagBucks (BUCKS)',
'BUCKS*' => 'GorillaBucks (BUCKS*)',
'BUK' => 'CryptoBuk (BUK)',
'BULLS' => 'BullshitCoin (BULLS)',
'BURST' => 'BurstCoin (BURST)',
'BUZZ' => 'BuzzCoin (BUZZ)',
'BVC' => 'BeaverCoin (BVC)',
'BXC' => 'Bitcedi (BXC)',
'BXT' => 'BitTokens (BXT)',
'BYC' => 'ByteCent (BYC)',
'BamitCoin' => 'BAM (BAM)',
'C2' => 'Coin.2 (C2)',
'C20' => 'Crypto20 (C20)',
'CAB' => 'CabbageUnit (CAB)',
'CABS' => 'CryptoABS (CABS)',
'CABS*' => 'CyberTrust (CABS*)',
'CACH' => 'Cachecoin (CACH)',
'CAG' => 'Change (CAG)',
'CAIX' => 'CAIx (CAIx)',
'CALC' => 'CaliphCoin (CALC)',
'CAM' => 'Camcoin (CAM)',
'CAN*' => 'CanYaCoin (CAN)',
'CANN' => 'CannabisCoin (CANN)',
'CAP' => 'BottleCaps (CAP)',
'CARBON' => 'Carboncoin (CARBON)',
'CAS' => 'Cashaa (CAS)',
'CASH' => 'CashCoin (CASH)',
'CASH*' => 'Cash Poker Pro (CASH*)',
'CAT' => 'BlockCAT (CAT)',
'CAT*' => 'BitClave (CAT*)',
'CAV' => 'Caviar (CAV)',
'CBD' => 'CBD Crystals (CBD)',
'CBX' => 'CryptoBullion (CBX)',
'CC' => 'CyberCoin (CC)',
'CCC' => 'CCCoin (CCC)',
'CCN' => 'CannaCoin (CCN)',
'CCRB' => 'CryptoCarbon (CCRB)',
'CCT*' => 'Crystal Clear Token (CCT)',
'CCX' => 'CoolDarkCoin (CCX)',
'CDN' => 'Canada eCoin (CDN)',
'CDT' => 'CoinDash (CDT)',
'CDX' => 'Cryptodex (CDX)',
'CELL' => 'SolarFarm (CELL)',
'CESC' => 'Crypto Escudo (CESC)',
'CETI' => 'CETUS Coin (CETI)',
'CF' => 'Californium (CF)',
'CFC' => 'CoffeeCoin (CFC)',
'CFD' => 'Confido (CFD)',
'CFI' => 'Cofound.it (CFI)',
'CFT' => 'CryptoForecast (CFT)',
'CFT*' => 'Credo (CFT*)',
'CGA' => 'Cryptographic Anomaly (CGA)',
'CHA' => 'Charity Coin (CHA)',
'CHAO' => '23 Skidoo (CHAO)',
'CHASH' => 'CleverHash (CHASH)',
'CHAT' => 'ChatCoin (CHAT)',
'CHC' => 'ChainCoin (CHC)',
'CHESS' => 'ChessCoin (CHESS)',
'CHIEF' => 'TheChiefCoin (CHIEF)',
'CHILD' => 'ChildCoin (CHILD)',
'CHIP' => 'Chip (CHIP)',
'CHOOF' => 'ChoofCoin (CHOOF)',
'CIN' => 'CinderCoin (CIN)',
'CINNI' => 'CINNICOIN (CINNI)',
'CIR' => 'CircuitCoin (CIR)',
'CIRC' => 'CryptoCircuits (CIRC)',
'CIX' => 'Cryptonetix (CIX)',
'CJ' => 'CryptoJacks (CJ)',
'CJC' => 'CryptoJournal (CJC)',
'CKC' => 'Clockcoin (CKC)',
'CLAM' => 'CLAMS (CLAM)',
'CLD' => 'Cloud (CLD)',
'CLICK' => 'Clickcoin (CLICK)',
'CLINT' => 'Clinton (CLINT)',
'CLOAK' => 'CloakCoin (CLOAK)',
'CLOUT' => 'Clout (CLOUT)',
'CLR' => 'CopperLark (CLR)',
'CLUB' => ' ClubCoin (CLUB)',
'CLUD' => 'CludCoin (CLUD)',
'CLV' => 'CleverCoin (CLV)',
'CMC' => 'CosmosCoin (CMC)',
'CMP' => 'Compcoin (CMP)',
'CMPCO' => 'CampusCoin (CMPCO)',
'CMS' => 'COMSA (CMS)',
'CMT' => 'CometCoin (CMT)',
'CNC' => 'ChinaCoin (CNC)',
'CND' => 'Cindicator (CND)',
'CND*' => 'Canada eCoin (CND*)',
'CNL' => 'ConcealCoin (CNL)',
'CNMT' => 'Coinomat (CNMT)',
'CNO' => 'Coino (CNO)',
'CNT' => 'Centurion (CNT)',
'CNX' => 'Cryptonex (CNX)',
'COB' => 'Cobinhood (COB)',
'COC' => 'Community Coin (COC)',
'COE' => 'CoEval (COE)',
'COIN' => 'Coin (COIN)',
'COLX' => 'ColossusCoinXT (COLX)',
'COMM' => 'Community Coin (COMM)',
'CON' => 'Paycon (CON_)',
'COOL' => 'CoolCoin (COOL)',
'COR' => 'Corion (COR)',
'CORAL' => 'CoralPay (CORAL)',
'CORE' => 'Core Group Asset (CORE)',
'COSS' => 'COSS (COSS)',
'COV' => 'Covesting (COV)',
'COV*' => 'CovenCoin (COV*)',
'COVAL' => 'Circuits of Value (COVAL)',
'COX' => 'CobraCoin (COX)',
'CPAY' => 'CryptoPay (CPAY)',
'CPC' => 'CapriCoin (CPC)',
'CQST' => 'ConquestCoin (CQST)',
'CRAB' => 'CrabCoin (CRAB)',
'CRACK' => 'CrackCoin (CRACK)',
'CRAFT' => 'Craftcoin (CRAFT)',
'CRAIG' => 'CraigsCoin (CRAIG)',
'CRAVE' => 'CraveCoin (CRAVE)',
'CRBIT' => 'Creditbit (CRBIT)',
'CRC' => 'CraftCoin (CRC)',
'CRE' => 'Credits (CRE)',
'CREA' => 'CreativeChain (CREA)',
'CREVA' => 'Creva Coin (CREVA)',
'CRM' => 'Cream (CRM)',
'CRNK' => 'CrankCoin (CRNK)',
'CRPS' => 'CryptoPennies (CRPS)',
'CRTM' => 'Cryptum (CRTM)',
'CRW' => 'Crown Coin (CRW)',
'CRX' => 'ChronosCoin (CRX)',
'CRYPT' => 'CryptCoin (CRYPT)',
'CS' => 'CryptoSpots (CS)',
'CSC' => 'CasinoCoin (CSC)',
'CSH' => 'CashOut (CSH)',
'CSMIC' => 'Cosmic (CSMIC)',
'CSNO' => 'BitDice (CSNO)',
'CTC' => 'CarterCoin (CTC)',
'CTIC' => 'Coinmatic (CTIC)',
'CTO' => 'Crypto (CTO)',
'CTR' => 'Centra (CTR)',
'CTT' => 'CodeTract (CTT)',
'CTX' => 'CarTaxi (CTX)',
'CUBE' => 'DigiCube (CUBE)',
'CURE' => 'Curecoin (CURE)',
'CVC' => 'Civic (CVC)',
'CVCOIN' => 'Crypviser (CVCOIN)',
'CWXT' => 'CryptoWorldXToken (CWXT)',
'CXC' => 'CheckCoin (CXC)',
'CXT' => 'Coinonat (CXT)',
'CYC' => 'ConSpiracy Coin (CYC)',
'CYG' => 'Cygnus (CYG)',
'CYP' => 'CypherPunkCoin (CYP)',
'CYT' => 'Cryptokenz (CYT)',
'CZC' => 'Crazy Coin (CZC)',
'DANK' => 'DarkKush (DANK)',
'DAR' => 'Darcrus (DAR)',
'DARK' => 'Dark (DARK)',
'DAS' => 'DAS (DAS)',
'DASH' => 'DigitalCash (DASH)',
'DAT' => 'Datum (DAT)',
'DATA' => 'Streamr DATAcoin (DATA)',
'DAY' => 'Chronologic (DAY)',
'DB' => 'DarkBit (DB)',
'DBET' => 'Decent.bet (DBET)',
'DBG' => 'Digital Bullion Gold (DBG)',
'DBIC' => 'DubaiCoin (DBIC)',
'DBIX' => 'DubaiCoin (DBIX)',
'DBTC' => 'DebitCoin (DBTC)',
'DCC' => 'DarkCrave (DCC)',
'DCK' => 'DickCoin (DCK)',
'DCN' => 'Dentacoin (DCN)',
'DCR' => 'Decred (DCR)',
'DCRE' => 'DeltaCredits (DCRE)',
'DCS.' => 'deCLOUDs (DCS)',
'DCT' => 'Decent (DCT)',
'DCY' => 'Dinastycoin (DCY)',
'DDF' => 'Digital Developers Fund (DDF)',
'DEA' => 'Degas Coin (DEA)',
'DEEP' => 'Deep Gold (DEEP)',
'DEM' => 'eMark (DEM)',
'DENT' => 'Dent (DENT)',
'DES' => 'Destiny (DES)',
'DETH' => 'DarkEther (DETH)',
'DEUR' => 'DigiEuro (DEUR)',
'DFBT' => 'DentalFix (DFBT)',
'DFT' => 'Draftcoin (DFT)',
'DGB' => 'DigiByte (DGB)',
'DGC' => 'DigiCoin (DGC)',
'DGD' => 'Digix DAO (DGD)',
'DGDC' => 'DarkGold (DGDC)',
'DGMS' => 'Digigems (DGMS)',
'DGORE' => 'DogeGoreCoin (DGORE)',
'DGT' => 'DigiPulse (DGT)',
'DICE' => 'Etheroll (DICE)',
'DIEM' => 'CarpeDiemCoin (DIEM)',
'DIGS' => 'Diggits (DIGS)',
'DIM' => 'DIMCOIN (DIM)',
'DIME' => 'DimeCoin (DIME)',
'DISK' => 'Dark Lisk (DISK)',
'DKC' => 'DarkKnightCoin (DKC)',
'DLC' => 'DollarCoin (DLC)',
'DLISK' => 'Dlisk (DLISK)',
'DLR' => 'DollarOnline (DLR)',
'DLT' => 'Agrello Delta (DLT)',
'DMD' => 'Diamond (DMD)',
'DMT' => 'DMarket (DMT)',
'DNA' => 'Encrypgen (DNA)',
'DNET' => 'Darknet (DNET)',
'DNR' => 'Denarius (DNR)',
'DNT' => 'district0x (DNT)',
'DOGE' => 'Dogecoin (DOGE)',
'DOGED' => 'DogeCoinDark (DOGED)',
'DOGETH' => 'EtherDoge (DOGETH)',
'DOPE' => 'DopeCoin (DOPE)',
'DOT' => 'Dotcoin (DOT)',
'DOV' => 'DonationCoin (DOV)',
'DOV*' => 'DOVU (DOV*)',
'DP' => 'DigitalPrice (DP)',
'DPAY' => 'DelightPay (DPAY)',
'DRA' => 'DraculaCoin (DRA)',
'DRACO' => 'DT Token (DRACO)',
'DRC' => 'Dropcoin (DRC)',
'DRGN' => 'Dragonchain (DRGN)',
'DRKC' => 'DarkCash (DRKC)',
'DRKT' => 'DarkTron (DRKT)',
'DRM8' => 'Dream8Coin (DRM8)',
'DROP' => 'FaucetCoin (DROP)',
'DRP' => 'DCORP (DRP)',
'DRS' => 'Digital Rupees (DRS)',
'DRT' => 'DomRaider (DRT)',
'DRZ' => 'Droidz (DRZ)',
'DSB' => 'DarkShibe (DSB)',
'DSH' => 'Dashcoin (DSH)',
'DT' => 'DarkToken (DT)',
'DTB' => 'Databits (DTB)',
'DTC' => 'Datacoin (DTC*)',
'DTC*' => 'DayTrader Coin (DTC)',
'DTCT' => 'DetectorToken (DTCT)',
'DTR' => 'Dynamic Trading Rights (DTR)',
'DTT' => 'DreamTeam Token (DTT)',
'DTT*' => 'Data Trading (DTT*)',
'DUB' => 'DubCoin (DUB)',
'DUCK' => 'DuckDuckCoin (DUCK)',
'DUO' => 'ParallelCoin (DUO)',
'DUTCH' => 'Dutch Coin (DUTCH)',
'DUX' => 'DuxCoin (DUX)',
'DVC' => 'DevCoin (DVC)',
'DYN' => 'Dynamic (DYN)',
'EA' => 'EagleCoin (EA)',
'EAC' => 'EarthCoin (EAC)',
'EAGS' => 'EagsCoin (EAGS)',
'EARTH' => 'Earth Token (EARTH)',
'EB3' => 'EB3coin (EB3)',
'EBCH' => 'eBitcoinCash (EBCH)',
'EBET' => 'EthBet (EBET)',
'EBS' => 'EbolaShare (EBS)',
'EBST' => 'eBoost (EBST)',
'EBTC' => 'eBTC (EBTC)',
'EBZ' => 'Ebitz (EBZ)',
'EC' => 'Eclipse (EC)',
'ECASH' => 'Ethereum Cash (ECASH)',
'ECC' => 'E-CurrencyCoin (ECC)',
'ECHT' => 'e-Chat (ECHT)',
'ECO' => 'ECOcoin (ECO)',
'ECOB' => 'EcoBit (ECOB)',
'EDC' => 'EducoinV (EDC)',
'EDDIE' => 'Eddie coin (EDDIE)',
'EDG' => 'Edgeless (EDG)',
'EDGE' => 'EdgeCoin (EDGE)',
'EDO' => 'Eidoo (EDO)',
'EDR' => 'E-Dinar Coin (EDR)',
'EDRC' => 'EDRCoin (EDRC)',
'EFL' => 'E-Gulden (EFL)',
'EFYT' => 'Ergo (EFYT)',
'EGC' => 'EverGreenCoin (EGC)',
'EGG' => 'EggCoin (EGG)',
'EGO' => 'EGOcoin (EGO)',
'EKN' => 'Elektron (EKN)',
'EKO' => 'EkoCoin (EKO)',
'ELC' => 'Elacoin (ELC)',
'ELE' => 'Elementrem (ELE)',
'ELITE' => 'EthereumLite (ELITE)',
'ELM' => 'Elements (ELM)',
'ELS' => 'Elysium (ELS)',
'ELT' => 'Eloplay (ELT)',
'ELTC2' => 'eLTC (ELTC2)',
'EMB' => 'EmberCoin (EMB)',
'EMC' => 'Emercoin (EMC)',
'EMC2' => 'Einsteinium (EMC2)',
'EMD' => 'Emerald (EMD)',
'EMIGR' => 'EmiratesGoldCoin (EMIGR)',
'EMPC' => 'EmporiumCoin (EMPC)',
'EMT' => 'EasyMine (EMT)',
'ENE' => 'EneCoin (ENE)',
'ENG' => 'Enigma (ENG)',
'ENJ' => 'Enjin Coin (ENJ)',
'ENRG' => 'EnergyCoin (ENRG)',
'ENT' => 'Eternity (ENT)',
'ENTER' => 'EnterCoin (ENTER) (ENTER)',
'EOC' => 'EveryonesCoin (EOC)',
'EON' => 'Exscudo (EON)',
'EOS' => 'EOS (EOS)',
'EPY' => 'Empyrean (EPY)',
'EQ' => 'EQUI (EQ)',
'EQB' => 'Equibit (EQB)',
'EQM' => 'Equilibrium Coin (EQM)',
'EQT' => 'EquiTrader (EQT)',
'EQUAL' => 'EqualCoin (EQUAL)',
'ERB' => 'ERBCoin (ERB)',
'ERC' => 'EuropeCoin (ERC)',
'ERR' => 'ErrorCoin (ERR)',
'ERT' => 'Esports.com (ERT)',
'ERY' => 'Eryllium (ERY)',
'ESP' => 'Espers (ESP)',
'ETBS' => 'EthBits (ETB)',
'ETC' => 'Ethereum Classic (ETC)',
'ETG' => 'Ethereum Gold (ETG)',
'ETH' => 'Ethereum (ETH)',
'ETHD' => 'Ethereum Dark (ETHD)',
'ETHS' => 'EthereumScrypt (ETHS)',
'ETN' => 'Electroneum (ETN)',
'ETP' => 'Metaverse (ETP)',
'ETT' => 'EncryptoTel (ETT)',
'EUC' => 'Eurocoin (EUC)',
'EVC' => 'Eventchain (EVC)',
'EVENT' => 'Event Token (EVENT)',
'EVIL' => 'EvilCoin (EVIL)',
'EVR' => 'Everus (EVR)',
'EVX' => 'Everex (EVX)',
'EXB' => 'ExaByte (EXB) (EXB)',
'EXCL' => 'Exclusive Coin (EXCL)',
'EXE' => 'ExeCoin (EXE)',
'EXIT' => 'ExitCoin (EXIT)',
'EXN' => 'ExchangeN (EXN)',
'EXP' => 'Expanse (EXP)',
'EZC' => 'EZCoin (EZC)',
'EZM' => 'EZMarket (EZM)',
'F16' => 'F16Coin (F16)',
'FAIR' => 'FairCoin (FAIR)',
'FAME' => 'FameCoin (FAME)',
'FAZZ' => 'FazzCoin (FAZZ)',
'FC' => 'Facecoin (FC)',
'FC2' => 'Fuel2Coin (FC2)',
'FCN' => 'FantomCoin (FCN)',
'FCS' => 'CryptoFocus (FCS)',
'FCT' => 'Factoids (FCT)',
'FDC' => 'FoodCoin (FDC)',
'FFC' => 'FireflyCoin (FFC)',
'FGZ' => 'Free Game Zone (FGZ)',
'FIBRE' => 'FIBRE (FIBRE)',
'FIL' => 'FileCoin (FIL)',
'FIND' => 'FindCoin (FIND)',
'FIRE' => 'FireCoin (FIRE)',
'FIRST' => 'FirstCoin (FIRST)',
'FIST' => 'FistBump (FIST)',
'FIT' => 'Fitcoin (FIT)',
'FJC' => 'FujiCoin (FJC)',
'FLAP' => 'Flappy Coin (FLAP)',
'FLASH' => 'FLASH coin (FLASH)',
'FLDC' => 'Folding Coin (FLDC)',
'FLIK' => 'FLiK (FLIK)',
'FLLW' => 'Follow Coin (FLLW)',
'FLO' => 'FlorinCoin (FLO)',
'FLP' => 'Gameflip (FLP)',
'FLT' => 'FlutterCoin (FLT)',
'FLVR' => 'FlavorCoin (FLVR)',
'FLX' => 'Flash (FLX)',
'FLY' => 'FlyCoin (FLY)',
'FND' => 'FundRequest (FND)',
'FONZ' => 'FonzieCoin (FONZ)',
'FOREX' => 'ForexCoin (FOREX)',
'FRAC' => 'FractalCoin (FRAC)',
'FRAZ' => 'FrazCoin (FRAZ)',
'FRC' => 'FireRoosterCoin (FRC)',
'FRE' => 'FreeCoin (FRE)',
'FRK' => 'Franko (FRK)',
'FRN' => 'Francs (FRN)',
'FRST' => 'FirstCoin (FRST)',
'FRWC' => 'Frankywillcoin (FRWC)',
'FSC2' => 'FriendshipCoin (FSC2)',
'FSN' => 'Fusion (FSN)',
'FST' => 'FastCoin (FST)',
'FTC' => 'FeatherCoin (FTC)',
'FTP' => 'FuturePoints (FTP)',
'FUCK' => 'Fuck Token (FUCK)',
'FUEL' => 'Etherparty (FUEL)',
'FUN' => 'FunFair (FUN)',
'FUNC' => 'FunCoin (FUNC)',
'FUTC' => 'FutCoin (FUTC)',
'FUZZ' => 'Fuzzballs (FUZZ)',
'FX' => 'FCoin (FX)',
'FYN' => 'FundYourselfNow (FYN)',
'GAIA' => 'GAIA Platform (GAIA)',
'GAKH' => 'GAKHcoin (GAKH)',
'GAM' => 'Gambit coin (GAM)',
'GAME' => 'Gamecredits (GAME)',
'GAP' => 'Gapcoin (GAP)',
'GAS' => 'Gas (GAS)',
'GAT' => 'GAT Coin (GAT)',
'GAY' => 'GayCoin (GAY)',
'GB' => 'GoldBlocks (GB)',
'GBIT' => 'GravityBit (GBIT)',
'GBRC' => 'GBR Coin (GBRC)',
'GBT' => 'GameBetCoin (GBT)',
'GBYTE' => 'Byteball (GBYTE)',
'GCC' => 'GuccioneCoin (GCC)',
'GCN' => 'GCoin (GCN)',
'GCR' => 'Global Currency Reserve (GCR)',
'GDC' => 'GrandCoin (GDC)',
'GEMZ' => 'Gemz Social (GEMZ)',
'GEN' => 'Genstake (GEN)',
'GEO' => 'GeoCoin (GEO)',
'GES' => 'Galaxy eSolutions (GES)',
'GGS' => 'Gilgam (GGS)',
'GHC' => 'GhostCoin (GHC)',
'GHOUL' => 'Ghoul Coin (GHOUL)',
'GHS' => 'Giga Hash (GHS)',
'GIFT' => 'GiftNet (GIFT)',
'GIG' => 'GigCoin (GIG)',
'GIM' => 'Gimli (GIM)',
'GIVE' => 'GiveCoin (GIVE)',
'GIZ' => 'GIZMOcoin (GIZ)',
'GJC' => 'Global Jobcoin (GJC)',
'GLA' => 'Gladius (GLA)',
'GLC' => 'GlobalCoin (GLC)',
'GLD' => 'GoldCoin (GLD)',
'GLOBE' => 'Global (GLOBE)',
'GLX' => 'GalaxyCoin (GLX)',
'GLYPH' => 'GlyphCoin (GLYPH)',
'GMC' => 'Gridmaster (GMC)',
'GML' => 'GameLeagueCoin (GML)',
'GMX' => 'Goldmaxcoin (GMX)',
'GNJ' => 'GanjaCoin V2 (GNJ)',
'GNO' => 'Gnosis (GNO)',
'GNT' => 'Golem Network Token (GNT)',
'GOAT' => 'Goat (GOAT)',
'GOKU' => 'Gokucoin (GOKU)',
'GOLOS' => 'Golos (GOLOS)',
'GOOD' => 'GoodCoin (GOOD)',
'GOON' => 'Goonies (GOON)',
'GOT' => 'Giotto Coin (GOT)',
'GOTX' => 'GothicCoin (GOTX)',
'GP' => 'GoldPieces (GP)',
'GPL' => 'Gold Pressed Latinum (GPL)',
'GPU' => 'GPU Coin (GPU)',
'GRAM' => 'Gram Coin (GRAM)',
'GRAV' => 'Graviton (GRAV)',
'GRC' => 'GridCoin (GRC)',
'GRE' => 'GreenCoin (GRE)',
'GREXIT' => 'GrexitCoin (GREXIT)',
'GRF' => 'Graft Network (GRF)',
'GRID' => 'GridPay (GRID)',
'GRM' => 'GridMaster (GRM)',
'GROW' => 'GrownCoin (GROW)',
'GRS' => 'Groestlcoin (GRS)',
'GRT' => 'Grantcoin (GRT)',
'GRW' => 'GrowthCoin (GRW)',
'GRWI' => 'Growers International (GRWI)',
'GSM' => 'GSM Coin (GSM)',
'GSX' => 'GlowShares (GSX)',
'GSY' => 'GenesysCoin (GSY)',
'GUE' => 'GuerillaCoin (GUE)',
'GUESS' => 'Peerguess (GUESS)',
'GUNS' => 'GeoFunders (GUNS)',
'GUP' => 'Guppy (GUP)',
'GXC' => 'Gx Coin (GXC)',
'GXC*' => 'GenXCoin (GXC*)',
'H2O' => 'Hydrominer (H2O)',
'HAC' => 'Hackspace Capital (HAC)',
'HAL' => 'Halcyon (HAL)',
'HALLO' => 'Halloween Coin (HALLO)',
'HAMS' => 'HamsterCoin (HAMS)',
'HAZE' => 'HazeCoin (HAZE)',
'HBN' => 'HoboNickels (HBN)',
'HBT' => 'Hubiit (HBT)',
'HCC' => 'HappyCreatorCoin (HCC)',
'HDG' => 'Hedge Token (HDG)',
'HEAT' => 'Heat Ledger (HEAT)',
'HEDG' => 'Hedgecoin (HEDG)',
'HEEL' => 'HeelCoin (HEEL)',
'HGT' => 'Hello Gold (HGT)',
'HILL' => 'President Clinton (HILL)',
'HIRE' => 'HireMatch (HIRE)',
'HIRE*' => 'BitHIRE (HIRE*)',
'HKG' => 'Hacker Gold (HKG)',
'HMP' => 'HempCoin (HMP)',
'HMQ' => 'Humaniq (HMQ)',
'HNC' => 'Hellenic Coin (HNC)',
'HNC*' => 'Huncoin (HNC*)',
'HODL' => 'HOdlcoin (HODL)',
'HONEY' => 'Honey (HONEY)',
'HPC' => 'HappyCoin (HPC)',
'HRB' => 'Harbour DAO (HRB)',
'HSP' => 'Horse Power (HSP)',
'HSR' => 'Hshare (HSR)',
'HST' => 'Decision Token (HST)',
'HTC' => 'Hitcoin (HTC)',
'HTML5' => 'HTML Coin (HTML5)',
'HUC' => 'HunterCoin (HUC)',
'HUGE' => 'BigCoin (HUGE)',
'HUSH' => 'Hush (HUSH)',
'HVC' => 'HeavyCoin (HVC)',
'HVCO' => 'High Voltage Coin (HVCO)',
'HVN' => 'Hive (HVN)',
'HXT' => 'HextraCoin (HXT)',
'HXX' => 'HexxCoin (HXX)',
'HYP' => 'Hyperstake (HYP)',
'HYPER' => 'HyperCoin (HYPER)',
'HZ' => 'Horizon (HZ)',
'HZT' => 'HazMatCoin (HZT)',
'I0C' => 'I0coin (I0C)',
'IBANK' => 'iBankCoin (IBANK)',
'ICASH' => 'ICASH (ICASH)',
'ICB' => 'IceBergCoin (ICB)',
'ICE' => 'iDice (ICE)',
'ICN' => 'Iconomi (ICN)',
'ICOB' => 'Icobid (ICOB)',
'ICON' => 'Iconic (ICON)',
'ICOO' => 'ICO OpenLedger (ICOO)',
'ICOS' => 'ICOBox (ICOS)',
'ICX' => 'ICON Project (ICX)',
'IEC' => 'IvugeoEvolutionCoin (IEC)',
'IFC' => 'Infinite Coin (IFC)',
'IFLT' => 'InflationCoin (IFLT)',
'IFT' => 'InvestFeed (IFT)',
'IGNIS' => 'Ignis (IGNIS)',
'ILC' => 'ILCoin (ILC)',
'ILCT' => 'ILCoin Token (ILCT)',
'IML' => 'IMMLA (IML)',
'IMPCH' => 'Impeach (IMPCH)',
'IMPS' => 'Impulse Coin (IMPS)',
'IMS' => 'Independent Money System (IMS)',
'IMX' => 'Impact (IMX)',
'IN' => 'InCoin (IN)',
'INC' => 'Incrementum (INC)',
'INCNT' => 'Incent (INCNT)',
'INCP' => 'InceptionCoin (INCP)',
'IND' => 'Indorse (IND)',
'INDI' => 'IndiCoin (INDI)',
'INF8' => 'Infinium-8 (INF8)',
'INFX' => 'Influxcoin (INFX)',
'INN' => 'Innova (INN)',
'INPAY' => 'InPay (INPAY)',
'INS' => 'INS Ecosystem (INS)',
'INSANE' => 'InsaneCoin (INSANE)',
'INSN' => 'Insane Coin (INSN)',
'INV' => 'Invictus (INV)',
'INXT' => 'Internxt (INXT)',
'IOC' => 'IOCoin (IOC)',
'ION' => 'Ionomy (ION)',
'IOP' => 'Internet of People (IOP)',
'IOT' => 'IOTA (IOT)',
'IOU' => 'IOU1 (IOU)',
'IPC' => 'ImperialCoin (IPC)',
'ISL' => 'IslaCoin (ISL)',
'ITT' => 'Intelligent Trading Technologies (ITT)',
'IVZ' => 'InvisibleCoin (IVZ)',
'IW' => 'iWallet (IW)',
'IWT' => 'IwToken (IWT)',
'IXC' => 'IXcoin (IXC)',
'IXT' => 'iXledger (IXT)',
'J' => 'JoinCoin (J)',
'JANE' => 'JaneCoin (JANE)',
'JBS' => 'JumBucks Coin (JBS)',
'JCR' => 'Jincor (JCR)',
'JDC' => 'JustDatingSite (JDC)',
'JIF' => 'JiffyCoin (JIF)',
'JIO' => 'JIO Token (JIO)',
'JKC' => 'JunkCoin (JKC)',
'JNS' => 'Janus (JNS)',
'JOBS' => 'JobsCoin (JOBS)',
'JOK' => 'JokerCoin (JOK)',
'JPC' => 'JackPotCoin (JPC)',
'JPC*' => 'J Coin (JPC*)',
'JUDGE' => 'JudgeCoin (JUDGE)',
'JVY' => 'Javvy (JVY)',
'JWL' => 'Jewels (JWL)',
'KAPU' => 'Kapu (KAPU)',
'KARM' => 'Karmacoin (KARM)',
'KAT' => 'KATZcoin (KAT)',
'KAYI' => 'Kayı (KAYI)',
'KC' => 'Kernalcoin (KC)',
'KCN' => 'Kencoin (KCN)',
'KCS' => 'Kucoin (KCS)',
'KDC' => 'Klondike Coin (KDC)',
'KED' => 'Klingon Empire Darsek (KED)',
'KEK' => 'KekCoin (KEK)',
'KEX' => 'KexCoin (KEX)',
'KEY' => 'KeyCoin (KEY* (1))',
'KEY*' => 'SelfKey (KEY)',
'KGC' => 'KrugerCoin (KGC)',
'KICK' => 'KickCoin (KICK)',
'KIN' => 'Kin (KIN)',
'KING' => 'King93 (KING)',
'KLC' => 'KiloCoin (KLC)',
'KMD' => 'Komodo (KMD)',
'KNC' => 'Kyber Network (KNC)',
'KNC*' => 'Khancoin (KNC*)',
'KOBO' => 'KoboCoin (KOBO)',
'KOLION' => 'Kolion (KOLION)',
'KORE' => 'Kore (KORE)',
'KR' => 'Krypton (KR)',
'KRAK' => 'Kraken (KRAK)',
'KRB' => 'Karbowanec (KRB)',
'KRC' => 'KRCoin (KRC)',
'KRONE' => 'Kronecoin (KRONE)',
'KTK' => 'KryptCoin (KTK)',
'KUBO' => 'KubosCoin (KUBO)',
'KURT' => 'Kurrent (KURT)',
'KUSH' => 'KushCoin (KUSH)',
'LA' => 'LAToken (LA)',
'LAB' => 'CoinWorksCoin (LAB)',
'LANA' => 'LanaCoin (LANA)',
'LAT' => 'Latium (LAT)',
'LAZ' => 'Lazarus (LAZ)',
'LBC' => 'LBRY Credits (LBC)',
'LBTC' => 'LiteBitcoin (LBTC)',
'LC' => 'Lutetium Coin (LC)',
'LCASH' => 'LitecoinCash (LCASH)',
'LDOGE' => 'LiteDoge (LDOGE)',
'LEA' => 'LeaCoin (LEA)',
'LEMON' => 'LemonCoin (LEMON)',
'LENIN' => 'LeninCoin (LENIN)',
'LEO' => 'LEOcoin (LEO)',
'LEPEN' => 'LePenCoin (LEPEN)',
'LEV' => 'Leverj (LEV)',
'LFC' => 'BigLifeCoin (LFC)',
'LGBTQ' => 'LGBTQoin (LGBTQ)',
'LGD' => 'Legends Cryptocurrency (LGD)',
'LGD*' => 'Legendary Coin (LGD*)',
'LIFE' => 'LIFE (LIFE)',
'LIMX' => 'LimeCoinX (LIMX)',
'LINDA' => 'Linda (LINDA)',
'LINK' => 'ChainLink (LINK)',
'LINX' => 'Linx (LINX)',
'LIR' => 'Let it Ride (LIR)',
'LIV' => 'LiviaCoin (LIV)',
'LK7' => 'Lucky7Coin (LK7)',
'LKK' => 'Lykke (LKK)',
'LKY' => 'LuckyCoin (LKY)',
'LMC' => 'LomoCoin (LMC)',
'LNK' => 'Ethereum.Link (LNK)',
'LOAN*' => 'Loan (LOAN)',
'LOC' => 'Loco (LOC)',
'LOG' => 'Wood Coin (LOG)',
'LOOK' => 'LookCoin (LOOK)',
'LQD' => 'Liquid (LQD)',
'LRC' => 'Loopring (LRC)',
'LSD' => 'LightSpeedCoin (LSD)',
'LSK' => 'Lisk (LSK)',
'LTA' => 'Litra (LTA)',
'LTB' => 'Litebar (LTB)',
'LTBC' => 'LTBCoin (LTBC)',
'LTC' => 'Litecoin (LTC)',
'LTCD' => 'LitecoinDark (LTCD)',
'LTCR' => 'LiteCreed (LTCR)',
'LTCX' => 'LitecoinX (LTCX)',
'LTD' => 'Limited Coin (LTD)',
'LTH' => 'Lathaan (LTH)',
'LTS' => 'Litestar Coin (LTS)',
'LUCKY' => 'LuckyBlocks (LUCKY) (LUCKY)',
'LUN' => 'Lunyr (LUN)',
'LUX' => 'LUXCoin (LUX)',
'LUX*' => 'BitLux (LUX*)',
'LVG' => 'Leverage Coin (LVG)',
'LXC' => 'LibrexCoin (LXC)',
'LYB' => 'LyraBar (LYB)',
'LYC' => 'LycanCoin (LYC)',
'M1' => 'SupplyShock (M1)',
'MAC' => 'MachineCoin (MAC)',
'MAD' => 'SatoshiMadness (MAD)',
'MAG' => 'Magos (MAG)',
'MAID' => 'MaidSafe Coin (MAID)',
'MANA' => 'Decentraland (MANA)',
'MAPC' => 'MapCoin (MAPC)',
'MAR' => 'MarijuanaCoin (MAR)',
'MARS' => 'MarsCoin (MARS)',
'MARV' => 'Marvelous (MARV)',
'MARX' => 'MarxCoin (MARX)',
'MARYJ' => 'MaryJane Coin (MARYJ)',
'MASS' => 'Mass.Cloud (MASS)',
'MAT' => 'MiniApps (MAT)',
'MAT*' => 'Manet Coin (MAT*)',
'MAX' => 'MaxCoin (MAX)',
'MAY' => 'Theresa May Coin (MAY)',
'MBI' => 'Monster Byte Inc (MBI)',
'MBIT' => 'Mbitbooks (MBIT)',
'MBRS' => 'Embers (MBRS)',
'MBT' => 'Multibot (MBT)',
'MC' => 'Mass Coin (MC)',
'MCAP' => 'MCAP (MCAP)',
'MCAR' => 'MasterCar (MCAR)',
'MCI' => 'Musiconomi (MCI)',
'MCN' => 'MonetaVerde (MCN)',
'MCO' => 'Monaco (MCO)',
'MCRN' => 'MacronCoin (MCRN)',
'MDA' => 'Moeda (MDA)',
'MDC' => 'MedicCoin (MDC)',
'MDC*' => 'MadCoin (MDC*)',
'MDL' => 'Modulum (MDL)',
'MDT' => 'Midnight (MDT)',
'MEC' => 'MegaCoin (MEC)',
'MED' => 'MediterraneanCoin (MED)',
'MEDI' => 'MediBond (MEDI)',
'MEGA' => 'MegaFlash (MEGA)',
'MEME' => 'Pepe (MEME)',
'MER' => 'Mercury (MER)',
'MET' => 'Memessenger (MET)',
'METAL' => 'MetalCoin (METAL)',
'MG' => 'Mind Gene (MG)',
'MGO' => 'MobileGo (MGO)',
'MI' => 'XiaoMiCoin (MI)',
'MIL' => 'Milllionaire Coin (MIL)',
'MILO' => 'MiloCoin (MILO)',
'MIN' => 'Minerals Coin (MIN)',
'MINE' => 'Instamine Nuggets (MINE)',
'MINEX' => 'Minex (MINEX)',
'MINT' => 'MintCoin (MINT)',
'MIS' => 'MIScoin (MIS)',
'MIV' => 'MakeItViral (MIV)',
'MKR' => 'Maker (MKR)',
'MLITE' => 'MeLite (MLITE)',
'MLN' => 'Melon (MLN)',
'MLS' => 'CPROP (MLS)',
'MM' => 'MasterMint (MM)',
'MMC' => 'MemoryCoin (MMC)',
'MMNXT' => 'MMNXT (MMNXT)',
'MMXIV' => 'MaieutiCoin (MMXIV)',
'MMXVI' => 'MMXVI (MMXVI)',
'MN' => 'Cryptsy Mining Contract (MN)',
'MNC' => 'MinCoin (MNC)',
'MND' => 'MindCoin (MND)',
'MNE' => 'Minereum (MNE)',
'MNM' => 'Mineum (MNM)',
'MNT' => 'GoldMint (MNT)',
'MNY' => 'Monkey (MNY)',
'MNZ' => 'Monaize (MNZ)',
'MOBI' => 'Mobius (MOBI)',
'MOD' => 'Modum (MOD)',
'MOIN' => 'MoinCoin (MOIN)',
'MOJO' => 'Mojocoin (MOJO)',
'MONA' => 'MonaCoin (MONA)',
'MONETA' => 'Moneta (MONETA)',
'MONEY' => 'MoneyCoin (MONEY)',
'MOON' => 'MoonCoin (MOON)',
'MOOND' => 'Dark Moon (MOOND)',
'MOTO' => 'Motocoin (MOTO)',
'MPRO' => 'MediumProject (MPRO)',
'MRP' => 'MorpheusCoin (MRP)',
'MRS' => 'MarsCoin (MRS)',
'MRSA' => 'MrsaCoin (MRSA)',
'MRT' => 'MinersReward (MRT)',
'MRV' => 'Macroverse (MRV)',
'MRY' => 'MurrayCoin (MRY)',
'MSC' => 'MasterCoin (MSC)',
'MSP' => 'Mothership (MSP)',
'MST' => 'MustangCoin (MST)',
'MT' => 'Mycelium Token (MT)',
'MTH' => 'Monetha (MTH)',
'MTK' => 'Moya Token (MTK)',
'MTL' => 'Metal (MTL)',
'MTLM3' => 'Metal Music v3 (MTLM3)',
'MTN' => 'TrackNetToken (MTN)',
'MTR' => 'MasterTraderCoin (MTR)',
'MTX' => 'Matryx (MTX)',
'MUDRA' => 'MudraCoin (MUDRA)',
'MUE' => 'MonetaryUnit (MUE)',
'MUSIC' => 'Musiccoin (MUSIC)',
'MUU' => 'MilkCoin (MUU)',
'MWC' => 'MultiWallet Coin (MWC)',
'MXT' => 'MartexCoin (MXT)',
'MYB' => 'MyBit (MYB)',
'MYC' => 'MayaCoin (MYC)',
'MYST' => 'Mysterium (MYST)',
'MYST*' => 'MysteryCoin (MYST*)',
'MZC' => 'MazaCoin (MZC)',
'N7' => 'Number7 (N7)',
'NAMO' => 'NamoCoin (NAMO)',
'NAN' => 'NanoToken (NAN)',
'NANAS' => 'BananaBits (NANAS)',
'NAS2' => 'Nas2Coin (NAS2)',
'NAUT' => 'Nautilus Coin (NAUT)',
'NAV' => 'NavCoin (NAV)',
'NBIT' => 'NetBit (NBIT)',
'NBL' => 'Nybble (NBL)',
'NBT' => 'NuBits (NBT)',
'NDC' => 'NeverDie (NDC)',
'NDOGE' => 'NinjaDoge (NDOGE)',
'NEBL' => 'Neblio (NEBL)',
'NEBU' => 'Nebuchadnezzar (NEBU)',
'NEC' => 'NeoCoin (NEC)',
'NEF' => 'NefariousCoin (NEF)',
'NEO' => 'NEO (NEO)',
'NEOG' => 'NEO Gold (NEOG)',
'NEOS' => 'NeosCoin (NEOS)',
'NET' => 'NetCoin (NET)',
'NET*' => 'Nimiq Exchange Token (NET*)',
'NETC' => 'NetworkCoin (NETC)',
'NETKO' => 'Netko (NETKO)',
'NEU' => 'NeuCoin (NEU)',
'NEU*' => 'Neumarks (NEU*)',
'NEVA' => 'NevaCoin (NEVA)',
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | true |
daveearley/cli.fyi | https://github.com/daveearley/cli.fyi/blob/995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02/data/countries_data.php | data/countries_data.php | <?php /* This file is auto-generated */ return array (
'aruba' =>
array (
'name' =>
array (
'common' => 'Aruba',
'official' => 'Aruba',
'native' =>
array (
'nld' =>
array (
'official' => 'Aruba',
'common' => 'Aruba',
),
'pap' =>
array (
'official' => 'Aruba',
'common' => 'Aruba',
),
),
),
'tld' =>
array (
0 => '.aw',
),
'cca2' => 'AW',
'ccn3' => '533',
'cca3' => 'ABW',
'cioc' => 'ARU',
'currency' =>
array (
0 => 'AWG',
),
'callingCode' =>
array (
0 => '297',
),
'capital' => 'Oranjestad',
'altSpellings' =>
array (
0 => 'AW',
),
'region' => 'Americas',
'subregion' => 'Caribbean',
'languages' =>
array (
'nld' => 'Dutch',
'pap' => 'Papiamento',
),
'translations' =>
array (
'deu' =>
array (
'official' => 'Aruba',
'common' => 'Aruba',
),
'fra' =>
array (
'official' => 'Aruba',
'common' => 'Aruba',
),
'hrv' =>
array (
'official' => 'Aruba',
'common' => 'Aruba',
),
'ita' =>
array (
'official' => 'Aruba',
'common' => 'Aruba',
),
'jpn' =>
array (
'official' => 'アルバ',
'common' => 'アルバ',
),
'nld' =>
array (
'official' => 'Aruba',
'common' => 'Aruba',
),
'por' =>
array (
'official' => 'Aruba',
'common' => 'Aruba',
),
'rus' =>
array (
'official' => 'Аруба',
'common' => 'Аруба',
),
'slk' =>
array (
'official' => 'Aruba',
'common' => 'Aruba',
),
'spa' =>
array (
'official' => 'Aruba',
'common' => 'Aruba',
),
'fin' =>
array (
'official' => 'Aruba',
'common' => 'Aruba',
),
'est' =>
array (
'official' => 'Aruba',
'common' => 'Aruba',
),
'zho' =>
array (
'official' => '阿鲁巴',
'common' => '阿鲁巴',
),
),
'latlng' =>
array (
0 => 12.5,
1 => -69.96666666,
),
'demonym' => 'Aruban',
'landlocked' => false,
'borders' =>
array (
),
'area' => 180,
),
'afghanistan' =>
array (
'name' =>
array (
'common' => 'Afghanistan',
'official' => 'Islamic Republic of Afghanistan',
'native' =>
array (
'prs' =>
array (
'official' => 'جمهوری اسلامی افغانستان',
'common' => 'افغانستان',
),
'pus' =>
array (
'official' => 'د افغانستان اسلامي جمهوریت',
'common' => 'افغانستان',
),
'tuk' =>
array (
'official' => 'Owganystan Yslam Respublikasy',
'common' => 'Owganystan',
),
),
),
'tld' =>
array (
0 => '.af',
),
'cca2' => 'AF',
'ccn3' => '004',
'cca3' => 'AFG',
'cioc' => 'AFG',
'currency' =>
array (
0 => 'AFN',
),
'callingCode' =>
array (
0 => '93',
),
'capital' => 'Kabul',
'altSpellings' =>
array (
0 => 'AF',
1 => 'Afġānistān',
),
'region' => 'Asia',
'subregion' => 'Southern Asia',
'languages' =>
array (
'prs' => 'Dari',
'pus' => 'Pashto',
'tuk' => 'Turkmen',
),
'translations' =>
array (
'cym' =>
array (
'official' => 'Gweriniaeth Islamaidd Affganistan',
'common' => 'Affganistan',
),
'deu' =>
array (
'official' => 'Islamische Republik Afghanistan',
'common' => 'Afghanistan',
),
'fra' =>
array (
'official' => 'République islamique d\'Afghanistan',
'common' => 'Afghanistan',
),
'hrv' =>
array (
'official' => 'Islamska Republika Afganistan',
'common' => 'Afganistan',
),
'ita' =>
array (
'official' => 'Repubblica islamica dell\'Afghanistan',
'common' => 'Afghanistan',
),
'jpn' =>
array (
'official' => 'アフガニスタン·イスラム共和国',
'common' => 'アフガニスタン',
),
'nld' =>
array (
'official' => 'Islamitische Republiek Afghanistan',
'common' => 'Afghanistan',
),
'por' =>
array (
'official' => 'República Islâmica do Afeganistão',
'common' => 'Afeganistão',
),
'rus' =>
array (
'official' => 'Исламская Республика Афганистан',
'common' => 'Афганистан',
),
'slk' =>
array (
'official' => 'Afgánsky islamský štát',
'common' => 'Afganistan',
),
'spa' =>
array (
'official' => 'República Islámica de Afganistán',
'common' => 'Afganistán',
),
'fin' =>
array (
'official' => 'Afganistanin islamilainen tasavalta',
'common' => 'Afganistan',
),
'est' =>
array (
'official' => 'Afganistani Islamivabariik',
'common' => 'Afganistan',
),
'zho' =>
array (
'official' => '阿富汗伊斯兰共和国',
'common' => '阿富汗',
),
),
'latlng' =>
array (
0 => 33,
1 => 65,
),
'demonym' => 'Afghan',
'landlocked' => true,
'borders' =>
array (
0 => 'IRN',
1 => 'PAK',
2 => 'TKM',
3 => 'UZB',
4 => 'TJK',
5 => 'CHN',
),
'area' => 652230,
),
'angola' =>
array (
'name' =>
array (
'common' => 'Angola',
'official' => 'Republic of Angola',
'native' =>
array (
'por' =>
array (
'official' => 'República de Angola',
'common' => 'Angola',
),
),
),
'tld' =>
array (
0 => '.ao',
),
'cca2' => 'AO',
'ccn3' => '024',
'cca3' => 'AGO',
'cioc' => 'ANG',
'currency' =>
array (
0 => 'AOA',
),
'callingCode' =>
array (
0 => '244',
),
'capital' => 'Luanda',
'altSpellings' =>
array (
0 => 'AO',
1 => 'República de Angola',
2 => 'ʁɛpublika de an\'ɡɔla',
),
'region' => 'Africa',
'subregion' => 'Middle Africa',
'languages' =>
array (
'por' => 'Portuguese',
),
'translations' =>
array (
'cym' =>
array (
'official' => 'Gweriniaeth Angola',
'common' => 'Angola',
),
'deu' =>
array (
'official' => 'Republik Angola',
'common' => 'Angola',
),
'fra' =>
array (
'official' => 'République d\'Angola',
'common' => 'Angola',
),
'hrv' =>
array (
'official' => 'Republika Angola',
'common' => 'Angola',
),
'ita' =>
array (
'official' => 'Repubblica dell\'Angola',
'common' => 'Angola',
),
'jpn' =>
array (
'official' => 'アンゴラ共和国',
'common' => 'アンゴラ',
),
'nld' =>
array (
'official' => 'Republiek Angola',
'common' => 'Angola',
),
'por' =>
array (
'official' => 'República de Angola',
'common' => 'Angola',
),
'rus' =>
array (
'official' => 'Республика Ангола',
'common' => 'Ангола',
),
'slk' =>
array (
'official' => 'Angolská republika',
'common' => 'Angola',
),
'spa' =>
array (
'official' => 'República de Angola',
'common' => 'Angola',
),
'fin' =>
array (
'official' => 'Angolan tasavalta',
'common' => 'Angola',
),
'est' =>
array (
'official' => 'Angola Vabariik',
'common' => 'Angola',
),
'zho' =>
array (
'official' => '安哥拉共和国',
'common' => '安哥拉',
),
),
'latlng' =>
array (
0 => -12.5,
1 => 18.5,
),
'demonym' => 'Angolan',
'landlocked' => false,
'borders' =>
array (
0 => 'COG',
1 => 'COD',
2 => 'ZMB',
3 => 'NAM',
),
'area' => 1246700,
),
'anguilla' =>
array (
'name' =>
array (
'common' => 'Anguilla',
'official' => 'Anguilla',
'native' =>
array (
'eng' =>
array (
'official' => 'Anguilla',
'common' => 'Anguilla',
),
),
),
'tld' =>
array (
0 => '.ai',
),
'cca2' => 'AI',
'ccn3' => '660',
'cca3' => 'AIA',
'cioc' => '',
'currency' =>
array (
0 => 'XCD',
),
'callingCode' =>
array (
0 => '1264',
),
'capital' => 'The Valley',
'altSpellings' =>
array (
0 => 'AI',
),
'region' => 'Americas',
'subregion' => 'Caribbean',
'languages' =>
array (
'eng' => 'English',
),
'translations' =>
array (
'deu' =>
array (
'official' => 'Anguilla',
'common' => 'Anguilla',
),
'fra' =>
array (
'official' => 'Anguilla',
'common' => 'Anguilla',
),
'hrv' =>
array (
'official' => 'Anguilla',
'common' => 'Angvila',
),
'ita' =>
array (
'official' => 'Anguilla',
'common' => 'Anguilla',
),
'jpn' =>
array (
'official' => 'アングィラ',
'common' => 'アンギラ',
),
'nld' =>
array (
'official' => 'Anguilla',
'common' => 'Anguilla',
),
'por' =>
array (
'official' => 'Anguilla',
'common' => 'Anguilla',
),
'rus' =>
array (
'official' => 'Ангилья',
'common' => 'Ангилья',
),
'slk' =>
array (
'official' => 'Anguilla',
'common' => 'Anguilla',
),
'spa' =>
array (
'official' => 'Anguila',
'common' => 'Anguilla',
),
'fin' =>
array (
'official' => 'Anguilla',
'common' => 'Anguilla',
),
'est' =>
array (
'official' => 'Anguilla',
'common' => 'Anguilla',
),
'zho' =>
array (
'official' => '安圭拉',
'common' => '安圭拉',
),
),
'latlng' =>
array (
0 => 18.25,
1 => -63.16666666,
),
'demonym' => 'Anguillian',
'landlocked' => false,
'borders' =>
array (
),
'area' => 91,
),
'Åland-islands' =>
array (
'name' =>
array (
'common' => 'Åland Islands',
'official' => 'Åland Islands',
'native' =>
array (
'swe' =>
array (
'official' => 'Landskapet Åland',
'common' => 'Åland',
),
),
),
'tld' =>
array (
0 => '.ax',
),
'cca2' => 'AX',
'ccn3' => '248',
'cca3' => 'ALA',
'cioc' => '',
'currency' =>
array (
0 => 'EUR',
),
'callingCode' =>
array (
0 => '358',
),
'capital' => 'Mariehamn',
'altSpellings' =>
array (
0 => 'AX',
1 => 'Aaland',
2 => 'Aland',
3 => 'Ahvenanmaa',
),
'region' => 'Europe',
'subregion' => 'Northern Europe',
'languages' =>
array (
'swe' => 'Swedish',
),
'translations' =>
array (
'deu' =>
array (
'official' => 'Åland-Inseln',
'common' => 'Åland',
),
'fra' =>
array (
'official' => 'Ahvenanmaa',
'common' => 'Ahvenanmaa',
),
'hrv' =>
array (
'official' => 'Aland Islands',
'common' => 'Ålandski otoci',
),
'ita' =>
array (
'official' => 'Isole Åland',
'common' => 'Isole Aland',
),
'jpn' =>
array (
'official' => 'オーランド諸島',
'common' => 'オーランド諸島',
),
'nld' =>
array (
'official' => 'Åland eilanden',
'common' => 'Ålandeilanden',
),
'por' =>
array (
'official' => 'Ilhas Åland',
'common' => 'Alândia',
),
'rus' =>
array (
'official' => 'Аландские острова',
'common' => 'Аландские острова',
),
'slk' =>
array (
'official' => 'Alandské ostrovy',
'common' => 'Alandy',
),
'spa' =>
array (
'official' => 'Islas Åland',
'common' => 'Alandia',
),
'fin' =>
array (
'official' => 'Ahvenanmaan maakunta',
'common' => 'Ahvenanmaa',
),
'est' =>
array (
'official' => 'Ahvenamaa maakond',
'common' => 'Ahvenamaa',
),
'zho' =>
array (
'official' => '奥兰群岛',
'common' => '奥兰群岛',
),
),
'latlng' =>
array (
0 => 60.116667,
1 => 19.9,
),
'demonym' => 'Ålandish',
'landlocked' => false,
'borders' =>
array (
),
'area' => 1580,
),
'albania' =>
array (
'name' =>
array (
'common' => 'Albania',
'official' => 'Republic of Albania',
'native' =>
array (
'sqi' =>
array (
'official' => 'Republika e Shqipërisë',
'common' => 'Shqipëria',
),
),
),
'tld' =>
array (
0 => '.al',
),
'cca2' => 'AL',
'ccn3' => '008',
'cca3' => 'ALB',
'cioc' => 'ALB',
'currency' =>
array (
0 => 'ALL',
),
'callingCode' =>
array (
0 => '355',
),
'capital' => 'Tirana',
'altSpellings' =>
array (
0 => 'AL',
1 => 'Shqipëri',
2 => 'Shqipëria',
3 => 'Shqipnia',
),
'region' => 'Europe',
'subregion' => 'Southern Europe',
'languages' =>
array (
'sqi' => 'Albanian',
),
'translations' =>
array (
'cym' =>
array (
'official' => 'Gweriniaeth Albania',
'common' => 'Albania',
),
'deu' =>
array (
'official' => 'Republik Albanien',
'common' => 'Albanien',
),
'fra' =>
array (
'official' => 'République d\'Albanie',
'common' => 'Albanie',
),
'hrv' =>
array (
'official' => 'Republika Albanija',
'common' => 'Albanija',
),
'ita' =>
array (
'official' => 'Repubblica d\'Albania',
'common' => 'Albania',
),
'jpn' =>
array (
'official' => 'アルバニア共和国',
'common' => 'アルバニア',
),
'nld' =>
array (
'official' => 'Republiek Albanië',
'common' => 'Albanië',
),
'por' =>
array (
'official' => 'República da Albânia',
'common' => 'Albânia',
),
'rus' =>
array (
'official' => 'Республика Албания',
'common' => 'Албания',
),
'slk' =>
array (
'official' => 'Albánska republika',
'common' => 'Albánsko',
),
'spa' =>
array (
'official' => 'República de Albania',
'common' => 'Albania',
),
'fin' =>
array (
'official' => 'Albanian tasavalta',
'common' => 'Albania',
),
'est' =>
array (
'official' => 'Albaania Vabariik',
'common' => 'Albaania',
),
'zho' =>
array (
'official' => '阿尔巴尼亚共和国',
'common' => '阿尔巴尼亚',
),
),
'latlng' =>
array (
0 => 41,
1 => 20,
),
'demonym' => 'Albanian',
'landlocked' => false,
'borders' =>
array (
0 => 'MNE',
1 => 'GRC',
2 => 'MKD',
3 => 'UNK',
),
'area' => 28748,
),
'andorra' =>
array (
'name' =>
array (
'common' => 'Andorra',
'official' => 'Principality of Andorra',
'native' =>
array (
'cat' =>
array (
'official' => 'Principat d\'Andorra',
'common' => 'Andorra',
),
),
),
'tld' =>
array (
0 => '.ad',
),
'cca2' => 'AD',
'ccn3' => '020',
'cca3' => 'AND',
'cioc' => 'AND',
'currency' =>
array (
0 => 'EUR',
),
'callingCode' =>
array (
0 => '376',
),
'capital' => 'Andorra la Vella',
'altSpellings' =>
array (
0 => 'AD',
1 => 'Principality of Andorra',
2 => 'Principat d\'Andorra',
),
'region' => 'Europe',
'subregion' => 'Southern Europe',
'languages' =>
array (
'cat' => 'Catalan',
),
'translations' =>
array (
'cym' =>
array (
'official' => 'Tywysogaeth Andorra',
'common' => 'Andorra',
),
'deu' =>
array (
'official' => 'Fürstentum Andorra',
'common' => 'Andorra',
),
'fra' =>
array (
'official' => 'Principauté d\'Andorre',
'common' => 'Andorre',
),
'hrv' =>
array (
'official' => 'Kneževina Andora',
'common' => 'Andora',
),
'ita' =>
array (
'official' => 'Principato di Andorra',
'common' => 'Andorra',
),
'jpn' =>
array (
'official' => 'アンドラ公国',
'common' => 'アンドラ',
),
'nld' =>
array (
'official' => 'Prinsdom Andorra',
'common' => 'Andorra',
),
'por' =>
array (
'official' => 'Principado de Andorra',
'common' => 'Andorra',
),
'rus' =>
array (
'official' => 'Княжество Андорра',
'common' => 'Андорра',
),
'slk' =>
array (
'official' => 'Andorrské kniežatstvo',
'common' => 'Andorra',
),
'spa' =>
array (
'official' => 'Principado de Andorra',
'common' => 'Andorra',
),
'fin' =>
array (
'official' => 'Andorran ruhtinaskunta',
'common' => 'Andorra',
),
'est' =>
array (
'official' => 'Andorra Vürstiriik',
'common' => 'Andorra',
),
'zho' =>
array (
'official' => '安道尔公国',
'common' => '安道尔',
),
),
'latlng' =>
array (
0 => 42.5,
1 => 1.5,
),
'demonym' => 'Andorran',
'landlocked' => true,
'borders' =>
array (
0 => 'FRA',
1 => 'ESP',
),
'area' => 468,
),
'united-arab-emirates' =>
array (
'name' =>
array (
'common' => 'United Arab Emirates',
'official' => 'United Arab Emirates',
'native' =>
array (
'ara' =>
array (
'official' => 'الإمارات العربية المتحدة',
'common' => 'دولة الإمارات العربية المتحدة',
),
),
),
'tld' =>
array (
0 => '.ae',
1 => 'امارات.',
),
'cca2' => 'AE',
'ccn3' => '784',
'cca3' => 'ARE',
'cioc' => 'UAE',
'currency' =>
array (
0 => 'AED',
),
'callingCode' =>
array (
0 => '971',
),
'capital' => 'Abu Dhabi',
'altSpellings' =>
array (
0 => 'AE',
1 => 'UAE',
2 => 'Emirates',
),
'region' => 'Asia',
'subregion' => 'Western Asia',
'languages' =>
array (
'ara' => 'Arabic',
),
'translations' =>
array (
'deu' =>
array (
'official' => 'Vereinigte Arabische Emirate',
'common' => 'Vereinigte Arabische Emirate',
),
'fra' =>
array (
'official' => 'Émirats arabes unis',
'common' => 'Émirats arabes unis',
),
'hrv' =>
array (
'official' => 'Ujedinjeni Arapski Emirati',
'common' => 'Ujedinjeni Arapski Emirati',
),
'ita' =>
array (
'official' => 'Emirati Arabi Uniti',
'common' => 'Emirati Arabi Uniti',
),
'jpn' =>
array (
'official' => 'アラブ首長国連邦',
'common' => 'アラブ首長国連邦',
),
'nld' =>
array (
'official' => 'Verenigde Arabische Emiraten',
'common' => 'Verenigde Arabische Emiraten',
),
'por' =>
array (
'official' => 'Emirados Árabes Unidos',
'common' => 'Emirados Árabes Unidos',
),
'rus' =>
array (
'official' => 'Объединенные Арабские Эмираты',
'common' => 'Объединённые Арабские Эмираты',
),
'slk' =>
array (
'official' => 'Spojené arabské emiráty',
'common' => 'Spojené arabské emiráty',
),
'spa' =>
array (
'official' => 'Emiratos Árabes Unidos',
'common' => 'Emiratos Árabes Unidos',
),
'fin' =>
array (
'official' => 'Yhdistyneet arabiemiirikunnat',
'common' => 'Arabiemiraatit',
),
'est' =>
array (
'official' => 'Araabia Ühendemiraadid',
'common' => 'Araabia Ühendemiraadid',
),
'zho' =>
array (
'official' => '阿拉伯联合酋长国',
'common' => '阿拉伯联合酋长国',
),
),
'latlng' =>
array (
0 => 24,
1 => 54,
),
'demonym' => 'Emirati',
'landlocked' => false,
'borders' =>
array (
0 => 'OMN',
1 => 'SAU',
),
'area' => 83600,
),
'argentina' =>
array (
'name' =>
array (
'common' => 'Argentina',
'official' => 'Argentine Republic',
'native' =>
array (
'grn' =>
array (
'official' => 'Argentine Republic',
'common' => 'Argentina',
),
'spa' =>
array (
'official' => 'República Argentina',
'common' => 'Argentina',
),
),
),
'tld' =>
array (
0 => '.ar',
),
'cca2' => 'AR',
'ccn3' => '032',
'cca3' => 'ARG',
'cioc' => 'ARG',
'currency' =>
array (
0 => 'ARS',
),
'callingCode' =>
array (
0 => '54',
),
'capital' => 'Buenos Aires',
'altSpellings' =>
array (
0 => 'AR',
1 => 'Argentine Republic',
2 => 'República Argentina',
),
'region' => 'Americas',
'subregion' => 'South America',
'languages' =>
array (
'grn' => 'Guaraní',
'spa' => 'Spanish',
),
'translations' =>
array (
'cym' =>
array (
'official' => 'Gweriniaeth yr Ariannin',
'common' => 'Ariannin',
),
'deu' =>
array (
'official' => 'Argentinische Republik',
'common' => 'Argentinien',
),
'fra' =>
array (
'official' => 'République argentine',
'common' => 'Argentine',
),
'hrv' =>
array (
'official' => 'Argentinski Republika',
'common' => 'Argentina',
),
'ita' =>
array (
'official' => 'Repubblica Argentina',
'common' => 'Argentina',
),
'jpn' =>
array (
'official' => 'アルゼンチン共和国',
'common' => 'アルゼンチン',
),
'nld' =>
array (
'official' => 'Argentijnse Republiek',
'common' => 'Argentinië',
),
'por' =>
array (
'official' => 'República Argentina',
'common' => 'Argentina',
),
'rus' =>
array (
'official' => 'Аргентинская Республика',
'common' => 'Аргентина',
),
'slk' =>
array (
'official' => 'Argentínska republika',
'common' => 'Argentína',
),
'spa' =>
array (
'official' => 'República Argentina',
'common' => 'Argentina',
),
'fin' =>
array (
'official' => 'Argentiinan tasavalta',
'common' => 'Argentiina',
),
'est' =>
array (
'official' => 'Argentina Vabariik',
'common' => 'Argentina',
),
'zho' =>
array (
'official' => '阿根廷共和国',
'common' => '阿根廷',
),
),
'latlng' =>
array (
0 => -34,
1 => -64,
),
'demonym' => 'Argentine',
'landlocked' => false,
'borders' =>
array (
0 => 'BOL',
1 => 'BRA',
2 => 'CHL',
3 => 'PRY',
4 => 'URY',
),
'area' => 2780400,
),
'armenia' =>
array (
'name' =>
array (
'common' => 'Armenia',
'official' => 'Republic of Armenia',
'native' =>
array (
'hye' =>
array (
'official' => 'Հայաստանի Հանրապետություն',
'common' => 'Հայաստան',
),
'rus' =>
array (
'official' => 'Республика Армения',
'common' => 'Армения',
),
),
),
'tld' =>
array (
0 => '.am',
),
'cca2' => 'AM',
'ccn3' => '051',
'cca3' => 'ARM',
'cioc' => 'ARM',
'currency' =>
array (
0 => 'AMD',
),
'callingCode' =>
array (
0 => '374',
),
'capital' => 'Yerevan',
'altSpellings' =>
array (
0 => 'AM',
1 => 'Hayastan',
2 => 'Republic of Armenia',
3 => 'Հայաստանի Հանրապետություն',
),
'region' => 'Asia',
'subregion' => 'Western Asia',
'languages' =>
array (
'hye' => 'Armenian',
'rus' => 'Russian',
),
'translations' =>
array (
'cym' =>
array (
'official' => 'Gweriniaeth Armenia',
'common' => 'Armenia',
),
'deu' =>
array (
'official' => 'Republik Armenien',
'common' => 'Armenien',
),
'fra' =>
array (
'official' => 'République d\'Arménie',
'common' => 'Arménie',
),
'hrv' =>
array (
'official' => 'Republika Armenija',
'common' => 'Armenija',
),
'ita' =>
array (
'official' => 'Repubblica di Armenia',
'common' => 'Armenia',
),
'jpn' =>
array (
'official' => 'アルメニア共和国',
'common' => 'アルメニア',
),
'nld' =>
array (
'official' => 'Republiek Armenië',
'common' => 'Armenië',
),
'por' =>
array (
'official' => 'República da Arménia',
'common' => 'Arménia',
),
'rus' =>
array (
'official' => 'Республика Армения',
'common' => 'Армения',
),
'slk' =>
array (
'official' => 'Arménska republika',
'common' => 'Arménsko',
),
'spa' =>
array (
'official' => 'República de Armenia',
'common' => 'Armenia',
),
'fin' =>
array (
'official' => 'Armenian tasavalta',
'common' => 'Armenia',
),
'est' =>
array (
'official' => 'Armeenia Vabariik',
'common' => 'Armeenia',
),
'zho' =>
array (
'official' => '亚美尼亚共和国',
'common' => '亚美尼亚',
),
),
'latlng' =>
array (
0 => 40,
1 => 45,
),
'demonym' => 'Armenian',
'landlocked' => true,
'borders' =>
array (
0 => 'AZE',
1 => 'GEO',
2 => 'IRN',
3 => 'TUR',
),
'area' => 29743,
),
'american-samoa' =>
array (
'name' =>
array (
'common' => 'American Samoa',
'official' => 'American Samoa',
'native' =>
array (
'eng' =>
array (
'official' => 'American Samoa',
'common' => 'American Samoa',
),
'smo' =>
array (
'official' => 'Sāmoa Amelika',
'common' => 'Sāmoa Amelika',
),
),
),
'tld' =>
array (
0 => '.as',
),
'cca2' => 'AS',
'ccn3' => '016',
'cca3' => 'ASM',
'cioc' => 'ASA',
'currency' =>
array (
0 => 'USD',
),
'callingCode' =>
array (
0 => '1684',
),
'capital' => 'Pago Pago',
'altSpellings' =>
array (
0 => 'AS',
1 => 'Amerika Sāmoa',
2 => 'Amelika Sāmoa',
3 => 'Sāmoa Amelika',
),
'region' => 'Oceania',
'subregion' => 'Polynesia',
'languages' =>
array (
'eng' => 'English',
'smo' => 'Samoan',
),
'translations' =>
array (
'deu' =>
array (
'official' => 'Amerikanisch-Samoa',
'common' => 'Amerikanisch-Samoa',
),
'fra' =>
array (
'official' => 'Samoa américaines',
'common' => 'Samoa américaines',
),
'hrv' =>
array (
'official' => 'američka Samoa',
'common' => 'Američka Samoa',
),
'ita' =>
array (
'official' => 'Samoa americane',
'common' => 'Samoa Americane',
),
'jpn' =>
array (
'official' => '米サモア',
'common' => 'アメリカ領サモア',
),
'nld' =>
array (
'official' => 'Amerikaans Samoa',
'common' => 'Amerikaans Samoa',
),
'por' =>
array (
'official' => 'Samoa americana',
'common' => 'Samoa Americana',
),
'rus' =>
array (
'official' => 'американское Самоа',
'common' => 'Американское Самоа',
),
'slk' =>
array (
'official' => 'Americká Samoa',
'common' => 'Americká Samoa',
),
'spa' =>
array (
'official' => 'Samoa Americana',
'common' => 'Samoa Americana',
),
'fin' =>
array (
'official' => 'Amerikan Samoa',
'common' => 'Amerikan Samoa',
),
'est' =>
array (
'official' => 'Ameerika Samoa',
'common' => 'Ameerika Samoa',
),
'zho' =>
array (
'official' => '美属萨摩亚',
'common' => '美属萨摩亚',
),
),
'latlng' =>
array (
0 => -14.33333333,
1 => -170,
),
'demonym' => 'American Samoan',
'landlocked' => false,
'borders' =>
array (
),
'area' => 199,
),
'antarctica' =>
array (
'name' =>
array (
'common' => 'Antarctica',
'official' => 'Antarctica',
'native' =>
array (
),
),
'tld' =>
array (
0 => '.aq',
),
'cca2' => 'AQ',
'ccn3' => '010',
'cca3' => 'ATA',
'cioc' => '',
'currency' =>
array (
),
'callingCode' =>
array (
),
'capital' => '',
'altSpellings' =>
array (
0 => 'AQ',
),
'region' => '',
'subregion' => '',
'languages' =>
array (
),
'translations' =>
array (
'cym' =>
array (
'official' => 'Yr Antarctig',
'common' => 'Yr Antarctig',
),
'deu' =>
array (
'official' => 'Antarktika',
'common' => 'Antarktis',
),
'fra' =>
array (
'official' => 'Antarctique',
'common' => 'Antarctique',
),
'hrv' =>
array (
'official' => 'Antarktika',
'common' => 'Antarktika',
),
'ita' =>
array (
'official' => 'Antartide',
'common' => 'Antartide',
),
'jpn' =>
array (
'official' => '南極大陸',
'common' => '南極',
),
'nld' =>
array (
'official' => 'Antarctica',
'common' => 'Antarctica',
),
'por' =>
array (
'official' => 'Antártica',
'common' => 'Antártida',
),
'rus' =>
array (
'official' => 'Антарктида',
'common' => 'Антарктида',
),
'slk' =>
| php | MIT | 995b4bf43d8dfa7cfe00e38a86d23e22c3e01a02 | 2026-01-05T05:23:53.452663Z | true |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/src/AuthUIEnhancerPlugin.php | src/AuthUIEnhancerPlugin.php | <?php
namespace DiogoGPinto\AuthUIEnhancer;
use DiogoGPinto\AuthUIEnhancer\Concerns\BackgroundAppearance;
use DiogoGPinto\AuthUIEnhancer\Concerns\CustomEmptyPanelView;
use DiogoGPinto\AuthUIEnhancer\Concerns\FormPanelWidth;
use DiogoGPinto\AuthUIEnhancer\Concerns\FormPosition;
use DiogoGPinto\AuthUIEnhancer\Concerns\MobileFormPosition;
use DiogoGPinto\AuthUIEnhancer\Concerns\ShowEmptyPanelOnMobile;
use DiogoGPinto\AuthUIEnhancer\Pages\Auth\AuthUiEnhancerLogin;
use DiogoGPinto\AuthUIEnhancer\Pages\Auth\AuthUiEnhancerRegister;
use DiogoGPinto\AuthUIEnhancer\Pages\Auth\EmailVerification\AuthUiEnhancerEmailVerificationPrompt;
use DiogoGPinto\AuthUIEnhancer\Pages\Auth\PasswordReset\AuthUiEnhancerRequestPasswordReset;
use DiogoGPinto\AuthUIEnhancer\Pages\Auth\PasswordReset\AuthUiEnhancerResetPassword;
use Filament\Auth\Pages\EmailVerification\EmailVerificationPrompt;
use Filament\Auth\Pages\Login;
use Filament\Auth\Pages\PasswordReset\RequestPasswordReset;
use Filament\Auth\Pages\PasswordReset\ResetPassword;
use Filament\Auth\Pages\Register;
use Filament\Contracts\Plugin;
use Filament\Panel;
use Filament\Support\Facades\FilamentView;
use Filament\View\PanelsRenderHook;
class AuthUIEnhancerPlugin implements Plugin
{
use BackgroundAppearance;
use CustomEmptyPanelView;
use FormPanelWidth;
use FormPosition;
use MobileFormPosition;
use ShowEmptyPanelOnMobile;
public function getId(): string
{
return 'filament-auth-ui-enhancer';
}
public function register(Panel $panel): void
{
if ($panel->getLoginRouteAction() === Login::class) {
$panel
->login(AuthUiEnhancerLogin::class);
}
if ($panel->getRegistrationRouteAction() === Register::class) {
$panel
->registration(AuthUiEnhancerRegister::class);
}
if ($panel->getRequestPasswordResetRouteAction() === RequestPasswordReset::class && $panel->getResetPasswordRouteAction() === ResetPassword::class) {
$panel
->passwordReset(AuthUiEnhancerRequestPasswordReset::class, AuthUiEnhancerResetPassword::class);
}
if ($panel->getEmailVerificationPromptRouteAction() === EmailVerificationPrompt::class) {
$panel
->emailVerification(AuthUiEnhancerEmailVerificationPrompt::class);
}
}
public function boot(Panel $panel): void
{
FilamentView::registerRenderHook(
PanelsRenderHook::HEAD_END,
function () {
return '
<style>
:root {
--form-panel-width: ' . $this->getFormPanelWidth() . ';
--form-panel-background-color: ' . $this->getFormPanelBackgroundColor() . ';
--empty-panel-background-color: ' . $this->getEmptyPanelBackgroundColor() . ';
}
</style>
';
}
);
}
public static function make(): static
{
return app(static::class);
}
}
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/src/AuthUIEnhancerServiceProvider.php | src/AuthUIEnhancerServiceProvider.php | <?php
namespace DiogoGPinto\AuthUIEnhancer;
use DiogoGPinto\AuthUIEnhancer\Testing\TestsAuthUIEnhancer;
use Livewire\Features\SupportTesting\Testable;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
class AuthUIEnhancerServiceProvider extends PackageServiceProvider
{
public static string $name = 'filament-auth-ui-enhancer';
public static string $viewNamespace = 'filament-auth-ui-enhancer';
public function configurePackage(Package $package): void
{
/*
* This class is a Package Service Provider
*
* More info: https://github.com/spatie/laravel-package-tools
*/
$package->name(static::$name)
->hasViews(static::$viewNamespace);
}
public function packageRegistered(): void {}
public function packageBooted(): void
{
// Testing
Testable::mixin(new TestsAuthUIEnhancer);
}
}
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/src/Testing/TestsAuthUIEnhancer.php | src/Testing/TestsAuthUIEnhancer.php | <?php
namespace DiogoGPinto\AuthUIEnhancer\Testing;
use Livewire\Features\SupportTesting\Testable;
/**
* @mixin Testable
*/
class TestsAuthUIEnhancer
{
//
}
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/src/Pages/Auth/AuthUiEnhancerLogin.php | src/Pages/Auth/AuthUiEnhancerLogin.php | <?php
namespace DiogoGPinto\AuthUIEnhancer\Pages\Auth;
use DiogoGPinto\AuthUIEnhancer\Pages\Auth\Concerns\HasCustomLayout;
use Filament\Auth\Pages\Login;
class AuthUiEnhancerLogin extends Login
{
use HasCustomLayout;
}
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/src/Pages/Auth/AuthUiEnhancerRegister.php | src/Pages/Auth/AuthUiEnhancerRegister.php | <?php
namespace DiogoGPinto\AuthUIEnhancer\Pages\Auth;
use DiogoGPinto\AuthUIEnhancer\Pages\Auth\Concerns\HasCustomLayout;
use Filament\Auth\Pages\Register;
class AuthUiEnhancerRegister extends Register
{
use HasCustomLayout;
}
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/src/Pages/Auth/PasswordReset/AuthUiEnhancerResetPassword.php | src/Pages/Auth/PasswordReset/AuthUiEnhancerResetPassword.php | <?php
namespace DiogoGPinto\AuthUIEnhancer\Pages\Auth\PasswordReset;
use DiogoGPinto\AuthUIEnhancer\Pages\Auth\Concerns\HasCustomLayout;
use Filament\Auth\Pages\PasswordReset\ResetPassword;
class AuthUiEnhancerResetPassword extends ResetPassword
{
use HasCustomLayout;
}
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/src/Pages/Auth/PasswordReset/AuthUiEnhancerRequestPasswordReset.php | src/Pages/Auth/PasswordReset/AuthUiEnhancerRequestPasswordReset.php | <?php
namespace DiogoGPinto\AuthUIEnhancer\Pages\Auth\PasswordReset;
use DiogoGPinto\AuthUIEnhancer\Pages\Auth\Concerns\HasCustomLayout;
use Filament\Auth\Pages\PasswordReset\RequestPasswordReset;
class AuthUiEnhancerRequestPasswordReset extends RequestPasswordReset
{
use HasCustomLayout;
}
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/src/Pages/Auth/Concerns/HasCustomLayout.php | src/Pages/Auth/Concerns/HasCustomLayout.php | <?php
namespace DiogoGPinto\AuthUIEnhancer\Pages\Auth\Concerns;
trait HasCustomLayout
{
public function getLayout(): string
{
return 'filament-auth-ui-enhancer::custom-auth-layout';
}
}
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/src/Pages/Auth/EmailVerification/AuthUiEnhancerEmailVerificationPrompt.php | src/Pages/Auth/EmailVerification/AuthUiEnhancerEmailVerificationPrompt.php | <?php
namespace DiogoGPinto\AuthUIEnhancer\Pages\Auth\EmailVerification;
use DiogoGPinto\AuthUIEnhancer\Pages\Auth\Concerns\HasCustomLayout;
use Filament\Auth\Pages\EmailVerification\EmailVerificationPrompt;
class AuthUiEnhancerEmailVerificationPrompt extends EmailVerificationPrompt
{
use HasCustomLayout;
}
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/src/Concerns/ShowEmptyPanelOnMobile.php | src/Concerns/ShowEmptyPanelOnMobile.php | <?php
namespace DiogoGPinto\AuthUIEnhancer\Concerns;
trait ShowEmptyPanelOnMobile
{
public bool $showEmptyPanelOnMobile = true;
public function showEmptyPanelOnMobile(bool $show = true): self
{
$this->showEmptyPanelOnMobile = $show;
return $this;
}
public function getShowEmptyPanelOnMobile(): bool
{
return $this->showEmptyPanelOnMobile;
}
}
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/src/Concerns/BackgroundAppearance.php | src/Concerns/BackgroundAppearance.php | <?php
namespace DiogoGPinto\AuthUIEnhancer\Concerns;
trait BackgroundAppearance
{
public ?string $formPanelBackgroundColor = null;
public ?string $emptyPanelBackgroundColor = null;
public ?string $emptyPanelBackgroundImageUrl = null;
public ?string $emptyPanelBackgroundImageOpacity = '100%';
public function formPanelBackgroundColor(string | array $color, int $shade = 500): self
{
$this->formPanelBackgroundColor = $color[$shade];
return $this;
}
public function getFormPanelBackgroundColor(): ?string
{
return $this->formPanelBackgroundColor ?: 'transparent';
}
public function emptyPanelBackgroundColor(array $color, int $shade = 500): self
{
$this->emptyPanelBackgroundColor = $color[$shade];
return $this;
}
public function getEmptyPanelBackgroundColor(): ?string
{
return $this->emptyPanelBackgroundColor ?: 'var(--primary-500)';
}
public function emptyPanelBackgroundImageUrl(?string $url): self
{
$this->emptyPanelBackgroundImageUrl = $url;
return $this;
}
public function getEmptyPanelBackgroundImageUrl(): ?string
{
return $this->emptyPanelBackgroundImageUrl;
}
public function emptyPanelBackgroundImageOpacity(?string $opacity): self
{
$this->emptyPanelBackgroundImageOpacity = $opacity;
return $this;
}
public function getEmptyPanelBackgroundImageOpacity(): ?string
{
return $this->emptyPanelBackgroundImageOpacity;
}
}
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/src/Concerns/MobileFormPosition.php | src/Concerns/MobileFormPosition.php | <?php
namespace DiogoGPinto\AuthUIEnhancer\Concerns;
trait MobileFormPosition
{
public string $mobileFormPanelPosition = 'top';
public function mobileFormPanelPosition(string $position = 'top'): self
{
if (! in_array($position, ['top', 'bottom'])) {
throw new \InvalidArgumentException("Form position must be 'top' or 'bottom'.");
}
$this->mobileFormPanelPosition = $position;
return $this;
}
public function getMobileFormPanelPosition(): string
{
return $this->mobileFormPanelPosition;
}
}
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/src/Concerns/FormPosition.php | src/Concerns/FormPosition.php | <?php
namespace DiogoGPinto\AuthUIEnhancer\Concerns;
trait FormPosition
{
public string $formPanelPosition = 'right';
public function formPanelPosition(string $position = 'right'): self
{
if (! in_array($position, ['left', 'right'])) {
throw new \InvalidArgumentException("Form position must be 'left' or 'right'.");
}
$this->formPanelPosition = $position;
return $this;
}
public function getFormPanelPosition(): string
{
return $this->formPanelPosition;
}
}
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/src/Concerns/FormPanelWidth.php | src/Concerns/FormPanelWidth.php | <?php
namespace DiogoGPinto\AuthUIEnhancer\Concerns;
trait FormPanelWidth
{
public string $formPanelWidth = '50%';
public function formPanelWidth(string $width = '50%'): self
{
if (! $this->isValidWidth($width)) {
throw new \InvalidArgumentException('Sizes must be expressed in rem, %, px, em, vw, vh, pt');
}
$this->formPanelWidth = $width;
return $this;
}
protected function isValidWidth(string $formPanelWidth): bool
{
$pattern = '/^\d+(\.\d+)?(rem|%|px|em|vw|vh|pt)$/';
return preg_match($pattern, $formPanelWidth) === 1;
}
public function getFormPanelWidth(): string
{
return $this->formPanelWidth;
}
}
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/src/Concerns/CustomEmptyPanelView.php | src/Concerns/CustomEmptyPanelView.php | <?php
namespace DiogoGPinto\AuthUIEnhancer\Concerns;
trait CustomEmptyPanelView
{
public ?string $emptyPanelView = null;
public function emptyPanelView(string $view): self
{
$this->emptyPanelView = $view;
return $this;
}
public function getEmptyPanelView(): ?string
{
return $this->emptyPanelView;
}
}
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/tests/Pest.php | tests/Pest.php | <?php
use DiogoGPinto\AuthUIEnhancer\Tests\TestCase;
uses(TestCase::class)->in(__DIR__);
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
diogogpinto/filament-auth-ui-enhancer | https://github.com/diogogpinto/filament-auth-ui-enhancer/blob/1c503274bf8e92354b8d46768d4b242c7729ab29/tests/TestCase.php | tests/TestCase.php | <?php
namespace DiogoGPinto\AuthUIEnhancer\Tests;
use BladeUI\Heroicons\BladeHeroiconsServiceProvider;
use BladeUI\Icons\BladeIconsServiceProvider;
use DiogoGPinto\AuthUIEnhancer\AuthUIEnhancerServiceProvider;
use Filament\Actions\ActionsServiceProvider;
use Filament\FilamentServiceProvider;
use Filament\Forms\FormsServiceProvider;
use Filament\Infolists\InfolistsServiceProvider;
use Filament\Notifications\NotificationsServiceProvider;
use Filament\Support\SupportServiceProvider;
use Filament\Tables\TablesServiceProvider;
use Filament\Widgets\WidgetsServiceProvider;
use Illuminate\Database\Eloquent\Factories\Factory;
use Livewire\LivewireServiceProvider;
use Orchestra\Testbench\TestCase as Orchestra;
use RyanChandler\BladeCaptureDirective\BladeCaptureDirectiveServiceProvider;
class TestCase extends Orchestra
{
protected function setUp(): void
{
parent::setUp();
Factory::guessFactoryNamesUsing(
fn (string $modelName) => 'DiogoGPinto\\AuthUIEnhancer\\Database\\Factories\\' . class_basename($modelName) . 'Factory'
);
}
protected function getPackageProviders($app)
{
return [
ActionsServiceProvider::class,
BladeCaptureDirectiveServiceProvider::class,
BladeHeroiconsServiceProvider::class,
BladeIconsServiceProvider::class,
FilamentServiceProvider::class,
FormsServiceProvider::class,
InfolistsServiceProvider::class,
LivewireServiceProvider::class,
NotificationsServiceProvider::class,
SupportServiceProvider::class,
TablesServiceProvider::class,
WidgetsServiceProvider::class,
AuthUIEnhancerServiceProvider::class,
];
}
public function getEnvironmentSetUp($app)
{
config()->set('database.default', 'testing');
/*
$migration = include __DIR__.'/../database/migrations/create_filament-auth-ui-enhancer_table.php.stub';
$migration->up();
*/
}
}
| php | MIT | 1c503274bf8e92354b8d46768d4b242c7729ab29 | 2026-01-05T05:24:07.458093Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.