From e4095767e5b34073ef1ee6529bf56c776b2def3e Mon Sep 17 00:00:00 2001 From: Ryan Rathsam Date: Tue, 21 May 2019 09:27:12 -0400 Subject: [PATCH] Reformatted Code Just some simple reformatting. --- .../js/modules/summary/SummaryStatisticsPortlet.js | 8 ++++---- .../lib/Rest/SummaryControllerProviderTest.php | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/html/gui/js/modules/summary/SummaryStatisticsPortlet.js b/html/gui/js/modules/summary/SummaryStatisticsPortlet.js index 903f316389..482dfeebf1 100644 --- a/html/gui/js/modules/summary/SummaryStatisticsPortlet.js +++ b/html/gui/js/modules/summary/SummaryStatisticsPortlet.js @@ -51,12 +51,12 @@ XDMoD.Modules.SummaryPortlets.SummaryStatisticsPortlet = Ext.extend(Ext.ux.Portl var title = this.baseTitle; var dateRanges = CCR.xdmod.ui.DurationToolbar.getDateRanges(); - for ( var i = 0; i < dateRanges.length; i++ ) { + for (var i = 0; i < dateRanges.length; i++) { var dateRange = dateRanges[i]; if (dateRange.text === this.config.timeframe) { this.config.start_date = this.formatDate(dateRange.start); this.config.end_date = this.formatDate(dateRange.end); - title = `${this.baseTitle} - ${this.config.start_date} to ${this.config.end_date}`; + title = this.baseTitle + ' - ' + this.config.start_date + ' to ' + this.config.end_date; } } @@ -205,8 +205,8 @@ XDMoD.Modules.SummaryPortlets.SummaryStatisticsPortlet = Ext.extend(Ext.ux.Portl this.getTopToolbar().doLayout(); }, // populateSummaryStatistics - formatDate: function(date) { - return `${date.getFullYear()}-${("" + (date.getMonth() + 1)).padStart(2, '0')}-${("" + date.getDate()).padStart(2, '0')}` + formatDate: function (date) { + return date.getFullYear() + '-' + ('' + (date.getMonth() + 1)).padStart(2, '0') + '-' + ('' + date.getDate()).padStart(2, '0'); } // formatDate: function(date) { }); // XDMoD.Modules.SummaryPortlets.CenterHealthPortlet = Ext.extend(Ext.ux.Portlet, { diff --git a/tests/integration/lib/Rest/SummaryControllerProviderTest.php b/tests/integration/lib/Rest/SummaryControllerProviderTest.php index 9b35152acb..3ecfc42ab8 100644 --- a/tests/integration/lib/Rest/SummaryControllerProviderTest.php +++ b/tests/integration/lib/Rest/SummaryControllerProviderTest.php @@ -70,15 +70,15 @@ public function testGetStatistics(array $options) // present in the `data` section. This will let us detect when we have a `float` and // include a delta for the equality test. $expectedTypes = array(); - foreach($expected['formats'] as $format) { - foreach($format['items'] as $item) { + foreach ($expected['formats'] as $format) { + foreach ($format['items'] as $item) { $expectedTypes[$item['fieldName']] = $item['numberType']; } } // These attributes can just straight up be checked for equality. $equalAttributes = array('totalCount', 'success', 'message', 'formats'); - foreach($equalAttributes as $attribute) { + foreach ($equalAttributes as $attribute) { $this->assertEquals($expected[$attribute], $actual[$attribute]); } @@ -88,14 +88,14 @@ public function testGetStatistics(array $options) $expectedData = $expected['data'][0]; $actualData = $actual['data'][0]; - foreach($expectedData as $fieldName => $value) { + foreach ($expectedData as $fieldName => $value) { $this->assertArrayHasKey($fieldName, $actualData); if ((array_key_exists($fieldName, $expectedTypes) && $expectedTypes[$fieldName] === 'float') || strpos($fieldName, 'sem_') !== false) { // Make sure that the values we are validating are in the correct format. - $expectedValue = (float) $value[0]; - $actualValue = (float) $actualData[$fieldName][0]; + $expectedValue = (float)$value[0]; + $actualValue = (float)$actualData[$fieldName][0]; $this->assertEquals($expectedValue, $actualValue, "", 1.0e-8); } else { @@ -117,7 +117,7 @@ public function provideTestGetStatistics() private function recursivelyFilter(array $data, array $keys) { - foreach($data as $key => $value) { + foreach ($data as $key => $value) { if (in_array($key, $keys, true)) { unset($data[$key]); } elseif (is_array($value)) {