Skip to content

Commit

Permalink
Merge pull request #13 from symcon/fixes/upgrade-style-to-v3
Browse files Browse the repository at this point in the history
upgrade style
  • Loading branch information
Sunnyka98 authored Nov 16, 2023
2 parents 6b44c71 + 3255ceb commit 20c4356
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
- name: Checkout module
uses: actions/checkout@master
- name: Check style
uses: symcon/action-style@master
uses: symcon/action-style@v3
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
.idea/
.phpunit.*
.php_cs.cache
.php_cs.cache
.php-cs-fixer.cache
2 changes: 1 addition & 1 deletion .style
Submodule .style updated 2 files
+34 −30 .php-cs-fixer.php
+71 −71 json-check.php
44 changes: 22 additions & 22 deletions CSVZipExport/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,21 @@ public function Export(int $ArchiveVariable, int $AggregationStage, string $Aggr
$endTimeStamp = 0;

switch ($AggregationStage) {
case 0: //Hourly
case 5: //1-Minute
case 6: //5-Minute
case 7: //raw datas
$startTimeStamp = $this->TransferTime($AggregationStart, true, false);
$endTimeStamp = $this->TransferTime($AggregationEnd, false, false);
break;
case 1: //Daily
case 2: //Weekly
case 3: //Monthly
case 4: //Yearly
$startTimeStamp = $this->TransferTime($AggregationStart, true, true);
$endTimeStamp = $this->TransferTime($AggregationEnd, false, true);
break;
}
case 0: //Hourly
case 5: //1-Minute
case 6: //5-Minute
case 7: //raw datas
$startTimeStamp = $this->TransferTime($AggregationStart, true, false);
$endTimeStamp = $this->TransferTime($AggregationEnd, false, false);
break;
case 1: //Daily
case 2: //Weekly
case 3: //Monthly
case 4: //Yearly
$startTimeStamp = $this->TransferTime($AggregationStart, true, true);
$endTimeStamp = $this->TransferTime($AggregationEnd, false, true);
break;
}

//Generate zip with aggregated values
$tempfile = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $this->GenerateFileName($ArchiveVariable);
Expand Down Expand Up @@ -208,13 +208,13 @@ private function TransferTime($jsonTime, bool $start, bool $ignoreTime)
$customTime = '';
if ($ignoreTime) {
switch ($start) {
case true:
$customTime = '00:00:00';
break;
case false:
$customTime = '23:59:59';
break;
}
case true:
$customTime = '00:00:00';
break;
case false:
$customTime = '23:59:59';
break;
}
} else {
$customTime = sprintf('%02d:%02d:%02d', $time['hour'], $time['minute'], $time['second']);
}
Expand Down

0 comments on commit 20c4356

Please sign in to comment.