Skip to content

Commit 1dee8bf

Browse files
committed
add return type declarations #8
1 parent 34792be commit 1dee8bf

File tree

9 files changed

+51
-51
lines changed

9 files changed

+51
-51
lines changed

src/Api/IApi.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@ interface IApi extends IJsonSerializable
2222
* @param IValue $value
2323
* @return $this
2424
*/
25-
public function add(IValue $value);
25+
public function add(IValue $value): IApi;
2626

2727
/**
2828
* Get all input values of the remote function.
2929
* @return IValue[]
3030
*/
31-
public function getInputValues();
31+
public function getInputValues(): array;
3232

3333
/**
3434
* Get all output values of the remote function.
3535
* @return IValue[]
3636
*/
37-
public function getOutputValues();
37+
public function getOutputValues(): array;
3838

3939
/**
4040
* Get all tables of the remote function.
4141
* @return ITable[]
4242
*/
43-
public function getTables();
43+
public function getTables(): array;
4444
}

src/Api/IArray.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ interface IArray extends IValue
2828
* @throws IArrayElementMissingException
2929
* @throws IInvalidArgumentException
3030
*/
31-
public function cast($value);
31+
public function cast($value): array;
3232

3333
/**
3434
* Return an array of member elements.
3535
* @return IElement[]
3636
*/
37-
public function getMembers();
37+
public function getMembers(): array;
3838
}

src/Api/IElement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ interface IElement extends IJsonSerializable
7979
* The PHP type of the element.
8080
* @return string
8181
*/
82-
public function getType();
82+
public function getType(): string;
8383

8484
/**
8585
* The name of the element.
8686
* @return string
8787
*/
88-
public function getName();
88+
public function getName(): string;
8989

9090
/**
9191
* Cast a given output value to the implemented value.

src/Api/IValue.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ interface IValue extends IElement
3939
* interface.
4040
* @return string
4141
*/
42-
public function getDirection();
42+
public function getDirection(): string;
4343

4444
/**
4545
* Is the element optional?
4646
* @return bool
4747
*/
48-
public function isOptional();
48+
public function isOptional(): bool;
4949
}

src/Config/IConfigCommon.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,51 +87,51 @@ interface IConfigCommon extends IConfiguration
8787
* @return string The username.
8888
* @throws IIncompleteConfigException
8989
*/
90-
public function getUser();
90+
public function getUser(): string;
9191

9292
/**
9393
* Set the username to use for authentication.
9494
* @param string $user The username.
9595
* @return $this
9696
* @throws IInvalidArgumentException
9797
*/
98-
public function setUser(string $user);
98+
public function setUser(string $user): IConfigCommon;
9999

100100
/**
101101
* Get the password to use for authentication.
102102
* @return string The password.
103103
* @throws IIncompleteConfigException
104104
*/
105-
public function getPasswd();
105+
public function getPasswd(): string;
106106

107107
/**
108108
* Set the password to use for authentication.
109109
* @param string $passwd The password.
110110
* @return $this
111111
* @throws IInvalidArgumentException
112112
*/
113-
public function setPasswd(string $passwd);
113+
public function setPasswd(string $passwd): IConfigCommon;
114114

115115
/**
116116
* Get the client.
117117
* @return string The client
118118
* @throws IIncompleteConfigException
119119
*/
120-
public function getClient();
120+
public function getClient(): string;
121121

122122
/**
123123
* Set the client.
124124
* @param string $client The client.
125125
* @return $this
126126
* @throws IInvalidArgumentException
127127
*/
128-
public function setClient(string $client);
128+
public function setClient(string $client): IConfigCommon;
129129

130130
/**
131131
* Get the SAPRouter in case the connection needs to be made through a firewall.
132132
* @return string|null The saprouter or NULL in case the saprouter hasn't been set.
133133
*/
134-
public function getSaprouter();
134+
public function getSaprouter(): ?string;
135135

136136
/**
137137
* In case the connection needs to be made through a firewall using a SAPRouter,
@@ -141,21 +141,21 @@ public function getSaprouter();
141141
* @return $this
142142
* @throws IInvalidArgumentException
143143
*/
144-
public function setSaprouter(string $saprouter);
144+
public function setSaprouter(string $saprouter): IConfigCommon;
145145

146146
/**
147147
* Get the trace level. See constants TRACE_*.
148148
* @return int|null The trace level or NULL in case the trace level hasn't been set.
149149
*/
150-
public function getTrace();
150+
public function getTrace(): ?int;
151151

152152
/**
153153
* Set the trace level. See constants TRACE_*.
154154
* @param int $trace The trace level.
155155
* @return $this
156156
* @throws IInvalidArgumentException
157157
*/
158-
public function setTrace(int $trace);
158+
public function setTrace(int $trace): IConfigCommon;
159159

160160
/**
161161
* Only needed it if you want to connect to a non-Unicode backend using a
@@ -164,7 +164,7 @@ public function setTrace(int $trace);
164164
* username/password.
165165
* @return int|null The codepage or NULL in case the codepage hasn't been set.
166166
*/
167-
public function getCodepage();
167+
public function getCodepage(): ?int;
168168

169169
/**
170170
* Only needed it if you want to connect to a non-Unicode backend using a
@@ -175,33 +175,33 @@ public function getCodepage();
175175
* @return $this
176176
* @throws IInvalidArgumentException
177177
*/
178-
public function setCodepage(int $codepage);
178+
public function setCodepage(int $codepage): IConfigCommon;
179179

180180
/**
181181
* Get the logon Language.
182182
* @return string|null The logon language or NULL in case the logon language hasn't been set.
183183
*/
184-
public function getLang();
184+
public function getLang(): ?string;
185185

186186
/**
187187
* Set the logon language.
188188
* @param string $lang The logon language.
189189
* @return $this
190190
* @throws IInvalidArgumentException
191191
*/
192-
public function setLang(string $lang);
192+
public function setLang(string $lang): IConfigCommon;
193193

194194
/**
195195
* Get the destination in RfcOpenConnection.
196196
* @return string|null The destination or NULL in case the destination hasn't been set.
197197
*/
198-
public function getDest();
198+
public function getDest(): ?string;
199199

200200
/**
201201
* Set the destination in RfcOpenConnection.
202202
* @param string $dest The destination in RfcOpenConnection.
203203
* @return $this
204204
* @throws IInvalidArgumentException
205205
*/
206-
public function setDest(string $dest);
206+
public function setDest(string $dest): IConfigCommon;
207207
}

src/Config/IConfigTypeA.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,56 +42,56 @@ interface IConfigTypeA extends IConfigCommon
4242
* @return string The hostname of a specific SAP application server.
4343
* @throws IIncompleteConfigException
4444
*/
45-
public function getAshost();
45+
public function getAshost(): string;
4646

4747
/**
4848
* Set the hostname of a specific SAP application server.
4949
* @param string $ashost The hostname of a specific SAP application server.
5050
* @return $this
5151
* @throws IInvalidArgumentException
5252
*/
53-
public function setAshost(string $ashost);
53+
public function setAshost(string $ashost): IConfigTypeA;
5454

5555
/**
5656
* Get the SAP system number.
5757
* @return string The SAP system number.
5858
* @throws IIncompleteConfigException
5959
*/
60-
public function getSysnr();
60+
public function getSysnr(): string;
6161

6262
/**
6363
* Set the SAP system number.
6464
* @param string $sysnr The SAP system number.
6565
* @return $this
6666
* @throws IInvalidArgumentException
6767
*/
68-
public function setSysnr(string $sysnr);
68+
public function setSysnr(string $sysnr): IConfigTypeA;
6969

7070
/**
7171
* Get the gateway host on the application server.
7272
* @return string|null The gateway host or NULL in case no gateway host has been defined.
7373
*/
74-
public function getGwhost();
74+
public function getGwhost(): ?string;
7575

7676
/**
7777
* Set the gateway host on the application server.
7878
* @param string $gwhost The gateway host.
7979
* @return $this
8080
* @throws IInvalidArgumentException
8181
*/
82-
public function setGwhost(string $gwhost);
82+
public function setGwhost(string $gwhost): IConfigTypeA;
8383

8484
/**
8585
* Get the gateway service on the application server.
8686
* @return string|null The gateway service or NULL in case no gateway service has been defined.
8787
*/
88-
public function getGwserv();
88+
public function getGwserv(): ?string;
8989

9090
/**
9191
* Set the gateway service on the application server.
9292
* @param string $gwserv The gateway service on the application server.
9393
* @return $this
9494
* @throws IInvalidArgumentException
9595
*/
96-
public function setGwserv(string $gwserv);
96+
public function setGwserv(string $gwserv): IConfigTypeA;
9797
}

src/Config/IConfigTypeB.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,41 +38,41 @@ interface IConfigTypeB extends IConfigCommon
3838
* @return string
3939
* @throws IIncompleteConfigException
4040
*/
41-
public function getMshost();
41+
public function getMshost(): string;
4242

4343
/**
4444
* Set the host name of the message server.
4545
* @param string $mshost The host name of the message server.
4646
* @return $this
4747
* @throws IInvalidArgumentException
4848
*/
49-
public function setMshost(string $mshost);
49+
public function setMshost(string $mshost): IConfigTypeB;
5050

5151
/**
5252
* Get the name of SAP system, optional; default: destination
5353
* @return string|null The name of the SAP system or NULL in case no name has been defined.
5454
*/
55-
public function getR3name();
55+
public function getR3name(): ?string;
5656

5757
/**
5858
* Set the name of SAP system, optional; default: destination
5959
* @param string $r3name The name of the SAP system.
6060
* @return $this
6161
* @throws IInvalidArgumentException
6262
*/
63-
public function setR3name(string $r3name);
63+
public function setR3name(string $r3name): IConfigTypeB;
6464

6565
/**
6666
* Get the group name of the application servers, optional; default: PUBLIC.
6767
* @return string|null The name of the group or NULL in case no group has been defined.
6868
*/
69-
public function getGroup();
69+
public function getGroup(): ?string;
7070

7171
/**
7272
* Set the group name of the application servers, optional; default: PUBLIC.
7373
* @param string $group The group name of the application servers.
7474
* @return $this
7575
* @throws IInvalidArgumentException
7676
*/
77-
public function setGroup(string $group);
77+
public function setGroup(string $group): IConfigTypeB;
7878
}

0 commit comments

Comments
 (0)