@@ -7,7 +7,7 @@ |
||
| 7 | 7 | * @version v0.3.0 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -declare(strict_types=1); |
|
| 10 | +declare(strict_types = 1); |
|
| 11 | 11 | |
| 12 | 12 | namespace AustinHeap\Security\Txt; |
| 13 | 13 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | if (!empty($this->encryption)) { |
| 146 | 146 | if ($this->comments) { |
| 147 | 147 | $this->spacer() |
| 148 | - ->comment('Our PGP key'); |
|
| 148 | + ->comment('Our PGP key'); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | $this->line('Encryption: ' . trim($this->encryption)); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | if (!empty($this->disclosure)) { |
| 155 | 155 | if ($this->comments) { |
| 156 | 156 | $this->spacer() |
| 157 | - ->comment('Our disclosure policy'); |
|
| 157 | + ->comment('Our disclosure policy'); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | $this->line('Disclosure: ' . trim(ucfirst($this->disclosure))); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | if (!empty($this->acknowledgement)) { |
| 164 | 164 | if ($this->comments) { |
| 165 | 165 | $this->spacer() |
| 166 | - ->comment('Our public acknowledgement'); |
|
| 166 | + ->comment('Our public acknowledgement'); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | $this->line('Acknowledgement: ' . trim($this->acknowledgement)); |
@@ -171,17 +171,17 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | if ($this->debug) { |
| 173 | 173 | $this->spacer() |
| 174 | - ->comment() |
|
| 175 | - ->comment( |
|
| 174 | + ->comment() |
|
| 175 | + ->comment( |
|
| 176 | 176 | 'Generated by "' . (defined('LARAVEL_SECURITY_TXT_VERSION') ? 'laravel' : 'php') . '-security-txt"' . |
| 177 | 177 | (defined('LARAVEL_SECURITY_TXT_VERSION') ? ' v' . LARAVEL_SECURITY_TXT_VERSION : (defined('PHP_SECURITY_TXT_VERSION') ? ' v' . PHP_SECURITY_TXT_VERSION : '')) . |
| 178 | 178 | ' (https://github.com/austinheap/' . (defined('LARAVEL_SECURITY_TXT_VERSION') ? 'laravel' : 'php') . '-security-txt' . (defined('LARAVEL_SECURITY_TXT_VERSION') ? '/releases/tag/v' . LARAVEL_SECURITY_TXT_VERSION : (defined('PHP_SECURITY_TXT_VERSION') ? '/releases/tag/v' . PHP_SECURITY_TXT_VERSION : '')) . ')') |
| 179 | - ->comment( |
|
| 179 | + ->comment( |
|
| 180 | 180 | 'using "php-security-txt"' . (defined('PHP_SECURITY_TXT_VERSION') ? ' v' . PHP_SECURITY_TXT_VERSION : '') . |
| 181 | 181 | ' (https://github.com/austinheap/php-security-txt' . (defined('PHP_SECURITY_TXT_VERSION') ? '/releases/tag/v' . PHP_SECURITY_TXT_VERSION : '') . ')') |
| 182 | - ->comment('in ' . round((microtime(true) - $time) * 1000, 6) . ' seconds on ' . now() . '.') |
|
| 183 | - ->comment() |
|
| 184 | - ->spacer(); |
|
| 182 | + ->comment('in ' . round((microtime(true) - $time) * 1000, 6) . ' seconds on ' . now() . '.') |
|
| 183 | + ->comment() |
|
| 184 | + ->spacer(); |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | $output = implode(PHP_EOL, $this->lines); |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * @version v0.3.0 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -declare(strict_types=1); |
|
| 10 | +declare(strict_types = 1); |
|
| 11 | 11 | |
| 12 | 12 | namespace AustinHeap\Security\Txt; |
| 13 | 13 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @var array |
| 28 | 28 | */ |
| 29 | - private $lines = []; |
|
| 29 | + private $lines = []; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Create a new Writer instance. |
@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | $comment = trim($comment); |
| 50 | 50 | |
| 51 | 51 | if (!empty($comment)) { |
| 52 | - $comment = ' ' . $comment; |
|
| 52 | + $comment = ' '.$comment; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - return $this->line(trim('#' . $comment)); |
|
| 55 | + return $this->line(trim('#'.$comment)); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | foreach ($this->contacts as $contact) { |
| 142 | - $this->line('Contact: ' . trim($contact)); |
|
| 142 | + $this->line('Contact: '.trim($contact)); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | if (!empty($this->encryption)) { |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | ->comment('Our PGP key'); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - $this->line('Encryption: ' . trim($this->encryption)); |
|
| 151 | + $this->line('Encryption: '.trim($this->encryption)); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | if (!empty($this->disclosure)) { |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | ->comment('Our disclosure policy'); |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - $this->line('Disclosure: ' . trim(ucfirst($this->disclosure))); |
|
| 160 | + $this->line('Disclosure: '.trim(ucfirst($this->disclosure))); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | if (!empty($this->acknowledgement)) { |
@@ -166,20 +166,20 @@ discard block |
||
| 166 | 166 | ->comment('Our public acknowledgement'); |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | - $this->line('Acknowledgement: ' . trim($this->acknowledgement)); |
|
| 169 | + $this->line('Acknowledgement: '.trim($this->acknowledgement)); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | if ($this->debug) { |
| 173 | 173 | $this->spacer() |
| 174 | 174 | ->comment() |
| 175 | 175 | ->comment( |
| 176 | - 'Generated by "' . (defined('LARAVEL_SECURITY_TXT_VERSION') ? 'laravel' : 'php') . '-security-txt"' . |
|
| 177 | - (defined('LARAVEL_SECURITY_TXT_VERSION') ? ' v' . LARAVEL_SECURITY_TXT_VERSION : (defined('PHP_SECURITY_TXT_VERSION') ? ' v' . PHP_SECURITY_TXT_VERSION : '')) . |
|
| 178 | - ' (https://github.com/austinheap/' . (defined('LARAVEL_SECURITY_TXT_VERSION') ? 'laravel' : 'php') . '-security-txt' . (defined('LARAVEL_SECURITY_TXT_VERSION') ? '/releases/tag/v' . LARAVEL_SECURITY_TXT_VERSION : (defined('PHP_SECURITY_TXT_VERSION') ? '/releases/tag/v' . PHP_SECURITY_TXT_VERSION : '')) . ')') |
|
| 176 | + 'Generated by "'.(defined('LARAVEL_SECURITY_TXT_VERSION') ? 'laravel' : 'php').'-security-txt"'. |
|
| 177 | + (defined('LARAVEL_SECURITY_TXT_VERSION') ? ' v'.LARAVEL_SECURITY_TXT_VERSION : (defined('PHP_SECURITY_TXT_VERSION') ? ' v'.PHP_SECURITY_TXT_VERSION : '')). |
|
| 178 | + ' (https://github.com/austinheap/'.(defined('LARAVEL_SECURITY_TXT_VERSION') ? 'laravel' : 'php').'-security-txt'.(defined('LARAVEL_SECURITY_TXT_VERSION') ? '/releases/tag/v'.LARAVEL_SECURITY_TXT_VERSION : (defined('PHP_SECURITY_TXT_VERSION') ? '/releases/tag/v'.PHP_SECURITY_TXT_VERSION : '')).')') |
|
| 179 | 179 | ->comment( |
| 180 | - 'using "php-security-txt"' . (defined('PHP_SECURITY_TXT_VERSION') ? ' v' . PHP_SECURITY_TXT_VERSION : '') . |
|
| 181 | - ' (https://github.com/austinheap/php-security-txt' . (defined('PHP_SECURITY_TXT_VERSION') ? '/releases/tag/v' . PHP_SECURITY_TXT_VERSION : '') . ')') |
|
| 182 | - ->comment('in ' . round((microtime(true) - $time) * 1000, 6) . ' seconds on ' . now() . '.') |
|
| 180 | + 'using "php-security-txt"'.(defined('PHP_SECURITY_TXT_VERSION') ? ' v'.PHP_SECURITY_TXT_VERSION : ''). |
|
| 181 | + ' (https://github.com/austinheap/php-security-txt'.(defined('PHP_SECURITY_TXT_VERSION') ? '/releases/tag/v'.PHP_SECURITY_TXT_VERSION : '').')') |
|
| 182 | + ->comment('in '.round((microtime(true) - $time) * 1000, 6).' seconds on '.now().'.') |
|
| 183 | 183 | ->comment() |
| 184 | 184 | ->spacer(); |
| 185 | 185 | } |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * @version v0.3.0 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -declare(strict_types=1); |
|
| 10 | +declare(strict_types = 1); |
|
| 11 | 11 | |
| 12 | 12 | namespace AustinHeap\Security\Txt; |
| 13 | 13 | |
@@ -26,77 +26,77 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @var string |
| 28 | 28 | */ |
| 29 | - const VERSION = '0.3.0'; |
|
| 29 | + const VERSION = '0.3.0'; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Internal parent object. |
| 33 | 33 | * |
| 34 | 34 | * @var \AustinHeap\Security\Txt\Writer|\AustinHeap\Security\Txt\Reader |
| 35 | 35 | */ |
| 36 | - private $parent = null; |
|
| 36 | + private $parent = null; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * Internal Writer object. |
| 40 | 40 | * |
| 41 | 41 | * @var \AustinHeap\Security\Txt\Writer |
| 42 | 42 | */ |
| 43 | - protected $writer = null; |
|
| 43 | + protected $writer = null; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Internal Reader object. |
| 47 | 47 | * |
| 48 | 48 | * @var \AustinHeap\Security\Txt\Reader |
| 49 | 49 | */ |
| 50 | - protected $reader = null; |
|
| 50 | + protected $reader = null; |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Internal text cache. |
| 54 | 54 | * |
| 55 | 55 | * @var string |
| 56 | 56 | */ |
| 57 | - protected $text = null; |
|
| 57 | + protected $text = null; |
|
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | 60 | * Enable debug output. |
| 61 | 61 | * |
| 62 | 62 | * @var bool |
| 63 | 63 | */ |
| 64 | - protected $debug = false; |
|
| 64 | + protected $debug = false; |
|
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | 67 | * Enable built-in comments. |
| 68 | 68 | * |
| 69 | 69 | * @var bool |
| 70 | 70 | */ |
| 71 | - protected $comments = true; |
|
| 71 | + protected $comments = true; |
|
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | 74 | * The security contact(s). |
| 75 | 75 | * |
| 76 | 76 | * @var array |
| 77 | 77 | */ |
| 78 | - protected $contacts = []; |
|
| 78 | + protected $contacts = []; |
|
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | 81 | * The PGP key file URL. |
| 82 | 82 | * |
| 83 | 83 | * @var string |
| 84 | 84 | */ |
| 85 | - protected $encryption = null; |
|
| 85 | + protected $encryption = null; |
|
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | 88 | * The disclosure policy. |
| 89 | 89 | * |
| 90 | 90 | * @var string |
| 91 | 91 | */ |
| 92 | - protected $disclosure = null; |
|
| 92 | + protected $disclosure = null; |
|
| 93 | 93 | |
| 94 | 94 | /** |
| 95 | 95 | * The acknowledgement URL. |
| 96 | 96 | * |
| 97 | 97 | * @var string |
| 98 | 98 | */ |
| 99 | - protected $acknowledgement = null; |
|
| 99 | + protected $acknowledgement = null; |
|
| 100 | 100 | |
| 101 | 101 | /** |
| 102 | 102 | * Create a new SecurityTxt instance. |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | if (!$parent instanceof Reader && |
| 114 | 114 | !$parent instanceof Writer) |
| 115 | - throw new Exception('Cannot create ' . __CLASS__ . ' with $parent class: ' . get_class($parent)); |
|
| 115 | + throw new Exception('Cannot create '.__CLASS__.' with $parent class: '.get_class($parent)); |
|
| 116 | 116 | |
| 117 | 117 | $this->parent = $parent; |
| 118 | 118 | |
@@ -111,8 +111,9 @@ |
||
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | if (!$parent instanceof Reader && |
| 114 | - !$parent instanceof Writer) |
|
| 115 | - throw new Exception('Cannot create ' . __CLASS__ . ' with $parent class: ' . get_class($parent)); |
|
| 114 | + !$parent instanceof Writer) { |
|
| 115 | + throw new Exception('Cannot create ' . __CLASS__ . ' with $parent class: ' . get_class($parent)); |
|
| 116 | + } |
|
| 116 | 117 | |
| 117 | 118 | $this->parent = $parent; |
| 118 | 119 | |