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 App\Values; use Illuminate\Contracts\Support\Arrayable; use Illuminate\S..

Decoded Output download

<?php

namespace App\Values;

use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Webmozart\Assert\Assert;

final class SmartPlaylistRuleGroup implements Arrayable
{
    private function __construct(public string $id, public Collection $rules)
    {
        Assert::uuid($id);
    }

    public static function create(array $array): self
    {
        return new self(
            id: Arr::get($array, 'id'),
            rules: collect(Arr::get($array, 'rules', []))->transform([SmartPlaylistRule::class, 'create']),
        );
    }

    /** @return array<mixed> */
    public function toArray(): array
    {
        return [
            'id' => $this->id,
            'rules' => $this->rules->toArray(),
        ];
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace App\Values;

use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Webmozart\Assert\Assert;

final class SmartPlaylistRuleGroup implements Arrayable
{
    private function __construct(public string $id, public Collection $rules)
    {
        Assert::uuid($id);
    }

    public static function create(array $array): self
    {
        return new self(
            id: Arr::get($array, 'id'),
            rules: collect(Arr::get($array, 'rules', []))->transform([SmartPlaylistRule::class, 'create']),
        );
    }

    /** @return array<mixed> */
    public function toArray(): array
    {
        return [
            'id' => $this->id,
            'rules' => $this->rules->toArray(),
        ];
    }
}

Function Calls

None

Variables

None

Stats

MD5 7e2c62330abbbcf74da533f8d7d39ec9
Eval Count 0
Decode Time 113 ms