Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions src/Illuminate/Contracts/JsonSchema/JsonSchema.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace Illuminate\Contracts\JsonSchema;

use Closure;

interface JsonSchema
{
/**
* Create a new object schema instance.
*
* @param (Closure(JsonSchema): array<string, \Illuminate\JsonSchema\Types\Type>)|array<string, \Illuminate\JsonSchema\Types\Type> $properties
* @return \Illuminate\JsonSchema\Types\ObjectType
*/
public function object(Closure|array $properties = []);

/**
* Create a new array property instance.
*
* @return \Illuminate\JsonSchema\Types\ArrayType
*/
public function array();

/**
* Create a new string property instance.
*
* @return \Illuminate\JsonSchema\Types\String
*/
public function string();

/**
* Create a new integer property instance.
*
* @return \Illuminate\JsonSchema\Types\IntegerType
*/
public function integer();

/**
* Create a new number property instance.
*
* @return \Illuminate\JsonSchema\Types\NumberType
*/
public function number();

/**
* Create a new boolean property instance.
*
* @return \Illuminate\JsonSchema\Types\BooleanType
*/
public function boolean();
}
3 changes: 2 additions & 1 deletion src/Illuminate/JsonSchema/JsonSchemaTypeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Illuminate\JsonSchema;

use Closure;
use Illuminate\Contracts\JsonSchema\JsonSchema as JsonSchemaContract;

class JsonSchemaTypeFactory extends JsonSchema
class JsonSchemaTypeFactory extends JsonSchema implements JsonSchemaContract
{
/**
* Create a new object schema instance.
Expand Down