-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Clean up code, harden typing, remove deprecated method
- Loading branch information
Showing
10 changed files
with
36 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Cobweb\Svconnector\Utility; | ||
|
||
/* | ||
|
@@ -17,10 +19,6 @@ | |
|
||
/** | ||
* Utility class for the Connector family of services | ||
* | ||
* @author Francois Suter (Cobweb) <[email protected]> | ||
* @package TYPO3 | ||
* @subpackage tx_svconnector | ||
*/ | ||
class ConnectorUtility | ||
{ | ||
|
@@ -73,10 +71,10 @@ class ConnectorUtility | |
* | ||
* @param string $string XML to parse | ||
* @param int $options LIBXML options for XML parsing (optional) | ||
* @throws \Exception | ||
* @return array PHP array | ||
*@throws \Exception | ||
*/ | ||
public static function convertXmlToArray($string, $options = null): array | ||
public static function convertXmlToArray(string $string, int $options = 0): array | ||
{ | ||
// If input string is empty, exit with exception | ||
if (empty($string)) { | ||
|
@@ -107,7 +105,7 @@ public static function convertXmlToArray($string, $options = null): array | |
* @param array $namespaces List of namespaces used (optional) | ||
* @return array Transformed XML node and children | ||
*/ | ||
public static function handleXmlNode(\SimpleXMLElement $node, $namespaces = []) | ||
public static function handleXmlNode(\SimpleXMLElement $node, array $namespaces = []) | ||
{ | ||
// Init | ||
$nodeArray = []; | ||
|
@@ -152,7 +150,7 @@ public static function handleXmlNode(\SimpleXMLElement $node, $namespaces = []) | |
* @param string $namespace Namespace to be parsed (optional) | ||
* @return array | ||
*/ | ||
public static function handleChildren(\SimpleXMLElement $node, $namespaces = [], $namespace = null) { | ||
public static function handleChildren(\SimpleXMLElement $node, array $namespaces = [], $namespace = null) { | ||
$children = $node->children($namespace, true); | ||
$array = []; | ||
if ($children->count() > 0) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Cobweb\Svconnector\ViewHelpers\Be; | ||
|
||
/* | ||
|
@@ -20,10 +23,6 @@ | |
|
||
/** | ||
* This view helper is designed to output the result of the connection test appropriately, depending on its format | ||
* | ||
* @author Francois Suter (Cobweb) <[email protected]> | ||
* @package TYPO3 | ||
* @subpackage tx_svconnector | ||
*/ | ||
class ResultViewHelper extends AbstractBackendViewHelper | ||
{ | ||
|
@@ -44,24 +43,6 @@ public function initializeArguments() | |
$this->registerArgument('result', 'mixed', 'Result of the connection test', true); | ||
} | ||
|
||
/** | ||
* Renders whatever result the connection test returned. | ||
* | ||
* TODO: remove when v8 compatibility is dropped. | ||
* | ||
* @return string | ||
*/ | ||
public function render() | ||
{ | ||
return static::renderStatic( | ||
[ | ||
'result' => $this->arguments['result'] | ||
], | ||
$this->buildRenderChildrenClosure(), | ||
$this->renderingContext | ||
); | ||
} | ||
|
||
/** | ||
* Renders whatever result the connection test returned. | ||
* | ||
|