Skip to content

Commit de1cb64

Browse files
authored
Merge pull request msyk#94 from patacra/master
Trying to fix types in PHP Documentor comments, to help auto-complete and linters do their job
2 parents 11d5585 + fe719ed commit de1cb64

4 files changed

Lines changed: 28 additions & 25 deletions

File tree

src/FMDataAPI.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use INTERMediator\FileMakerServer\RESTAPI\Supporting\FileMakerLayout;
66
use INTERMediator\FileMakerServer\RESTAPI\Supporting\FileMakerRelation;
7+
use INTERMediator\FileMakerServer\RESTAPI\Supporting\CommunicationProvider;
78
use Exception;
89

910
/**
@@ -26,12 +27,13 @@ class FMDataAPI
2627
*/
2728

2829
/**
29-
* Keeping the FileMakerLayout object for each layout
30+
* @var FileMakerLayout[] Keeping the FileMakerLayout object for each layout.
3031
* @ignore
3132
*/
3233
private $layoutTable = [];
34+
3335
/**
34-
* Keeping the CommunicationProvider object
36+
* @var null|CommunicationProvider Keeping the CommunicationProvider object.
3537
* @ignore
3638
*/
3739
private $provider = null;
@@ -40,7 +42,7 @@ class FMDataAPI
4042
* FMDataAPI constructor. If you want to activate OAuth authentication, $user and $password are set as
4143
* oAuthRequestId and oAuthIdentifier. Moreover, call useOAuth method before accessing layouts.
4244
* @param string $solution The database file name which is just hosting.
43-
* Every database must have the access privillege 'fmrest' including external data sources.
45+
* Every database must have the access privilege 'fmrest' including external data sources.
4446
* @param string $user The fmrest privilege accessible user to the database.
4547
* If you are going to call useOAuth method, you have to specify the data for X-FM-Data-OAuth-Request-Id.
4648
* @param string $password The password of above user.
@@ -51,7 +53,7 @@ class FMDataAPI
5153
* @param string $protocol FileMaker Server's protocol name. If omitted, 'https' is chosen.
5254
* @param array $fmDataSource Authentication information for external data sources.
5355
* Ex. [{"database"=>"<databaseName>", "username"=>"<username>", "password"=>"<password>"].
54-
* If you use OAuth, "oAuthRequestId" and "oAuthIdentifier" keys have to be spedified.
56+
* If you use OAuth, "oAuthRequestId" and "oAuthIdentifier" keys have to be specified.
5557
* @param boolean $isUnitTest If it's set to true, the communication provider just works locally.
5658
*/
5759
public function __construct(
@@ -163,7 +165,7 @@ public function setFieldHTMLEncoding($value)
163165
* Detect the return value of the field() method uses htmlspecialchars function or not.
164166
* @return bool The result.
165167
*/
166-
public function getFieldHTMLEncoding($value)
168+
public function getFieldHTMLEncoding()
167169
{
168170
return $this->provider->fieldHTMLEncoding;
169171
}
@@ -226,7 +228,7 @@ public function errorCode()
226228
/**
227229
* The error message of the latest response from the REST API.
228230
* This error message is associated with FileMaker's error code.
229-
* @return string The error messege.
231+
* @return string The error message.
230232
*/
231233
public function errorMessage()
232234
{

src/Supporting/CommunicationProvider.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class CommunicationProvider
3434
*/
3535
private $password = "1234";
3636
/**
37-
* @var
37+
* @var string
3838
* @ignore
3939
*/
4040
private $solution;
@@ -115,7 +115,7 @@ class CommunicationProvider
115115
*/
116116
public $foundCount = 0;
117117
/**
118-
* @varint
118+
* @var int
119119
* @ignore
120120
*/
121121
public $returnedCount = 0;
@@ -213,12 +213,12 @@ class CommunicationProvider
213213

214214
/**
215215
* CommunicationProvider constructor.
216-
* @param $solution
217-
* @param $user
218-
* @param $password
219-
* @param null $host
220-
* @param null $port
221-
* @param null $protocol
216+
* @param string $solution
217+
* @param string $user
218+
* @param string $password
219+
* @param null|string $host
220+
* @param null|int $port
221+
* @param null|string $protocol
222222
* @ignore
223223
*/
224224
public function __construct($solution, $user, $password, $host = null, $port = null, $protocol = null, $fmDataSource = null)
@@ -247,9 +247,11 @@ public function __construct($solution, $user, $password, $host = null, $port = n
247247
}
248248

249249
/**
250-
* @param $action
251-
* @param $layout
252-
* @param null $recordId
250+
* @param array $params Array to build the API path. Ex: `["layouts" => null]` or `["sessions" => $this->accessToken]`.
251+
* @param null|array $request The query parameters as `"key" => "value"`.
252+
* @param string $methodLower The method in lowercase. Ex: `"get"`, `"delete"`, etc.
253+
* @param bool $isSystem If the query is for the system (sessions, databases, etc) or for a database.
254+
* @param false|string $directPath If we don't want to build the path with the other parameters, you can provide the direct path.
253255
* @return string
254256
* @ignore
255257
*/

src/Supporting/FileMakerLayout.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ class FileMakerLayout
2222
*/
2323
private $restAPI = null;
2424
/**
25-
* @var null
25+
* @var null|string
2626
* @ignore
2727
*/
2828
private $layout = null;
2929

3030
/**
3131
* FileMakerLayout constructor.
32-
* @param $restAPI
33-
* @param $layout
32+
* @param CommunicationProvider $restAPI
33+
* @param string $layout
3434
* @ignore
3535
*/
3636
public function __construct($restAPI, $layout)
@@ -86,7 +86,7 @@ private function buildPortalParameters($param, $shortKey = false, $method = "GET
8686
}
8787

8888
/**
89-
* @param $param
89+
* @param array $param
9090
* @return array
9191
* @ignore
9292
*/

src/Supporting/FileMakerRelation.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class FileMakerRelation implements Iterator
2222
{
2323
/**
24-
* @var null|array
24+
* @var null|object
2525
* @ignore
2626
*/
2727
private $data = null;
@@ -194,13 +194,12 @@ public function count(): int
194194
case "OK":
195195
case "PORTAL":
196196
return count($this->data);
197-
break;
198197
case "RECORD":
199198
case "PORTALRECORD":
200199
return 1;
201-
break;
200+
default:
201+
return 0;
202202
}
203-
return 0;
204203
}
205204

206205
/**

0 commit comments

Comments
 (0)