Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Psalm\Type\Atomic; use Psalm\Type; use function array_fill; /** * Den..

Decoded Output download

<?php

namespace Psalm\Type\Atomic;

use Psalm\Type;

use function array_fill;

/**
 * Denotes a list that is _also_ `callable`.
 *
 * @deprecated Will be removed in Psalm v6, please use TCallableKeyedArrays with is_list=true instead.
 * @psalm-immutable
 */
final class TCallableList extends TNonEmptyList implements TCallableInterface
{
    public const KEY = 'callable-list';
    public function getKeyedArray(): TKeyedArray
    {
        if (!$this->count && !$this->min_count) {
            return new TKeyedArray(
                [$this->type_param],
                null,
                [Type::getListKey(), $this->type_param],
                true,
                $this->from_docblock,
            );
        }
        if ($this->count) {
            return new TCallableKeyedArray(
                array_fill(0, $this->count, $this->type_param),
                null,
                null,
                true,
                $this->from_docblock,
            );
        }
        return new TCallableKeyedArray(
            array_fill(0, $this->min_count, $this->type_param),
            null,
            [Type::getListKey(), $this->type_param],
            true,
            $this->from_docblock,
        );
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Psalm\Type\Atomic;

use Psalm\Type;

use function array_fill;

/**
 * Denotes a list that is _also_ `callable`.
 *
 * @deprecated Will be removed in Psalm v6, please use TCallableKeyedArrays with is_list=true instead.
 * @psalm-immutable
 */
final class TCallableList extends TNonEmptyList implements TCallableInterface
{
    public const KEY = 'callable-list';
    public function getKeyedArray(): TKeyedArray
    {
        if (!$this->count && !$this->min_count) {
            return new TKeyedArray(
                [$this->type_param],
                null,
                [Type::getListKey(), $this->type_param],
                true,
                $this->from_docblock,
            );
        }
        if ($this->count) {
            return new TCallableKeyedArray(
                array_fill(0, $this->count, $this->type_param),
                null,
                null,
                true,
                $this->from_docblock,
            );
        }
        return new TCallableKeyedArray(
            array_fill(0, $this->min_count, $this->type_param),
            null,
            [Type::getListKey(), $this->type_param],
            true,
            $this->from_docblock,
        );
    }
}

Function Calls

None

Variables

None

Stats

MD5 1f78ee6008a04875c8a2a15bd33007df
Eval Count 0
Decode Time 84 ms