/home/kueuepay/public_html/vendor/spatie/flare-client-php/src/View.php
<?php

namespace Spatie\FlareClient;

use Symfony\Component\VarDumper\Cloner\VarCloner;
use Symfony\Component\VarDumper\Dumper\HtmlDumper;

class View
{
    protected string $file;

    /** @var array<string, mixed> */
    protected array $data = [];

    /**
     * @param string $file
     * @param array<string, mixed> $data
     */
    public function __construct(string $file, array $data = [])
    {
        $this->file = $file;
        $this->data = $data;
    }

    /**
     * @param string $file
     * @param array<string, mixed> $data
     *
     * @return self
     */
    public static function create(string $file, array $data = []): self
    {
        return new self($file, $data);
    }

    protected function dumpViewData(mixed $variable): string
    {
        $cloner = new VarCloner();

        $dumper = new HtmlDumper();
        $dumper->setDumpHeader('');

        $output = fopen('php://memory', 'r+b');

        if (! $output) {
            return '';
        }

        $dumper->dump($cloner->cloneVar($variable)->withMaxDepth(1), $output, [
            'maxDepth' => 1,
            'maxStringLength' => 160,
        ]);

        return (string)stream_get_contents($output, -1, 0);
    }

    /** @return array<string, mixed> */
    public function toArray(): array
    {
        return [
            'file' => $this->file,
            'data' => array_map([$this, 'dumpViewData'], $this->data),
        ];
    }
}
Contact
top

Get in Touch with Us for Any Questions or Support

We’d love to hear from you! Whether you have questions, feedback, or need support, our team is here to help. Reach out to us via email, phone, or visit our office. We’re committed to providing you with exceptional service and ensuring your experience with NFC Pay is seamless and satisfying. Let’s connect!

icon

Our Location

20-22 Wenlock Road, England, N1 7GU
icon

Call us on: +03601 885399

Our office hours Monday–Friday, 9am - 9pm
icon

Email us directly

support@example.com