-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,485 additions
and
1,357 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
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
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
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 |
---|---|---|
@@ -1,16 +1,18 @@ | ||
<?php | ||
|
||
|
||
use Briedis\ApiBuilder\StructureInterface; | ||
use Briedis\ApiBuilder\StructureBuilder; | ||
use Briedis\ApiBuilder\StructureInterface; | ||
|
||
class LocationStructure implements StructureInterface { | ||
/** | ||
* @return \Briedis\ApiBuilder\StructureBuilder | ||
*/ | ||
public function getStructure(){ | ||
return (new StructureBuilder('Location')) | ||
->float('lat', 'Latitude coordinate, in decimal format') | ||
->float('lon', 'Longitude coordinate, in decimal format'); | ||
} | ||
class LocationStructure implements StructureInterface | ||
{ | ||
/** | ||
* @return \Briedis\ApiBuilder\StructureBuilder | ||
*/ | ||
public function getStructure() | ||
{ | ||
return (new StructureBuilder('Location')) | ||
->float('lat', 'Latitude coordinate, in decimal format') | ||
->float('lon', 'Longitude coordinate, in decimal format'); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,23 +1,25 @@ | ||
<?php | ||
|
||
|
||
use Briedis\ApiBuilder\StructureInterface; | ||
use Briedis\ApiBuilder\StructureBuilder; | ||
use Briedis\ApiBuilder\StructureInterface; | ||
|
||
class UserStructure implements StructureInterface{ | ||
/** | ||
* Get User structure object | ||
* @return StructureBuilder | ||
*/ | ||
public function getStructure(){ | ||
return (new StructureBuilder('User')) | ||
->int('id', 'Unique identifier') | ||
->str('username', 'Nickname that will be used in the system') | ||
->str('firstName', 'Users first name') | ||
->str('lastName', 'Users last name') | ||
->str('gender', 'M - male, F - female')->values(['M', 'F'])->optional() | ||
->int('signature', 'Provide your favorite quote or something, if you want')->optional() | ||
->struct('location', new LocationStructure, 'Location object for the user')->optional() | ||
->int('createdAt', 'Unix timestamp, when user has registered'); | ||
} | ||
class UserStructure implements StructureInterface | ||
{ | ||
/** | ||
* Get User structure object | ||
* @return StructureBuilder | ||
*/ | ||
public function getStructure() | ||
{ | ||
return (new StructureBuilder('User')) | ||
->int('id', 'Unique identifier') | ||
->str('username', 'Nickname that will be used in the system') | ||
->str('firstName', 'Users first name') | ||
->str('lastName', 'Users last name') | ||
->str('gender', 'M - male, F - female')->values(['M', 'F'])->optional() | ||
->int('signature', 'Provide your favorite quote or something, if you want')->optional() | ||
->struct('location', new LocationStructure, 'Location object for the user')->optional() | ||
->int('createdAt', 'Unix timestamp, when user has registered'); | ||
} | ||
} |
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
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
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
Oops, something went wrong.