]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/file_directories/binary/stack/class_StackFile.php
Refacuring / possible WIP:
[core.git] / framework / main / classes / file_directories / binary / stack / class_StackFile.php
index 2cd5dde0c62edad2e84be1cb2a7393893b9728f4..46cc8b326ad46a3898afbf83d7eda874b029f965 100644 (file)
@@ -72,17 +72,17 @@ class StackFile extends BaseBinaryFile implements FileStacker {
        /**
         * Writes given value to the file and returns a hash and gap position for it
         *
-        * @param       $groupId        Group identifier
+        * @param       $stackName      Group identifier
         * @param       $value          Value to be added to the stack
         * @return      $data           Hash and gap position
         * @throws      InvalidArgumentException        If a parameter is not valid
         */
-       public function writeValueToFile (string $groupId, $value) {
+       public function writeValueToFile (string $stackName, $value) {
                // Validate parameter
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: groupId=%s,value[]=%s - CALLED!', $groupId, gettype($value)));
-               if (empty($groupId)) {
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('STACK-FILE: stackName=%s,value[]=%s - CALLED!', $stackName, gettype($value)));
+               if (empty($stackName)) {
                        // Throw IAE
-                       throw new InvalidArgumentException('Parameter "groupId" is empty');
+                       throw new InvalidArgumentException('Parameter "stackName" is empty');
                } elseif (is_object($value) || is_resource($value)) {
                        // Not wanted here
                        throw new InvalidArgumentException(sprintf('value[]=%s is not stackable in files', gettype($value)));
@@ -95,7 +95,7 @@ class StackFile extends BaseBinaryFile implements FileStacker {
                $hash = self::hash($encoded);
 
                // Then write it to the next free gap
-               $data = $this->getStackInstance()->writeDataToFreeGap($groupId, $hash, $encoded);
+               $data = $this->getStackInstance()->writeDataToFreeGap($stackName, $hash, $encoded);
 
                // Return info
                return $data;
@@ -104,14 +104,14 @@ class StackFile extends BaseBinaryFile implements FileStacker {
        /**
         * Writes given raw data to the file and returns a gap position and length
         *
-        * @param       $groupId        Group identifier
+        * @param       $stackName      Group identifier
         * @param       $hash           Hash from encoded value
         * @param       $encoded        Encoded value to be written to the file
         * @return      $data           Gap position and length of the raw data
         * @throws      UnsupportedOperationException   If this method is called
         */
-       public function writeDataToFreeGap (string $groupId, string $hash, string $encoded) {
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: groupId=' . $groupId . ',hash=' . $hash . ',encoded()=' . strlen($encoded));
+       public function writeDataToFreeGap (string $stackName, string $hash, string $encoded) {
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('STACK-FILE: stackName=' . $stackName . ',hash=' . $hash . ',encoded()=' . strlen($encoded));
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }