@@ -7,4 +7,4 @@ |
||
7 | 7 | * @link https://github.com/XigenChris/ComodoDecodeCSR |
8 | 8 | */ |
9 | 9 | |
10 | -require __DIR__ . '/../vendor/autoload.php'; |
|
10 | +require __DIR__.'/../vendor/autoload.php'; |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | |
45 | 45 | public function testWithJustSH1() |
46 | 46 | { |
47 | - $response = $this->validSHA1 . "\n"; |
|
47 | + $response = $this->validSHA1."\n"; |
|
48 | 48 | $test = $this->checkresponse($response); |
49 | 49 | $this->assertFalse($test); |
50 | 50 | } |
51 | 51 | |
52 | 52 | public function testWithSH1AndComdoText() |
53 | 53 | { |
54 | - $response = $this->validSHA1 . "\n"; |
|
54 | + $response = $this->validSHA1."\n"; |
|
55 | 55 | $response .= "comodoca.com\n"; |
56 | 56 | $test = $this->checkresponse($response); |
57 | 57 | $this->assertTrue($test); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | public function testWithSH1AndComdoTextNoTrailingReturn() |
61 | 61 | { |
62 | - $response = $this->validSHA1 . "\n"; |
|
62 | + $response = $this->validSHA1."\n"; |
|
63 | 63 | $response .= "comodoca.com"; |
64 | 64 | $test = $this->checkresponse($response); |
65 | 65 | $this->assertTrue($test); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | public function testWithSH1AndComdoTextAndNewLine() |
69 | 69 | { |
70 | - $response = $this->validSHA1 . "\n"; |
|
70 | + $response = $this->validSHA1."\n"; |
|
71 | 71 | $response .= "comodoca.com\n\n"; |
72 | 72 | $test = $this->checkresponse($response); |
73 | 73 | $this->assertTrue($test); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | { |
34 | 34 | $csrFile = $input->getArgument('csr'); |
35 | 35 | if (!file_exists($csrFile)) { |
36 | - $output->writeln('<error>Unable to load '. $csrFile .'</error>'); |
|
36 | + $output->writeln('<error>Unable to load '.$csrFile.'</error>'); |
|
37 | 37 | $output->writeln('<error>Please check the path and try again</error>'); |
38 | 38 | return false; |
39 | 39 | } |
@@ -36,8 +36,8 @@ |
||
36 | 36 | $hashes = $comodoDecodeCSR->fetchHashes(); |
37 | 37 | |
38 | 38 | if ($hashes) { |
39 | - $output->writeln('<info>MD5</info> ' . $hashes['md5']); |
|
40 | - $output->writeln('<info>SHA1</info> ' . $hashes['sha1']); |
|
39 | + $output->writeln('<info>MD5</info> '.$hashes['md5']); |
|
40 | + $output->writeln('<info>SHA1</info> '.$hashes['sha1']); |
|
41 | 41 | |
42 | 42 | return 0; |
43 | 43 | } |
@@ -42,10 +42,10 @@ |
||
42 | 42 | return 2; |
43 | 43 | } |
44 | 44 | |
45 | - $output->writeln('<info>Filename:</info> ' . $hashes['md5'] . '.txt'); |
|
45 | + $output->writeln('<info>Filename:</info> '.$hashes['md5'].'.txt'); |
|
46 | 46 | $output->writeln('<info>Contents:</info>'); |
47 | 47 | $output->writeln($comodoDecodeCSR->generateDVC()); |
48 | - $output->writeln('<info>URL:</info> http://' . $comodoDecodeCSR->getCN() . '/' . $hashes['md5'] . '.txt'); |
|
48 | + $output->writeln('<info>URL:</info> http://'.$comodoDecodeCSR->getCN().'/'.$hashes['md5'].'.txt'); |
|
49 | 49 | |
50 | 50 | return 0; |
51 | 51 | } |
@@ -58,6 +58,10 @@ discard block |
||
58 | 58 | $this->Form['csr'] = $CSR; |
59 | 59 | } |
60 | 60 | |
61 | + /** |
|
62 | + * @param integer $code |
|
63 | + * @param string $message |
|
64 | + */ |
|
61 | 65 | protected function addWarning($code, $message) |
62 | 66 | { |
63 | 67 | $this->warnings[] = [ |
@@ -103,7 +107,7 @@ discard block |
||
103 | 107 | |
104 | 108 | /** |
105 | 109 | * |
106 | - * @param GuzzleHttp\Psr7\Response $response |
|
110 | + * @param Response $response |
|
107 | 111 | * @return bool |
108 | 112 | */ |
109 | 113 | public function checkDVC(Response $response) |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | return false; |
86 | 86 | } |
87 | 87 | //We do most of our DVC over http:// unless the site is fully SSL |
88 | - $url = 'http://' . $domain . "/" . $this->getMD5() . '.txt'; |
|
88 | + $url = 'http://'.$domain."/".$this->getMD5().'.txt'; |
|
89 | 89 | |
90 | 90 | $client = new Client(['allow_redirects' => false, 'verify' => false]); |
91 | 91 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | public function generateDVC() |
102 | 102 | { |
103 | - $DVC = $this->getSHA1() . "\n"; |
|
103 | + $DVC = $this->getSHA1()."\n"; |
|
104 | 104 | $DVC .= "comodoca.com\n"; |
105 | 105 | |
106 | 106 | return $DVC; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function checkDVC(Response $response) |
115 | 115 | { |
116 | - $body = $response->getBody() . ''; |
|
116 | + $body = $response->getBody().''; |
|
117 | 117 | $DVC = $this->generateDVC(); |
118 | 118 | |
119 | 119 | //Check if we received a 301 or 302 redirect |
@@ -131,13 +131,13 @@ discard block |
||
131 | 131 | |
132 | 132 | //Check if last 2 characters are new lines |
133 | 133 | if (substr($body, -2) === "\n\n") { |
134 | - $body = substr($body, 0, -2) . "\n"; |
|
134 | + $body = substr($body, 0, -2)."\n"; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | //Check if last character is not a new line |
138 | 138 | if (substr($body, -1) !== "\n") { |
139 | 139 | //Add said new line |
140 | - $body = $body . "\n"; |
|
140 | + $body = $body."\n"; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | //Check it again |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | public function setUp() |
22 | 22 | { |
23 | - register_shutdown_function(function () { |
|
23 | + register_shutdown_function(function() { |
|
24 | 24 | if (file_exists('test.csr')) { |
25 | 25 | unlink('test.csr'); |
26 | 26 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | public function setUp() |
22 | 22 | { |
23 | - register_shutdown_function(function () { |
|
23 | + register_shutdown_function(function() { |
|
24 | 24 | if (file_exists('test.csr')) { |
25 | 25 | unlink('test.csr'); |
26 | 26 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $tester = new CommandTester($command); |
63 | 63 | |
64 | 64 | //Create an empty |
65 | - file_put_contents('test.csr', ' ' . $this->createFakeCSR(), FILE_APPEND | LOCK_EX); |
|
65 | + file_put_contents('test.csr', ' '.$this->createFakeCSR(), FILE_APPEND | LOCK_EX); |
|
66 | 66 | |
67 | 67 | $tester->execute([ |
68 | 68 | 'csr' => 'test.csr' |