Skip to content

Commit 42817fc

Browse files
authored
Merge pull request #4 from DivineOmega/analysis-XladGV
Apply fixes from StyleCI
2 parents 0be2757 + 281e24e commit 42817fc

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

src/HCLParser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
namespace DivineOmega\HCLParser;
44

55
/**
6-
* Class HCLParser
7-
* @package DivineOmega\HCLParser
6+
* Class HCLParser.
87
*/
98
class HCLParser
109
{
@@ -15,6 +14,7 @@ class HCLParser
1514

1615
/**
1716
* HCLParser constructor.
17+
*
1818
* @param $hcl
1919
*/
2020
public function __construct($hcl)
@@ -27,7 +27,7 @@ public function __construct($hcl)
2727
*/
2828
private function getJSONString()
2929
{
30-
$command = __DIR__.'/../bin/' . Installer::getBinaryFilename() . ' --reverse <<\'EOF\''.PHP_EOL.$this->hcl.PHP_EOL.'EOF';
30+
$command = __DIR__.'/../bin/'.Installer::getBinaryFilename().' --reverse <<\'EOF\''.PHP_EOL.$this->hcl.PHP_EOL.'EOF';
3131

3232
exec($command, $lines);
3333

src/Installer.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@
33
namespace DivineOmega\HCLParser;
44

55
/**
6-
* Class Installer
7-
* @package DivineOmega\HCLParser
6+
* Class Installer.
87
*/
98
abstract class Installer
109
{
1110
/**
12-
* json2hcl Version we want to use
11+
* json2hcl Version we want to use.
12+
*
1313
* @see https://github.com/kvz/json2hcl/releases
1414
*/
1515
const JSON2HCL_VERSION = '0.0.6';
1616

1717
/**
18-
* Returns the correct binary filename according to the Operating System and Architecture
18+
* Returns the correct binary filename according to the Operating System and Architecture.
1919
*/
2020
public static function getBinaryFilename()
2121
{
22-
# Defaults
22+
// Defaults
2323
$osString = 'linux';
2424
$architecture = 'amd64';
2525

26-
# Switch architecture if needed
26+
// Switch architecture if needed
2727
if (2147483647 == PHP_INT_MAX) {
2828
$architecture = '386';
2929
}
3030

31-
# Switch Operating System if needed
32-
switch (TRUE) {
31+
// Switch Operating System if needed
32+
switch (true) {
3333
case stristr(PHP_OS, 'DAR'):
3434
$osString = 'darwin';
3535
break;
@@ -38,27 +38,27 @@ public static function getBinaryFilename()
3838
break;
3939
}
4040

41-
return sprintf('json2hcl_v%s_%s_%s',self::JSON2HCL_VERSION, $osString, $architecture);
41+
return sprintf('json2hcl_v%s_%s_%s', self::JSON2HCL_VERSION, $osString, $architecture);
4242
}
4343

4444
public static function installBinaries()
4545
{
4646
$binaryUrls = [
47-
sprintf('https://github.com/kvz/json2hcl/releases/download/v%s/%s', self::JSON2HCL_VERSION, self::getBinaryFilename() )
47+
sprintf('https://github.com/kvz/json2hcl/releases/download/v%s/%s', self::JSON2HCL_VERSION, self::getBinaryFilename()),
4848
];
4949

5050
foreach ($binaryUrls as $binaryUrl) {
51-
$destination = __DIR__ . '/../bin/' . basename($binaryUrl);
51+
$destination = __DIR__.'/../bin/'.basename($binaryUrl);
5252

53-
# Skip if file exists
53+
// Skip if file exists
5454
if (file_exists($destination)) {
5555
continue;
5656
}
5757

58-
# Download
58+
// Download
5959
file_put_contents($destination, file_get_contents($binaryUrl));
6060

61-
# Make executable
61+
// Make executable
6262
chmod($destination, 0755);
6363
}
6464
}

0 commit comments

Comments
 (0)