PHP 8.2.31
Preview: CoercionError.php Size: 1.32 KB
//home/nshryvcy/radiantskinclinics.org/wp-content/plugins/woocommerce/lib/packages/GraphQL/Error/CoercionError.php

<?php declare(strict_types=1);

namespace Automattic\WooCommerce\Vendor\GraphQL\Error;

use Automattic\WooCommerce\Vendor\GraphQL\Utils\Utils;

/**
 * @phpstan-type InputPath list<string|int>
 */
class CoercionError extends Error
{
    /** @var InputPath|null */
    public ?array $inputPath;

    /** @var mixed whatever invalid value was passed */
    public $invalidValue;

    /**
     * @param InputPath|null $inputPath
     * @param mixed $invalidValue whatever invalid value was passed
     *
     * @return static
     */
    public static function make(
        string $message,
        ?array $inputPath,
        $invalidValue,
        ?\Throwable $previous = null
    ): self {
        $instance = new static($message, null, null, [], null, $previous);
        $instance->inputPath = $inputPath;
        $instance->invalidValue = $invalidValue;

        return $instance;
    }

    public function printInputPath(): ?string
    {
        if ($this->inputPath === null) {
            return null;
        }

        $path = '';
        foreach ($this->inputPath as $segment) {
            $path .= is_int($segment)
                ? "[{$segment}]"
                : ".{$segment}";
        }

        return $path;
    }

    public function printInvalidValue(): string
    {
        return Utils::printSafeJson($this->invalidValue);
    }
}

Directory Contents

Dirs: 0 × Files: 11

Name Size Perms Modified Actions
598 B lrw-r--r-- 2026-05-05 14:26:50
Edit Download
1.32 KB lrw-r--r-- 2026-05-05 14:26:50
Edit Download
408 B lrw-r--r-- 2026-05-05 14:26:50
Edit Download
9.75 KB lrw-r--r-- 2026-05-05 14:26:50
Edit Download
11.32 KB lrw-r--r-- 2026-05-05 14:26:50
Edit Download
286 B lrw-r--r-- 2026-05-05 14:26:50
Edit Download
400 B lrw-r--r-- 2026-05-05 14:26:50
Edit Download
319 B lrw-r--r-- 2026-05-05 14:26:50
Edit Download
427 B lrw-r--r-- 2026-05-05 14:26:50
Edit Download
327 B lrw-r--r-- 2026-05-05 14:26:50
Edit Download
4.05 KB lrw-r--r-- 2026-05-05 14:26:50
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).