<?php
/**
 * Copyright since 2025 InPost S.A.
 *
 * For the full license information, please view the LICENSE file bundled with the module.
 *
 * @author InPost S.A.
 * @copyright since 2025 InPost S.A.
 * @license MIT
 */

declare(strict_types=1);

namespace InPost\International\Hook\Event;

if (!defined('_PS_VERSION_')) {
    exit;
}

/**
 * Generic hook implementation.
 */
final class Hook extends AbstractHook
{
    /**
     * @var string
     */
    private $name;

    /**
     * @var array<string, mixed>
     */
    private $parameters;

    /**
     * @var mixed
     */
    private $result;

    /**
     * @param array<string, mixed> $parameters
     */
    public function __construct(string $name, array $parameters = [])
    {
        $this->name = $name;
        $this->parameters = $parameters;
        $this->request = $parameters['request'] ?? null;
    }

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

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

    /**
     * @return mixed
     */
    public function getResult()
    {
        return $this->result;
    }

    /**
     * @param mixed $result
     */
    public function setResult($result): void
    {
        $this->result = $result;
    }
}
