@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $this->mergeConfigFrom(__DIR__.'/../config/safe-urls.php', 'safe-urls'); |
| 46 | 46 | |
| 47 | 47 | // Register the service the package provides. |
| 48 | - $this->app->singleton('safe-urls', function () { |
|
| 48 | + $this->app->singleton('safe-urls', function() { |
|
| 49 | 49 | return new SafeUrls(); |
| 50 | 50 | }); |
| 51 | 51 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function provides() |
| 59 | 59 | { |
| 60 | - return ['safe-urls']; |
|
| 60 | + return [ 'safe-urls' ]; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -73,6 +73,6 @@ discard block |
||
| 73 | 73 | ], 'safe-urls.config'); |
| 74 | 74 | |
| 75 | 75 | // Registering package commands. |
| 76 | - $this->commands(['safe-urls']); |
|
| 76 | + $this->commands([ 'safe-urls' ]); |
|
| 77 | 77 | } |
| 78 | 78 | } |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | */ |
| 82 | 82 | public function getData() |
| 83 | 83 | { |
| 84 | - return []; |
|
| 84 | + return [ ]; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -29,10 +29,10 @@ discard block |
||
| 29 | 29 | public function __construct() |
| 30 | 30 | { |
| 31 | 31 | // Initialise the list of urls as an empty array. |
| 32 | - $this->urls = []; |
|
| 32 | + $this->urls = [ ]; |
|
| 33 | 33 | |
| 34 | 34 | // Initialise the list of urls as an empty array. |
| 35 | - $this->results = []; |
|
| 35 | + $this->results = [ ]; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -131,6 +131,6 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | public static function format(array $urls): array |
| 133 | 133 | { |
| 134 | - return []; |
|
| 134 | + return [ ]; |
|
| 135 | 135 | } |
| 136 | 136 | } |
@@ -26,8 +26,8 @@ |
||
| 26 | 26 | protected function setUp(): void |
| 27 | 27 | { |
| 28 | 28 | $this->postUrl = ''; |
| 29 | - $this->headers = []; |
|
| 30 | - $this->payload = []; |
|
| 29 | + $this->headers = [ ]; |
|
| 30 | + $this->payload = [ ]; |
|
| 31 | 31 | $this->timeout = 10; |
| 32 | 32 | $this->curl = new Curl( |
| 33 | 33 | $this->postUrl, |
@@ -15,6 +15,6 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | protected function getPackageProviders($app) |
| 17 | 17 | { |
| 18 | - return [SafeUrlsServiceProvider::class]; |
|
| 18 | + return [ SafeUrlsServiceProvider::class ]; |
|
| 19 | 19 | } |
| 20 | 20 | } |
@@ -48,9 +48,9 @@ |
||
| 48 | 48 | */ |
| 49 | 49 | public static function formatUrls(array $urls): array |
| 50 | 50 | { |
| 51 | - $formattedUrls = []; |
|
| 51 | + $formattedUrls = [ ]; |
|
| 52 | 52 | foreach ($urls as $url) { |
| 53 | - $formattedUrls[] = ['url' => $url]; |
|
| 53 | + $formattedUrls[ ] = [ 'url' => $url ]; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return $formattedUrls; |
@@ -18,13 +18,13 @@ |
||
| 18 | 18 | public const DEFAULT_TIMEOUT = 10; |
| 19 | 19 | |
| 20 | 20 | // Default threat types. |
| 21 | - public const DEFAULT_THREAT_TYPES = ['THREAT_TYPE_UNSPECIFIED']; |
|
| 21 | + public const DEFAULT_THREAT_TYPES = [ 'THREAT_TYPE_UNSPECIFIED' ]; |
|
| 22 | 22 | |
| 23 | 23 | // Default threst entry types. |
| 24 | - public const DEFAULT_THREAT_ENTRY_TYPES = ['THREAT_ENTRY_TYPE_UNSPECIFIED']; |
|
| 24 | + public const DEFAULT_THREAT_ENTRY_TYPES = [ 'THREAT_ENTRY_TYPE_UNSPECIFIED' ]; |
|
| 25 | 25 | |
| 26 | 26 | // Default threat platform types. |
| 27 | - public const DEFAULT_THREAT_PLATFORM_TYPES = ['PLATFORM_TYPE_UNSPECIFIED']; |
|
| 27 | + public const DEFAULT_THREAT_PLATFORM_TYPES = [ 'PLATFORM_TYPE_UNSPECIFIED' ]; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Retrieve the Google API key. |
@@ -10,11 +10,11 @@ discard block |
||
| 10 | 10 | class DataTest extends TestCase |
| 11 | 11 | { |
| 12 | 12 | private $formattedUrls = [ |
| 13 | - ['url' => 'https://www.google.com'], |
|
| 14 | - ['url' => 'https://github.com'], |
|
| 15 | - ['url' => 'https://github.styleci.io'], |
|
| 16 | - ['url' => 'https://travis-ci.org'], |
|
| 17 | - ['url' => 'https://packagist.org'], |
|
| 13 | + [ 'url' => 'https://www.google.com' ], |
|
| 14 | + [ 'url' => 'https://github.com' ], |
|
| 15 | + [ 'url' => 'https://github.styleci.io' ], |
|
| 16 | + [ 'url' => 'https://travis-ci.org' ], |
|
| 17 | + [ 'url' => 'https://packagist.org' ], |
|
| 18 | 18 | ]; |
| 19 | 19 | |
| 20 | 20 | private $urls = [ |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | public function testPayloadSingleUrl() |
| 42 | 42 | { |
| 43 | 43 | $formattedUrl = [ |
| 44 | - ['url' => 'https://www.google.com'], |
|
| 44 | + [ 'url' => 'https://www.google.com' ], |
|
| 45 | 45 | ]; |
| 46 | 46 | |
| 47 | 47 | $url = [ |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | //['url' => ''], |
| 61 | 61 | ]; |
| 62 | 62 | |
| 63 | - $urls = []; |
|
| 63 | + $urls = [ ]; |
|
| 64 | 64 | |
| 65 | 65 | $expected = self::payload($formattedUrls); |
| 66 | 66 | |
@@ -78,10 +78,10 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | public function testFormatUrlsSingle() |
| 80 | 80 | { |
| 81 | - $url = ['https://www.google.com']; |
|
| 81 | + $url = [ 'https://www.google.com' ]; |
|
| 82 | 82 | |
| 83 | 83 | $expected = [ |
| 84 | - ['url' => 'https://www.google.com'], |
|
| 84 | + [ 'url' => 'https://www.google.com' ], |
|
| 85 | 85 | ]; |
| 86 | 86 | |
| 87 | 87 | $actual = Data::formatUrls($url); |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | public function testFormatUrlsNone() |
| 92 | 92 | { |
| 93 | - $urls = []; |
|
| 93 | + $urls = [ ]; |
|
| 94 | 94 | |
| 95 | - $expected = []; |
|
| 95 | + $expected = [ ]; |
|
| 96 | 96 | |
| 97 | 97 | $actual = Data::formatUrls($urls); |
| 98 | 98 | $this->assertEquals($expected, $actual); |