Skip to content

Commit

Permalink
fix spacing according to PSR-12 #18
Browse files Browse the repository at this point in the history
  • Loading branch information
gregor-j committed Oct 20, 2023
1 parent 37d8b78 commit a0f76b1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/SapRfc.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use SAPNWRFC\ConnectionException as ModuleConnectionException;
use SAPNWRFC\FunctionCallException as ModuleFunctionCallException;
use SAPNWRFC\RemoteFunction;

use function array_merge;
use function get_object_vars;
use function method_exists;
Expand Down
1 change: 1 addition & 0 deletions src/Traits/ApiTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use phpsap\interfaces\Api\IStruct;
use phpsap\interfaces\Api\ITable;
use phpsap\interfaces\Api\IValue;

use function array_key_exists;
use function is_array;
use function sprintf;
Expand Down
1 change: 1 addition & 0 deletions src/Traits/ConfigTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use phpsap\interfaces\Config\IConfigTypeB;
use phpsap\interfaces\Config\IConfiguration;
use phpsap\interfaces\exceptions\IIncompleteConfigException;

use function array_merge;

/**
Expand Down
4 changes: 3 additions & 1 deletion src/Traits/ParamTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use phpsap\interfaces\Api\ITable;
use phpsap\interfaces\Api\IValue;
use phpsap\interfaces\exceptions\IInvalidArgumentException;

use function array_key_exists;
use function count;
use function is_array;
Expand Down Expand Up @@ -62,7 +63,8 @@ private function getTableParams(array $tables, array $params): array
$result = [];
foreach ($tables as $table) {
$key = $table->getName();
if (array_key_exists($key, $params)
if (
array_key_exists($key, $params)
&& is_array($params[$key])
&& count($params[$key]) > 0
) {
Expand Down
3 changes: 2 additions & 1 deletion tests/OutputTableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ public function mockRfcOutputTable()
$flags->response = self::$responseRaw;
$expectedConfig = static::getSampleSapConfig();
static::mock('\SAPNWRFC\Connection::__construct', static function (array $config, array $options) use ($flags, $expectedConfig) {
if (!is_array($config)
if (
!is_array($config)
|| !array_key_exists('ashost', $config)
|| !array_key_exists('sysnr', $config)
|| !array_key_exists('client', $config)
Expand Down
12 changes: 8 additions & 4 deletions tests/SapRfcIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,8 @@ protected function mockSuccessfulRfcPing()
$flags->func = null;
$expectedConfig = static::getSampleSapConfig();
static::mock('\SAPNWRFC\Connection::__construct', static function (array $config, array $options) use ($flags, $expectedConfig) {
if (!is_array($config)
if (
!is_array($config)
|| !array_key_exists('ashost', $config)
|| !array_key_exists('sysnr', $config)
|| !array_key_exists('client', $config)
Expand Down Expand Up @@ -596,7 +597,8 @@ protected function mockUnknownFunctionException()
$flags->conn = false;
$expectedConfig = static::getSampleSapConfig();
static::mock('\SAPNWRFC\Connection::__construct', static function (array $config, array $options) use ($flags, $expectedConfig) {
if (!is_array($config)
if (
!is_array($config)
|| !array_key_exists('ashost', $config)
|| !array_key_exists('sysnr', $config)
|| !array_key_exists('client', $config)
Expand Down Expand Up @@ -638,7 +640,8 @@ protected function mockRemoteFunctionCallWithParametersAndResults()
$flags->api = static::$rfcWalkThruTestApi;
$expectedConfig = static::getSampleSapConfig();
static::mock('\SAPNWRFC\Connection::__construct', static function (array $config, array $options) use ($flags, $expectedConfig) {
if (!is_array($config)
if (
!is_array($config)
|| !array_key_exists('ashost', $config)
|| !array_key_exists('sysnr', $config)
|| !array_key_exists('client', $config)
Expand Down Expand Up @@ -733,7 +736,8 @@ protected function mockFailedRemoteFunctionCallWithParameters()
$flags->api = static::$rfcReadTableApi;
$expectedConfig = static::getSampleSapConfig();
static::mock('\SAPNWRFC\Connection::__construct', static function (array $config, array $options) use ($flags, $expectedConfig) {
if (!is_array($config)
if (
!is_array($config)
|| !array_key_exists('ashost', $config)
|| !array_key_exists('sysnr', $config)
|| !array_key_exists('client', $config)
Expand Down

0 comments on commit a0f76b1

Please sign in to comment.