From beb4dbc5cdfda2dfbdb1aa90d0b853f9d361ffe9 Mon Sep 17 00:00:00 2001 From: Gregor Date: Tue, 10 Oct 2023 17:41:24 +0200 Subject: [PATCH] replace fully qualified class names with use #6 --- src/Api/IApi.php | 8 ++--- src/Api/IArray.php | 9 ++++-- src/Api/IElement.php | 7 +++-- src/Config/IConfigCommon.php | 25 +++++++++------- src/Config/IConfigTypeA.php | 15 ++++++---- src/Config/IConfigTypeB.php | 11 ++++--- src/IFunction.php | 55 ++++++++++++++++++---------------- src/Util/IJsonSerializable.php | 5 ++-- 8 files changed, 78 insertions(+), 57 deletions(-) diff --git a/src/Api/IApi.php b/src/Api/IApi.php index 8e42176..ebe61d9 100644 --- a/src/Api/IApi.php +++ b/src/Api/IApi.php @@ -19,26 +19,26 @@ interface IApi extends IJsonSerializable { /** * Add a value, struct or table of the remote function. - * @param \phpsap\interfaces\Api\IValue $value + * @param IValue $value * @return $this */ public function add(IValue $value); /** * Get all input values of the remote function. - * @return \phpsap\interfaces\Api\IValue[] + * @return IValue[] */ public function getInputValues(); /** * Get all output values of the remote function. - * @return \phpsap\interfaces\Api\IValue[] + * @return IValue[] */ public function getOutputValues(); /** * Get all tables of the remote function. - * @return \phpsap\interfaces\Api\ITable[] + * @return ITable[] */ public function getTables(); } diff --git a/src/Api/IArray.php b/src/Api/IArray.php index ea995dc..b064d57 100644 --- a/src/Api/IArray.php +++ b/src/Api/IArray.php @@ -2,6 +2,9 @@ namespace phpsap\interfaces\Api; +use phpsap\interfaces\exceptions\IArrayElementMissingException; +use phpsap\interfaces\exceptions\IInvalidArgumentException; + /** * Interface IArray * @@ -22,14 +25,14 @@ interface IArray extends IValue * Cast a given output value to the implemented value. * @param array $value The output array to typecast. * @return array - * @throws \phpsap\interfaces\exceptions\IArrayElementMissingException - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @throws IArrayElementMissingException + * @throws IInvalidArgumentException */ public function cast($value); /** * Return an array of member elements. - * @return \phpsap\interfaces\Api\IElement[] + * @return IElement[] */ public function getMembers(); } diff --git a/src/Api/IElement.php b/src/Api/IElement.php index 8a8827b..781c8ba 100644 --- a/src/Api/IElement.php +++ b/src/Api/IElement.php @@ -2,6 +2,9 @@ namespace phpsap\interfaces\Api; +use phpsap\DateTime\SapDateInterval; +use phpsap\DateTime\SapDateTime; +use phpsap\interfaces\exceptions\IInvalidArgumentException; use phpsap\interfaces\Util\IJsonSerializable; /** @@ -87,8 +90,8 @@ public function getName(); /** * Cast a given output value to the implemented value. * @param bool|int|float|string $value The output to typecast. - * @return bool|int|float|string|\phpsap\DateTime\SapDateTime|\phpsap\DateTime\SapDateInterval - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @return bool|int|float|string|SapDateTime|SapDateInterval + * @throws IInvalidArgumentException */ public function cast($value); } diff --git a/src/Config/IConfigCommon.php b/src/Config/IConfigCommon.php index ffb7dbd..611c828 100644 --- a/src/Config/IConfigCommon.php +++ b/src/Config/IConfigCommon.php @@ -2,6 +2,9 @@ namespace phpsap\interfaces\Config; +use phpsap\interfaces\exceptions\IIncompleteConfigException; +use phpsap\interfaces\exceptions\IInvalidArgumentException; + /** * Interface IConfig * @@ -82,7 +85,7 @@ interface IConfigCommon extends IConfiguration /** * Get the username to use for authentication. * @return string The username. - * @throws \phpsap\interfaces\exceptions\IIncompleteConfigException + * @throws IIncompleteConfigException */ public function getUser(); @@ -90,14 +93,14 @@ public function getUser(); * Set the username to use for authentication. * @param string $user The username. * @return $this - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @throws IInvalidArgumentException */ public function setUser($user); /** * Get the password to use for authentication. * @return string The password. - * @throws \phpsap\interfaces\exceptions\IIncompleteConfigException + * @throws IIncompleteConfigException */ public function getPasswd(); @@ -105,14 +108,14 @@ public function getPasswd(); * Set the password to use for authentication. * @param string $passwd The password. * @return $this - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @throws IInvalidArgumentException */ public function setPasswd($passwd); /** * Get the client. * @return string The client - * @throws \phpsap\interfaces\exceptions\IIncompleteConfigException + * @throws IIncompleteConfigException */ public function getClient(); @@ -120,7 +123,7 @@ public function getClient(); * Set the client. * @param string $client The client. * @return $this - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @throws IInvalidArgumentException */ public function setClient($client); @@ -136,7 +139,7 @@ public function getSaprouter(); * /H/hostname/S/portnumber/H/ * @param string $saprouter The saprouter. * @return $this - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @throws IInvalidArgumentException */ public function setSaprouter($saprouter); @@ -150,7 +153,7 @@ public function getTrace(); * Set the trace level. See constants TRACE_*. * @param int $trace The trace level. * @return $this - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @throws IInvalidArgumentException */ public function setTrace($trace); @@ -170,7 +173,7 @@ public function getCodepage(); * username/password. * @param int $codepage The codepage. * @return $this - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @throws IInvalidArgumentException */ public function setCodepage($codepage); @@ -184,7 +187,7 @@ public function getLang(); * Set the logon language. * @param string $lang The logon language. * @return $this - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @throws IInvalidArgumentException */ public function setLang($lang); @@ -198,7 +201,7 @@ public function getDest(); * Set the destination in RfcOpenConnection. * @param string $dest The destination in RfcOpenConnection. * @return $this - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @throws IInvalidArgumentException */ public function setDest($dest); } diff --git a/src/Config/IConfigTypeA.php b/src/Config/IConfigTypeA.php index 11c3e67..a3785ad 100644 --- a/src/Config/IConfigTypeA.php +++ b/src/Config/IConfigTypeA.php @@ -2,6 +2,9 @@ namespace phpsap\interfaces\Config; +use phpsap\interfaces\exceptions\IIncompleteConfigException; +use phpsap\interfaces\exceptions\IInvalidArgumentException; + /** * Interface IConfigTypeA * @@ -37,7 +40,7 @@ interface IConfigTypeA extends IConfigCommon /** * Get the hostname of a specific SAP application server. * @return string The hostname of a specific SAP application server. - * @throws \phpsap\interfaces\exceptions\IIncompleteConfigException + * @throws IIncompleteConfigException */ public function getAshost(); @@ -45,14 +48,14 @@ public function getAshost(); * Set the hostname of a specific SAP application server. * @param string $ashost The hostname of a specific SAP application server. * @return $this - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @throws IInvalidArgumentException */ public function setAshost($ashost); /** * Get the SAP system number. * @return string The SAP system number. - * @throws \phpsap\interfaces\exceptions\IIncompleteConfigException + * @throws IIncompleteConfigException */ public function getSysnr(); @@ -60,7 +63,7 @@ public function getSysnr(); * Set the SAP system number. * @param string $sysnr The SAP system number. * @return $this - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @throws IInvalidArgumentException */ public function setSysnr($sysnr); @@ -74,7 +77,7 @@ public function getGwhost(); * Set the gateway host on the application server. * @param string $gwhost The gateway host. * @return $this - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @throws IInvalidArgumentException */ public function setGwhost($gwhost); @@ -88,7 +91,7 @@ public function getGwserv(); * Set the gateway service on the application server. * @param string $gwserv The gateway service on the application server. * @return $this - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @throws IInvalidArgumentException */ public function setGwserv($gwserv); } diff --git a/src/Config/IConfigTypeB.php b/src/Config/IConfigTypeB.php index 8dd47cc..e7c175d 100644 --- a/src/Config/IConfigTypeB.php +++ b/src/Config/IConfigTypeB.php @@ -2,6 +2,9 @@ namespace phpsap\interfaces\Config; +use phpsap\interfaces\exceptions\IIncompleteConfigException; +use phpsap\interfaces\exceptions\IInvalidArgumentException; + /** * Interface IConfigTypeB * @@ -33,7 +36,7 @@ interface IConfigTypeB extends IConfigCommon /** * Get the host name of the message server. * @return string - * @throws \phpsap\interfaces\exceptions\IIncompleteConfigException + * @throws IIncompleteConfigException */ public function getMshost(); @@ -41,7 +44,7 @@ public function getMshost(); * Set the host name of the message server. * @param string $mshost The host name of the message server. * @return $this - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @throws IInvalidArgumentException */ public function setMshost($mshost); @@ -55,7 +58,7 @@ public function getR3name(); * Set the name of SAP system, optional; default: destination * @param string $r3name The name of the SAP system. * @return $this - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @throws IInvalidArgumentException */ public function setR3name($r3name); @@ -69,7 +72,7 @@ public function getGroup(); * Set the group name of the application servers, optional; default: PUBLIC. * @param string $group The group name of the application servers. * @return $this - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @throws IInvalidArgumentException */ public function setGroup($group); } diff --git a/src/IFunction.php b/src/IFunction.php index 27fe322..ba13c4b 100644 --- a/src/IFunction.php +++ b/src/IFunction.php @@ -4,6 +4,11 @@ use phpsap\interfaces\Api\IApi; use phpsap\interfaces\Config\IConfiguration; +use phpsap\interfaces\exceptions\IConnectionFailedException; +use phpsap\interfaces\exceptions\IFunctionCallException; +use phpsap\interfaces\exceptions\IIncompleteConfigException; +use phpsap\interfaces\exceptions\IInvalidArgumentException; +use phpsap\interfaces\exceptions\IUnknownFunctionException; use phpsap\interfaces\Util\IJsonSerializable; /** @@ -46,12 +51,12 @@ interface IFunction extends IJsonSerializable * * @param string $name SAP remote function name. * @param array|null $params SAP remote function call parameters. Default: null - * @param \phpsap\interfaces\Config\IConfiguration|null $config SAP connection configuration. Default: null - * @param \phpsap\interfaces\Api\IApi|null $api SAP remote function call API. Default: null - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException - * @throws \phpsap\interfaces\exceptions\IIncompleteConfigException - * @throws \phpsap\interfaces\exceptions\IConnectionFailedException - * @throws \phpsap\interfaces\exceptions\IUnknownFunctionException + * @param IConfiguration|null $config SAP connection configuration. Default: null + * @param IApi|null $api SAP remote function call API. Default: null + * @throws IInvalidArgumentException + * @throws IIncompleteConfigException + * @throws IConnectionFailedException + * @throws IUnknownFunctionException */ public function __construct($name, array $params = null, IConfiguration $config = null, IApi $api = null); @@ -66,7 +71,7 @@ public function getName(); * * In case no configuration has been set, null will be returned. * - * @return \phpsap\interfaces\Config\IConfiguration|null + * @return IConfiguration|null */ public function getConfiguration(); @@ -76,7 +81,7 @@ public function getConfiguration(); * Using this configuration, the SAP remote function API can be queried and * SAP remote function calls can be invoked. * - * @param \phpsap\interfaces\Config\IConfiguration $config + * @param IConfiguration $config * @return $this */ public function setConfiguration(IConfiguration $config); @@ -93,10 +98,10 @@ public function setConfiguration(IConfiguration $config); * Every time this method is called, it will query the SAP remote system and * extract the API of the SAP remote function. * - * @return \phpsap\interfaces\Api\IApi - * @throws \phpsap\interfaces\exceptions\IIncompleteConfigException - * @throws \phpsap\interfaces\exceptions\IConnectionFailedException - * @throws \phpsap\interfaces\exceptions\IUnknownFunctionException + * @return IApi + * @throws IIncompleteConfigException + * @throws IConnectionFailedException + * @throws IUnknownFunctionException */ public function extractApi(); @@ -110,10 +115,10 @@ public function extractApi(); * In case extractApi() has to be called, a connection configuration needs to be * present. Use setConfiguration() to set the connection configuration. * - * @return \phpsap\interfaces\Api\IApi - * @throws \phpsap\interfaces\exceptions\IIncompleteConfigException - * @throws \phpsap\interfaces\exceptions\IConnectionFailedException - * @throws \phpsap\interfaces\exceptions\IUnknownFunctionException + * @return IApi + * @throws IIncompleteConfigException + * @throws IConnectionFailedException + * @throws IUnknownFunctionException */ public function getApi(); @@ -124,7 +129,7 @@ public function getApi(); * calling getApi(). Instead getApi() will return whatever has been set using * this method. * - * @param \phpsap\interfaces\Api\IApi $api + * @param IApi $api * @return $this */ public function setApi(IApi $api); @@ -147,10 +152,10 @@ public function getParams(); * * @param array $params An array of SAP remote function call parameters. * @return $this - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException - * @throws \phpsap\interfaces\exceptions\IIncompleteConfigException - * @throws \phpsap\interfaces\exceptions\IConnectionFailedException - * @throws \phpsap\interfaces\exceptions\IUnknownFunctionException + * @throws IInvalidArgumentException + * @throws IIncompleteConfigException + * @throws IConnectionFailedException + * @throws IUnknownFunctionException */ public function setParams(array $params); @@ -169,10 +174,10 @@ public function resetParams(); * call. Use setConfiguration() to set the connection configuration. * * @return array - * @throws \phpsap\interfaces\exceptions\IIncompleteConfigException - * @throws \phpsap\interfaces\exceptions\IConnectionFailedException - * @throws \phpsap\interfaces\exceptions\IUnknownFunctionException - * @throws \phpsap\interfaces\exceptions\IFunctionCallException + * @throws IIncompleteConfigException + * @throws IConnectionFailedException + * @throws IUnknownFunctionException + * @throws IFunctionCallException */ public function invoke(); } diff --git a/src/Util/IJsonSerializable.php b/src/Util/IJsonSerializable.php index 14f7fb5..1aad816 100644 --- a/src/Util/IJsonSerializable.php +++ b/src/Util/IJsonSerializable.php @@ -3,6 +3,7 @@ namespace phpsap\interfaces\Util; use JsonSerializable; +use phpsap\interfaces\exceptions\IInvalidArgumentException; /** * Interface IJsonSerializable @@ -18,8 +19,8 @@ interface IJsonSerializable extends JsonSerializable /** * Decode a formerly JSON encoded object. * @param string $json JSON encoded object. - * @return \phpsap\interfaces\Util\IJsonSerializable - * @throws \phpsap\interfaces\exceptions\IInvalidArgumentException + * @return IJsonSerializable + * @throws IInvalidArgumentException */ public static function jsonDecode($json); }