From 7234726501aa0511399fde5a5c9804973a266584 Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Tue, 29 Jun 2021 11:09:25 +0200 Subject: [PATCH] fixes for system and utils --- src/r3/r3-system/r3-system.js | 44 +++++++++++++++-------------------- src/r3/r3-utils.js | 12 +++++----- update_templates.php | 6 ++++- 3 files changed, 30 insertions(+), 32 deletions(-) diff --git a/src/r3/r3-system/r3-system.js b/src/r3/r3-system/r3-system.js index 98e0e47..e6b26a7 100644 --- a/src/r3/r3-system/r3-system.js +++ b/src/r3/r3-system/r3-system.js @@ -8,13 +8,13 @@ const Utils = require('.././r3-utils'); CUSTOM_OPTIONS_END CUSTOM_METHODS_START - start(options) - stop(options) + start(options) - Just calls System.Start(options) + stop(options) - Just calls System.Stop(options) CUSTOM_METHODS_END CUSTOM_STATIC_METHODS_START - Start(options) - Stop(options) + Start(options) - Starts the system by registering subscriptions to events + Stop(options) - Stops the system by removing these subscriptions to events CUSTOM_STATIC_METHODS_END **/ @@ -50,15 +50,19 @@ class System { } //GENERATE_CONSTRUCTOR_END + //CUSTOM_IMPLEMENTATION_START + //CUSTOM_IMPLEMENTATION_END + //GENERATE_METHODS_START /** - * start + * start() - Just calls System.Start(options) + * options + * */ start(options) { //CUSTOM_START_METHOD_START - System.Start(options); /** @@ -66,24 +70,19 @@ class System { */ console.log('something else'); - - - - //CUSTOM_START_METHOD_END } /** - * stop + * stop() - Just calls System.Stop(options) + * options + * */ stop(options) { //CUSTOM_STOP_METHOD_START System.Stop(options); - - - //CUSTOM_STOP_METHOD_END } @@ -92,37 +91,32 @@ class System { //GENERATE_STATIC_METHODS_START /** - * Start + * Start() - Starts the system by registering subscriptions to events + * options + * */ static Start(options) { //CUSTOM_STATIC_START_METHOD_START console.log('Starting system X'); - - - //CUSTOM_STATIC_START_METHOD_END } /** - * Stop + * Stop() - Stops the system by removing these subscriptions to events + * options + * */ static Stop(options) { //CUSTOM_STATIC_STOP_METHOD_START console.log('Stopping system X'); - - - //CUSTOM_STATIC_STOP_METHOD_END } //GENERATE_STATIC_METHODS_END - //CUSTOM_IMPLEMENTATION_START - //CUSTOM_IMPLEMENTATION_END - } //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START diff --git a/src/r3/r3-utils.js b/src/r3/r3-utils.js index 5032dac..e1c5fe6 100644 --- a/src/r3/r3-utils.js +++ b/src/r3/r3-utils.js @@ -38,12 +38,6 @@ class Utils { } //GENERATE_CONSTRUCTOR_END - //GENERATE_METHODS_START - //GENERATE_METHODS_END - - //GENERATE_STATIC_METHODS_START - //GENERATE_STATIC_METHODS_END - //CUSTOM_IMPLEMENTATION_START static GetFirstParent(object, constructor) { @@ -1279,6 +1273,12 @@ class Utils { }; //CUSTOM_IMPLEMENTATION_END + //GENERATE_METHODS_START + //GENERATE_METHODS_END + + //GENERATE_STATIC_METHODS_START + //GENERATE_STATIC_METHODS_END + } //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START diff --git a/update_templates.php b/update_templates.php index 949b6b8..178ccd9 100755 --- a/update_templates.php +++ b/update_templates.php @@ -446,11 +446,15 @@ function doMethodUpdate($template, $tokens, $token) $params = "@param " . $params; } - $comment = preg_match('/.*?\).*?(\w.*$)/', $item, $matches); + $result = preg_match('/.*?\).*?(\w.*$)/', $item, $matches); if ($result !== false && sizeof($matches) >= 2) { $comment = $matches[1]; } + if ($result === 0) { + $comment = 'No comment'; + } + $returns = preg_split('/@return[s]*\s*/', $comment); if (sizeof($returns) > 1) {