$38 GRAYBYTE WORDPRESS FILE MANAGER $27

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.162.162 | ADMIN IP 216.73.216.51
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bravetechrwanda/itiministry.org/plugins/give/src/API/REST/V3/Support/Schema/

HOME
Current File : /home/bravetechrwanda/itiministry.org/plugins/give/src/API/REST/V3/Support/Schema//SchemaType.php
<?php

namespace Give\API\REST\V3\Support\Schema;

use Give\Framework\Support\Contracts\Arrayable;

/**
 * @since 4.13.0
 */
class SchemaType implements Arrayable
{
    public bool $nullable = false;
    public string $description = '';
    public array $additional = [];
    public array $properties = [];
    public string $type = '';
    public bool $required = false;
    public bool $readonly = false;

    /**
     * @since 4.13.0
     */
    public function type(string $type): self
    {
        $this->type = $type;

        return $this;
    }

    /**
     * @since 4.13.0
     */
    public function readonly(bool $readonly = true): self
    {
        $this->readonly = $readonly;

        return $this;
    }

    /**
     * @since 4.13.0
     */
    public function nullable(bool $nullable = true): self
    {
        $this->nullable = $nullable;

        return $this;
    }

    /**
     * @since 4.13.0
     */
    public function description(string $description): self
    {
        $this->description = $description;

        return $this;
    }

    /**
     * @since 4.13.0
     */
    public function properties(array $properties): self
    {
        $this->properties = $properties;

        return $this;
    }

    /**
     * @since 4.13.0
     */
    public function additional(array $additional): self
    {
        $this->additional = $additional;

        return $this;
    }

    /**
     * @since 4.13.0
     */
    public function required(bool $required = true): self
    {
        $this->required = $required;

        return $this;
    }

    /**
     * @since 4.13.0
     */
    public function toArray(): array
    {
        $schema = [];
        $schema['type'] = $this->nullable ? [$this->type, 'null'] : $this->type;

        if (!empty($this->properties) && is_array($this->properties)) {
            $schema['properties'] = $this->properties;
        }
        if (!empty($this->description)) {
            $schema['description'] = $this->description;
        }
        if ($this->required === true) {
            $schema['required'] = array_keys($this->properties);
        }

        if ($this->readonly === true) {
            $schema['readonly'] = true;
        }

        return array_merge($schema, $this->additional);
    }
}

Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
SchemaType.php
2.222 KB
5 Nov 2025 7.00 PM
bravetechrwanda / bravetechrwanda
0644
SchemaTypes.php
1.099 KB
5 Nov 2025 7.00 PM
bravetechrwanda / bravetechrwanda
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF