This repository has been archived by the owner on Jan 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from chris-die/master
Adds `Serato\SwsApp\InterfaceToApiSchemaArray`
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |