/home/kueuepay/www/vendor/maximebf/debugbar/src/DebugBar/DataCollector/ObjectCountCollector.php
<?php

namespace DebugBar\DataCollector;

use DebugBar\DataCollector\DataCollector;
use DebugBar\DataCollector\DataCollectorInterface;
use DebugBar\DataCollector\Renderable;

/**
 * Collector for hit counts.
 */
class ObjectCountCollector extends DataCollector implements DataCollectorInterface, Renderable
{
    /** @var string */
    private $name;
    /** @var string */
    private $icon;
    /** @var int */
    protected $classCount = 0;
    /** @var array */
    protected $classList = [];

    /**
     * @param string $name
     * @param string $icon
     */
    public function __construct($name = 'counter', $icon = 'cubes')
    {
        $this->name = $name;
        $this->icon = $icon;
    }

    /**
     * @param string|mixed $class
     * @param int $count
     */
    public function countClass($class, $count = 1) {
        if (! is_string($class)) {
            $class = get_class($class);
        }

        $this->classList[$class] = ($this->classList[$class] ?? 0) + $count;
        $this->classCount += $count;
    }

    /**
     * {@inheritDoc}
     */
    public function collect()
    {
        arsort($this->classList, SORT_NUMERIC);

        if (! $this->getXdebugLinkTemplate()) {
            return ['data' => $this->classList, 'count' => $this->classCount, 'is_counter' => true];
        }

        $data = [];
        foreach ($this->classList as $class => $count) {
            $reflector = class_exists($class) ? new \ReflectionClass($class) : null;

            if ($reflector && $link = $this->getXdebugLink($reflector->getFileName())) {
                $data[$class] = [
                    'value' => $count,
                    'xdebug_link' => $link,
                ];
            } else {
                $data[$class] = $count;
            }
        }

        return ['data' => $data, 'count' => $this->classCount, 'is_counter' => true];
    }

    /**
     * {@inheritDoc}
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * {@inheritDoc}
     */
    public function getWidgets()
    {
        $name = $this->getName();

        return [
            "$name" => [
                'icon' => $this->icon,
                'widget' => 'PhpDebugBar.Widgets.HtmlVariableListWidget',
                'map' => "$name.data",
                'default' => '{}'
            ],
            "$name:badge" => [
                'map' => "$name.count",
                'default' => 0
            ]
        ];
    }
}
Authentication

Authentication

To access the Kueue Pay Developer API, you’ll need an API key. You can obtain your API key by logging in to your Kueue Pay merchant account and navigating to the API section. Collect Client ID , Secret ID & Merchant ID Carefully. Keep your API key confidential and do not share it publicly.

If you don't have any merchant account please Register to continue