Skip to content

Commit bc023b0

Browse files
author
Mike Erickson
committed
2 parents 7b7320c + 7e6127d commit bc023b0

File tree

4 files changed

+20
-17
lines changed

4 files changed

+20
-17
lines changed

src/PrinterInit.php

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
class PrinterInit
44
{
5-
const GREEN = "\e[32m";
6-
const RESET = "\e[0m";
7-
const CYAN = "\e[36m";
8-
const RED = "\e[31m";
9-
const YELLOW = "\033[0;33m";
5+
const GREEN = "\e[32m";
6+
const RESET = "\e[0m";
7+
const CYAN = "\e[36m";
8+
const RED = "\e[31m";
9+
const YELLOW = "\033[0;33m";
1010
const LYELLOW = "\033[33;01m";
11-
const WHITE = "\033[0;37m";
12-
const LWHITE = "\033[37;01m";
11+
const WHITE = "\033[0;37m";
12+
const LWHITE = "\033[37;01m";
1313
const MAGENTA = "\033[2;35m";
1414

1515
public function __construct()
@@ -20,7 +20,7 @@ public function init(string $use_colors = 'never', array $options = []): int
2020
{
2121
$result = 0;
2222

23-
$useCollision = in_array("--collision", $options);
23+
$useCollision = in_array('--collision', $options);
2424

2525
$phpunit_xml_file = './phpunit.xml';
2626
if (!file_exists($phpunit_xml_file)) {
@@ -30,7 +30,7 @@ public function init(string $use_colors = 'never', array $options = []): int
3030
echo "\n ".self::LWHITE.'[• ]'.self::GREEN." Gathering installation details\n".self::RESET;
3131
$result = $this->add_printer_class_to_phpunit_xml($phpunit_xml_file);
3232
if ($useCollision) {
33-
if (is_dir("vendor/nunomaduro/collision")) {
33+
if (is_dir('vendor/nunomaduro/collision')) {
3434
$result = $this->add_collision_to_phpunit_xml($phpunit_xml_file);
3535
if ($result === 0) {
3636
echo self::GREEN." ✔ Collision listener activated\n".self::RESET;
@@ -51,7 +51,7 @@ private function add_printer_class_to_phpunit_xml(string $file = './phpunit.xml'
5151
{
5252
$PHPUNIT_FILE = $file;
5353
if (file_exists($PHPUNIT_FILE)) {
54-
$data = file_get_contents($PHPUNIT_FILE);
54+
$data = file_get_contents($PHPUNIT_FILE);
5555
$result = (int) strpos($data, 'printerClass=');
5656
if ($result > 0) {
5757
echo self::LWHITE.' [•• ]'.self::LYELLOW.' Printer class already configured in '.self::CYAN."{$PHPUNIT_FILE} \n".self::RESET;
@@ -79,13 +79,14 @@ private function add_collision_to_phpunit_xml(string $file = './phpunit.xml'): i
7979
</listeners>
8080
';
8181
$data = file_get_contents($file);
82-
$pos = strpos($data, "Collision");
82+
$pos = strpos($data, 'Collision');
8383
if (!$pos) {
84-
$pos = strpos($data, "<filter>");
84+
$pos = strpos($data, '<filter>');
8585
if ($pos > 0) {
8686
$data = substr_replace($data, $collisionData, $pos, 0);
8787
file_put_contents($file, $data);
88-
return 0;//all good, no errors
88+
89+
return 0; //all good, no errors
8990
} else {
9091
return -43;
9192
}
@@ -96,7 +97,7 @@ private function add_collision_to_phpunit_xml(string $file = './phpunit.xml'): i
9697

9798
private function copy_default_settings(string $file = 'phpunit-printer.yml')
9899
{
99-
$CONFIG_FILE = $file;
100+
$CONFIG_FILE = $file;
100101
$packageDefaultSettingFile = dirname(__FILE__, 2).DIRECTORY_SEPARATOR.'src/'.$CONFIG_FILE;
101102

102103
$copySettingFile = $CONFIG_FILE;

src/PrinterTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ public function version()
143143
/**
144144
* @return string
145145
*/
146-
public function getVersion() {
146+
public function getVersion()
147+
{
147148
return $this->version();
148149
}
149150

src/PrinterTrait8.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ public function version()
139139
/**
140140
* @return string
141141
*/
142-
public function getVersion() {
142+
public function getVersion()
143+
{
143144
return $this->version();
144145
}
145146

src/init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
require_once 'PrinterInit.php';
44

5-
(new PrinterInit)->init('always',$_SERVER["argv"]);
5+
(new PrinterInit())->init('always', $_SERVER['argv']);

0 commit comments

Comments
 (0)