@@ -51,10 +51,8 @@ function getClark() {
5151 *
5252 * This function will also disable the standard libxml error handler (which
5353 * usually just results in PHP errors), and throw exceptions instead.
54- *
55- * @return array
5654 */
57- function parse () {
55+ function parse () : array {
5856
5957 $ previousEntityState = libxml_disable_entity_loader (true );
6058 $ previousSetting = libxml_use_internal_errors (true );
@@ -95,11 +93,8 @@ function parse() {
9593 *
9694 * If the $elementMap argument is specified, the existing elementMap will
9795 * be overridden while parsing the tree, and restored after this process.
98- *
99- * @param array $elementMap
100- * @return array
10196 */
102- function parseGetElements (array $ elementMap = null ) {
97+ function parseGetElements (array $ elementMap = null ) : array {
10398
10499 $ result = $ this ->parseInnerTree ($ elementMap );
105100 if (!is_array ($ result )) {
@@ -120,7 +115,6 @@ function parseGetElements(array $elementMap = null) {
120115 * If the $elementMap argument is specified, the existing elementMap will
121116 * be overridden while parsing the tree, and restored after this process.
122117 *
123- * @param array $elementMap
124118 * @return array|string
125119 */
126120 function parseInnerTree (array $ elementMap = null ) {
@@ -198,10 +192,8 @@ function parseInnerTree(array $elementMap = null) {
198192
199193 /**
200194 * Reads all text below the current element, and returns this as a string.
201- *
202- * @return string
203195 */
204- function readText () {
196+ function readText () : string {
205197
206198 $ result = '' ;
207199 $ previousDepth = $ this ->depth ;
@@ -222,10 +214,8 @@ function readText() {
222214 * * name - A clark-notation XML element name.
223215 * * value - The parsed value.
224216 * * attributes - A key-value list of attributes.
225- *
226- * @return array
227217 */
228- function parseCurrentElement () {
218+ function parseCurrentElement () : array {
229219
230220 $ name = $ this ->getClark ();
231221
@@ -255,10 +245,8 @@ function parseCurrentElement() {
255245 * If the attributes are part of the same namespace, they will simply be
256246 * short keys. If they are defined on a different namespace, the attribute
257247 * name will be retured in clark-notation.
258- *
259- * @return array
260248 */
261- function parseAttributes () {
249+ function parseAttributes () : array {
262250
263251 $ attributes = [];
264252
@@ -286,11 +274,8 @@ function parseAttributes() {
286274 /**
287275 * Returns the function that should be used to parse the element identified
288276 * by it's clark-notation name.
289- *
290- * @param string $name
291- * @return callable
292277 */
293- function getDeserializerForElementName ($ name ) {
278+ function getDeserializerForElementName (string $ name ) : callable {
294279
295280 if (!array_key_exists ($ name , $ this ->elementMap )) {
296281 if (substr ($ name , 0 , 2 ) == '{} ' && array_key_exists (substr ($ name , 2 ), $ this ->elementMap )) {
0 commit comments