Skip to content

Commit 0d0aeb1

Browse files
committed
add exception interfaces
1 parent 14e3e49 commit 0d0aeb1

File tree

6 files changed

+105
-3
lines changed

6 files changed

+105
-3
lines changed

src/IConnection.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@ public function getId();
4040
* Send a ping request via an established connection to verify that the
4141
* connection works.
4242
* @return boolean success?
43-
* @throws \phpsap\exceptions\ConnectionFailedException
43+
* @throws \phpsap\interfaces\IConnectionFailedException
4444
*/
4545
public function ping();
4646

4747
/**
4848
* Prepare a remote function call and return a function instance.
4949
* @param string $functionName
5050
* @return \phpsap\interfaces\IFunction
51+
* @throws \phpsap\interfaces\IConnectionFailedException
52+
* @throws \phpsap\interfaces\IUnknownFunctionException
5153
*/
5254
public function prepareFunction($functionName);
5355

src/IConnectionFailedException.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* File src/IConnectionFailedException.php
4+
*
5+
* The SAP connection failed.
6+
*
7+
* @package interfaces
8+
* @author Gregor J.
9+
* @license MIT
10+
*/
11+
12+
namespace phpsap\interfaces;
13+
14+
/**
15+
* Class phpsap\interfaces\IConnectionFailedException
16+
*
17+
* The SAP connection failed.
18+
*
19+
* @package phpsap\interfaces
20+
* @author Gregor J.
21+
* @license MIT
22+
*/
23+
interface IConnectionFailedException extends ISapException
24+
{
25+
}

src/IFunction.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
namespace phpsap\interfaces;
1313

14-
use kbATeam\TypeCast\ITypeCast;
15-
1614
/**
1715
* Interface IFunction
1816
*
@@ -48,6 +46,8 @@ public function setParam($name, $value);
4846
* Invoke the prepared function call.
4947
* @param null|array $params Optional parameter array.
5048
* @return array
49+
* @throws \phpsap\interfaces\IConnectionFailedException
50+
* @throws \phpsap\interfaces\IFunctionCallException
5151
*/
5252
public function invoke($params = null);
5353
}

src/IFunctionCallException.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* File src/IFunctionCallException.php
4+
*
5+
* The SAP remote function call failed.
6+
*
7+
* @package interfaces
8+
* @author Gregor J.
9+
* @license MIT
10+
*/
11+
12+
namespace phpsap\interfaces;
13+
14+
/**
15+
* Class phpsap\interfaces\IFunctionCallException
16+
*
17+
* The SAP remote function call failed.
18+
*
19+
* @package phpsap\interfaces
20+
* @author Gregor J.
21+
* @license MIT
22+
*/
23+
interface IFunctionCallException extends ISapException
24+
{
25+
}

src/ISapException.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* File src/ISapException.php
4+
*
5+
* Interface for the generic SAP exception.
6+
*
7+
* @package interfaces
8+
* @author Gregor J.
9+
* @license MIT
10+
*/
11+
12+
namespace phpsap\interfaces;
13+
14+
/**
15+
* Class phpsap\interfaces\ISapException
16+
*
17+
* Interface for the generic SAP exception.
18+
*
19+
* @package phpsap\interfaces
20+
* @author Gregor J.
21+
* @license MIT
22+
*/
23+
interface ISapException
24+
{
25+
}

src/IUnknownFunctionException.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* File src/IUnknownFunctionException.php
4+
*
5+
* The requested function could not be found.
6+
*
7+
* @package interfaces
8+
* @author Gregor J.
9+
* @license MIT
10+
*/
11+
12+
namespace phpsap\interfaces;
13+
14+
/**
15+
* Class phpsap\interfaces\IUnknownFunctionException
16+
*
17+
* The requested function could not be found.
18+
*
19+
* @package phpsap\interfaces
20+
* @author Gregor J.
21+
* @license MIT
22+
*/
23+
interface IUnknownFunctionException extends ISapException
24+
{
25+
}

0 commit comments

Comments
 (0)