mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Added amount of bots, non-bots and total visits to the list of tags with stats
This commit is contained in:
@@ -10,6 +10,7 @@ use DateTimeInterface;
|
||||
use Doctrine\ORM\Mapping\Builder\FieldBuilder;
|
||||
use Jaybizzle\CrawlerDetect\CrawlerDetect;
|
||||
use Laminas\Filter\Word\CamelCaseToSeparator;
|
||||
use Laminas\Filter\Word\CamelCaseToUnderscore;
|
||||
use Laminas\InputFilter\InputFilter;
|
||||
use PUGX\Shortid\Factory as ShortIdFactory;
|
||||
use Shlinkio\Shlink\Common\Util\DateRange;
|
||||
@@ -21,6 +22,7 @@ use function print_r;
|
||||
use function Shlinkio\Shlink\Common\buildDateRange;
|
||||
use function sprintf;
|
||||
use function str_repeat;
|
||||
use function strtolower;
|
||||
use function ucfirst;
|
||||
|
||||
function generateRandomShortCode(int $length): string
|
||||
@@ -143,6 +145,16 @@ function camelCaseToHumanFriendly(string $value): string
|
||||
return ucfirst($filter->filter($value));
|
||||
}
|
||||
|
||||
function camelCaseToSnakeCase(string $value): string
|
||||
{
|
||||
static $filter;
|
||||
if ($filter === null) {
|
||||
$filter = new CamelCaseToUnderscore();
|
||||
}
|
||||
|
||||
return strtolower($filter->filter($value));
|
||||
}
|
||||
|
||||
function toProblemDetailsType(string $errorCode): string
|
||||
{
|
||||
return sprintf('https://shlink.io/api/error/%s', $errorCode);
|
||||
|
||||
Reference in New Issue
Block a user