PHP Class Webiny\Component\Rest\Tests\Mocks\MockApiClass

Inheritance: implements Webiny\Component\Rest\Interfaces\VersionInterface
Show file Open project: Webiny/Framework

Public Methods

Method Description
getAllVersions ( ) : array Returns a list of all version, where the key is the version, and value is the namespace.
getCurrentVersion ( ) : string Returns the current api version. For example, you might have the latest version in a "beta" state, so you wish to keep your users using the latest stable versions.
getLatestVersion ( ) : string Returns the latest (highest) available api version.
simpleMethod ( )
someMethod ( string $param1, string $param2 = "default", integer $param3 = 22 ) : array

Method Details

getAllVersions() public static method

Example: [ '1.0' => 'MyApp/Apis/Cms/Page/V1x1/', '1.2' => 'MyApp/Apis/Cms/Page/V1x2/', '2.0' => 'MyApp/Apis/Cms/Page/', ] How you organize your namespace is up to you.
public static getAllVersions ( ) : array
return array

getCurrentVersion() public static method

Users can still access the latest version if the specify the latest version number or "latest" as a version name in the X-Webiny-Rest-Version header. Version should be in format of A.B, for example: 1.1
public static getCurrentVersion ( ) : string
return string

getLatestVersion() public static method

Version should be in format of A.B, for example: 1.1
public static getLatestVersion ( ) : string
return string

simpleMethod() public method

public simpleMethod ( )

someMethod() public method

public someMethod ( string $param1, string $param2 = "default", integer $param3 = 22 ) : array
$param1 string Some param.
$param2 string Other param.
$param3 integer
return array