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 declare(strict_types=1); namespace Orion\ValueObjects\Specs\Responses\Success\Rela..

Decoded Output download

<?php

declare(strict_types=1);

namespace Orion\ValueObjects\Specs\Responses\Success\Relation\ManyToMany;

use Illuminate\Database\Eloquent\Model;
use Orion\ValueObjects\Specs\Response;

class UpdatePivotResponse extends Response
{
    /** @var Model */
    protected $resourceModel;

    /**
     * AttachResponse constructor.
     *
     * @param Model $resourceModel
     */
    public function __construct(Model $resourceModel)
    {
        $this->resourceModel = $resourceModel;
    }

    public function toArray(): array
    {
        return array_merge(
            parent::toArray(),
            [
                'content' => [
                    'application/json' => [
                        'schema' => [
                            'type' => 'object',
                            'properties' => [
                                'updated' => [
                                    'type' => 'array',
                                    'items' => [
                                        'type' => $this->resourceModel->getKeyType() === 'int' ? 'integer' : 'string',
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ]
        );
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

namespace Orion\ValueObjects\Specs\Responses\Success\Relation\ManyToMany;

use Illuminate\Database\Eloquent\Model;
use Orion\ValueObjects\Specs\Response;

class UpdatePivotResponse extends Response
{
    /** @var Model */
    protected $resourceModel;

    /**
     * AttachResponse constructor.
     *
     * @param Model $resourceModel
     */
    public function __construct(Model $resourceModel)
    {
        $this->resourceModel = $resourceModel;
    }

    public function toArray(): array
    {
        return array_merge(
            parent::toArray(),
            [
                'content' => [
                    'application/json' => [
                        'schema' => [
                            'type' => 'object',
                            'properties' => [
                                'updated' => [
                                    'type' => 'array',
                                    'items' => [
                                        'type' => $this->resourceModel->getKeyType() === 'int' ? 'integer' : 'string',
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ]
        );
    }
}

Function Calls

None

Variables

None

Stats

MD5 c32d631019ada2a0b7764b7062cf755f
Eval Count 0
Decode Time 85 ms