private function appendNewEntryToPath(array $entry)
    {
        $entryNoString = "Entry " . $this->count;
        $delimiter = str_pad(
            $entryNoString,
            self::TITLE_LENGTH,
            '-',
            STR_PAD_BOTH
        ) . PHP_EOL;
        $entryString = $delimiter;
        $entryString .= sprintf(
            "Time: %s\n",
            (new \DateTime("now", new \DateTimeZone('UTC')))->format('Y-m-d H:i:s')
        );
        $entryString .= MessageSerializer::objectSerialize($entry['request']);
        if (array_key_exists('reason', $entry)) {
            $entryString .= MessageSerializer::objectSerialize($entry['reason']);
        } elseif (array_key_exists('response', $entry)) {
            $entryString .= MessageSerializer::objectSerialize($entry['response']);
        }

        $entryString .= $delimiter;

        Utilities::appendToFile($this->path, $entryString);
    }
private function appendNewEntryToPath(array $entry)
    {
        $entryNoString = "Entry " . $this->count;
        $delimiter = str_pad(
            $entryNoString,
            self::TITLE_LENGTH,
            '-',
            STR_PAD_BOTH
        ) . PHP_EOL;
        $entryString = $delimiter;
        $entryString .= sprintf(
            "Time: %s\n",
            (new \DateTime("now", new \DateTimeZone('UTC')))->format('Y-m-d H:i:s')
        );
        $entryString .= MessageSerializer::objectSerialize($entry['request']);
        if (array_key_exists('reason', $entry)) {
            $entryString .= MessageSerializer::objectSerialize($entry['reason']);
        } elseif (array_key_exists('response', $entry)) {
            $entryString .= MessageSerializer::objectSerialize($entry['response']);
        }

        $entryString .= $delimiter;

        Utilities::appendToFile($this->path, $entryString);
    }
private function appendNewEntryToPath ( array $ entry ) { $ entryNoString = "Entry " . $ this -> count ; $ delimiter = str_pad ( $ entryNoString , self :: TITLE_LENGTH , '-' , STR_PAD_BOTH ) . PHP_EOL ; $ entryString = $ delimiter ; $ entryString .= sprintf ( "Time: %s\n" , ( new \ DateTime ( "now" , new \ DateTimeZone ( 'UTC' ) ) ) -> format ( 'Y-m-d H:i:s' ) ) ; $ entryString .= MessageSerializer :: objectSerialize ( $ entry [ 'request' ] ) ; if ( array_key_exists ( 'reason' , $ entry ) ) { $ entryString .= MessageSerializer :: objectSerialize ( $ entry [ 'reason' ] ) ; } elseif ( array_key_exists ( 'response' , $ entry ) ) { $ entryString .= MessageSerializer :: objectSerialize ( $ entry [ 'response' ] ) ; } $ entryString .= $ delimiter ; Utilities :: appendToFile ( $ this -> path , $ entryString ) ; }
Append the new entry to saved file path.

@param array $entry the entry to be added.

@return void
Append the new entry to saved file path .