Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
Merge pull request #46 from chris-die/master
Browse files Browse the repository at this point in the history
Adds `Serato\SwsApp\InterfaceToApiSchemaArray`
  • Loading branch information
chris-die authored Nov 26, 2018
2 parents 9f82f3c + 93c6bd5 commit 0af2141
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/InterfaceToApiSchemaArray.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
namespace Serato\SwsApp;

/**
* Defines the methods required for an object to return an array representation
* of it's data that conforms to a JSON specifications for an API endpoint.
*/
interface InterfaceToApiSchemaArray
{
/**
* Returns an array representation of the data that conforms to the
* JSON schema. Can take an array `$options` of model-specific formatting
* options that can alter the content or format of the returned array.
*
* @param array $options Formatting options
*
* @return array
*/
public function toApiSchemaArray(array $options = []): array;

/**
* Returns the path to a JSON file containing the schema definition for the model
*
* @return string
*/
public function getSchemaFilePath(): string;

/**
* Returns the name of the schema definition for the model
*
* @return string
*/
public function getSchemaDefintion(): string;
}

0 comments on commit 0af2141

Please sign in to comment.