*/
protected function __construct (string $className) {
// Call parent constructor
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-HELPER: className=%s - CONSTRUCTED!', $className));
parent::__construct($className);
+
+ // Trace message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-HELPER: EXIT!');
}
/**
*
* @param $newContent New content to add
* @return void
+ * @throws InvalidArgumentException If a parameter has an invalid value
*/
protected final function addContent (string $newContent) {
+ // Check variable
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-HELPER: newContent=%s - CALLED!', $newContent));
+ if (empty(trim($newContent))) {
+ // Throw IAE
+ throw new InvalidArgumentException('Parameter "newContent" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+ }
+
+ // Append content with EOL
$this->content .= trim($newContent) . PHP_EOL;
+
+ // Trace message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-HELPER: this->content()=%d - EXIT!', strlen($this->content)));
}
/**
*
* @param $content Content to to the base
* @return void
+ * @throws InvalidArgumentException If a parameter has an invalid value
*/
protected function addHeaderContent (string $content) {
+ // Check variable
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-HELPER: content=%s - CALLED!', $content));
+ if (empty(trim($content))) {
+ // Throw IAE
+ throw new InvalidArgumentException('Parameter "content" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+ }
+
// Add the header content
$this->groups['header']['content'] = trim($content);
+
+ // Trace message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-HELPER: EXIT!');
}
/**
*
* @param $content Content to to the base
* @return void
+ * @throws InvalidArgumentException If a parameter has an invalid value
*/
protected function addFooterContent (string $content) {
+ // Check variable
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('BASE-HELPER: content=%s - CALLED!', $content));
+ if (empty(trim($content))) {
+ // Throw IAE
+ throw new InvalidArgumentException('Parameter "content" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+ }
+
// Add the footer content
$this->groups['footer']['content'] = trim($content);
+
+ // Trace message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('BASE-HELPER: EXIT!');
}
/**