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
14 changes: 8 additions & 6 deletions src/FMDataAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use INTERMediator\FileMakerServer\RESTAPI\Supporting\FileMakerLayout;
use INTERMediator\FileMakerServer\RESTAPI\Supporting\FileMakerRelation;
use INTERMediator\FileMakerServer\RESTAPI\Supporting\CommunicationProvider;
use Exception;

/**
Expand All @@ -26,12 +27,13 @@ class FMDataAPI
*/

/**
* Keeping the FileMakerLayout object for each layout
* @var FileMakerLayout[] Keeping the FileMakerLayout object for each layout.
* @ignore
*/
private $layoutTable = [];

/**
* Keeping the CommunicationProvider object
* @var null|CommunicationProvider Keeping the CommunicationProvider object.
* @ignore
*/
private $provider = null;
Expand All @@ -40,7 +42,7 @@ class FMDataAPI
* FMDataAPI constructor. If you want to activate OAuth authentication, $user and $password are set as
* oAuthRequestId and oAuthIdentifier. Moreover, call useOAuth method before accessing layouts.
* @param string $solution The database file name which is just hosting.
* Every database must have the access privillege 'fmrest' including external data sources.
* Every database must have the access privilege 'fmrest' including external data sources.
* @param string $user The fmrest privilege accessible user to the database.
* If you are going to call useOAuth method, you have to specify the data for X-FM-Data-OAuth-Request-Id.
* @param string $password The password of above user.
Expand All @@ -51,7 +53,7 @@ class FMDataAPI
* @param string $protocol FileMaker Server's protocol name. If omitted, 'https' is chosen.
* @param array $fmDataSource Authentication information for external data sources.
* Ex. [{"database"=>"<databaseName>", "username"=>"<username>", "password"=>"<password>"].
* If you use OAuth, "oAuthRequestId" and "oAuthIdentifier" keys have to be spedified.
* If you use OAuth, "oAuthRequestId" and "oAuthIdentifier" keys have to be specified.
* @param boolean $isUnitTest If it's set to true, the communication provider just works locally.
*/
public function __construct(
Expand Down Expand Up @@ -163,7 +165,7 @@ public function setFieldHTMLEncoding($value)
* Detect the return value of the field() method uses htmlspecialchars function or not.
* @return bool The result.
*/
public function getFieldHTMLEncoding($value)
public function getFieldHTMLEncoding()
{
return $this->provider->fieldHTMLEncoding;
}
Expand Down Expand Up @@ -226,7 +228,7 @@ public function errorCode()
/**
* The error message of the latest response from the REST API.
* This error message is associated with FileMaker's error code.
* @return string The error messege.
* @return string The error message.
*/
public function errorMessage()
{
Expand Down
24 changes: 13 additions & 11 deletions src/Supporting/CommunicationProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CommunicationProvider
*/
private $password = "1234";
/**
* @var
* @var string
* @ignore
*/
private $solution;
Expand Down Expand Up @@ -115,7 +115,7 @@ class CommunicationProvider
*/
public $foundCount = 0;
/**
* @varint
* @var int
* @ignore
*/
public $returnedCount = 0;
Expand Down Expand Up @@ -213,12 +213,12 @@ class CommunicationProvider

/**
* CommunicationProvider constructor.
* @param $solution
* @param $user
* @param $password
* @param null $host
* @param null $port
* @param null $protocol
* @param string $solution
* @param string $user
* @param string $password
* @param null|string $host
* @param null|int $port
* @param null|string $protocol
* @ignore
*/
public function __construct($solution, $user, $password, $host = null, $port = null, $protocol = null, $fmDataSource = null)
Expand Down Expand Up @@ -247,9 +247,11 @@ public function __construct($solution, $user, $password, $host = null, $port = n
}

/**
* @param $action
* @param $layout
* @param null $recordId
* @param array $params Array to build the API path. Ex: `["layouts" => null]` or `["sessions" => $this->accessToken]`.
* @param null|array $request The query parameters as `"key" => "value"`.
* @param string $methodLower The method in lowercase. Ex: `"get"`, `"delete"`, etc.
* @param bool $isSystem If the query is for the system (sessions, databases, etc) or for a database.
* @param false|string $directPath If we don't want to build the path with the other parameters, you can provide the direct path.
* @return string
* @ignore
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Supporting/FileMakerLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ class FileMakerLayout
*/
private $restAPI = null;
/**
* @var null
* @var null|string
* @ignore
*/
private $layout = null;

/**
* FileMakerLayout constructor.
* @param $restAPI
* @param $layout
* @param CommunicationProvider $restAPI
* @param string $layout
* @ignore
*/
public function __construct($restAPI, $layout)
Expand Down Expand Up @@ -86,7 +86,7 @@ private function buildPortalParameters($param, $shortKey = false, $method = "GET
}

/**
* @param $param
* @param array $param
* @return array
* @ignore
*/
Expand Down
7 changes: 3 additions & 4 deletions src/Supporting/FileMakerRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class FileMakerRelation implements Iterator
{
/**
* @var null|array
* @var null|object
* @ignore
*/
private $data = null;
Expand Down Expand Up @@ -194,13 +194,12 @@ public function count(): int
case "OK":
case "PORTAL":
return count($this->data);
break;
case "RECORD":
case "PORTALRECORD":
return 1;
break;
default:
return 0;
}
return 0;
}

/**
Expand Down