MOON
Server: Apache
System: Linux server1.studioinfinity.com.br 2.6.32-954.3.5.lve1.4.90.el6.x86_64 #1 SMP Tue Feb 21 12:26:30 UTC 2023 x86_64
User: artinside (517)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/artinside/sites.artinside.com.br/mainpro/vendor/aplus/debug/src/Collector.php
<?php declare(strict_types=1);
/*
 * This file is part of Aplus Framework Debug Library.
 *
 * (c) Natan Felles <natanfelles@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Framework\Debug;

/**
 * Class Collector.
 *
 * @package debug
 */
abstract class Collector
{
    protected string $name;
    /**
     * @var array<mixed>
     */
    protected array $data = [];
    /**
     * @var array<int,array<string,mixed>>
     */
    protected array $activities = [];

    public function __construct(string $name = 'default')
    {
        $this->name = $name;
    }

    public function getName() : string
    {
        return $this->name;
    }

    public function getSafeName() : string
    {
        return Debugger::makeSafeName($this->getName());
    }

    /**
     * @param array<mixed> $data
     *
     * @return static
     */
    public function addData(array $data) : static
    {
        $this->data[] = $data;
        return $this;
    }

    /**
     * @return array<mixed>
     */
    public function getData() : array
    {
        return $this->data;
    }

    public function hasData() : bool
    {
        return !empty($this->data);
    }

    /**
     * @return array<int,array<string,mixed>>
     */
    public function getActivities() : array
    {
        return $this->activities;
    }

    abstract public function getContents() : string;
}