@@ -4,26 +4,26 @@ |
||
4 | 4 | |
5 | 5 | require_once __DIR__.'/MicroTest.php'; |
6 | 6 | |
7 | -test('example', function () { |
|
7 | +test('example', function() { |
|
8 | 8 | $this->assert(true); |
9 | 9 | }); |
10 | 10 | |
11 | -test('can install composer dependencies', function () { |
|
12 | - $this->assert(! file_exists(BASE_PATH.'/vendor/autoload.php'), 'Autoloader already exists'); |
|
11 | +test('can install composer dependencies', function() { |
|
12 | + $this->assert(!file_exists(BASE_PATH.'/vendor/autoload.php'), 'Autoloader already exists'); |
|
13 | 13 | |
14 | 14 | shell_exec('cd '.BASE_PATH.' && composer install'); |
15 | 15 | |
16 | 16 | $this->assert(file_exists(BASE_PATH.'/vendor/autoload.php'), 'Autoloader does not exist'); |
17 | 17 | }); |
18 | 18 | |
19 | -test('can run the HydeCLI binary', function () { |
|
19 | +test('can run the HydeCLI binary', function() { |
|
20 | 20 | $output = shell_exec('cd '.BASE_PATH.' && php hyde --no-ansi'); |
21 | 21 | $this->assert(str_contains($output, 'USAGE: hyde <command> [options] [arguments]'), |
22 | 22 | 'HydeCLI output does not contain "USAGE: hyde <command> [options] [arguments]"' |
23 | 23 | ); |
24 | 24 | }); |
25 | 25 | |
26 | -test('can build the static site', function () { |
|
26 | +test('can build the static site', function() { |
|
27 | 27 | $output = shell_exec('cd '.BASE_PATH.' && php hyde build --no-ansi'); |
28 | 28 | |
29 | 29 | $this->assert(str_contains($output, 'Building your static site!'), |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | public static function getInstance(): self |
38 | 38 | { |
39 | - if (! isset(self::$instance)) { |
|
39 | + if (!isset(self::$instance)) { |
|
40 | 40 | self::$instance = new self(); |
41 | 41 | } |
42 | 42 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | /** @throws \Exception */ |
54 | 54 | public function assert(bool $condition, string $message = null): void |
55 | 55 | { |
56 | - if (! $condition) { |
|
56 | + if (!$condition) { |
|
57 | 57 | throw new Exception($message ?? 'Assertion failed'); |
58 | 58 | } |
59 | 59 | } |
@@ -54,7 +54,7 @@ |
||
54 | 54 | /** @codeCoverageIgnore Until output is testable */ |
55 | 55 | protected function runServerProcess(string $command): void |
56 | 56 | { |
57 | - Process::forever()->run($command, function (string $type, string $line): void { |
|
57 | + Process::forever()->run($command, function(string $type, string $line): void { |
|
58 | 58 | $this->output->write($line); |
59 | 59 | }); |
60 | 60 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | throw new BadMethodCallException('Cannot register an extension after the Kernel has been booted.'); |
40 | 40 | } |
41 | 41 | |
42 | - if (! is_subclass_of($extension, HydeExtension::class)) { |
|
42 | + if (!is_subclass_of($extension, HydeExtension::class)) { |
|
43 | 43 | // We want to make sure that the extension class extends the HydeExtension class, |
44 | 44 | // so that we won't have to check the methods we need to call exist later on. |
45 | 45 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function getExtension(string $extension): HydeExtension |
65 | 65 | { |
66 | - if (! isset($this->extensions[$extension])) { |
|
66 | + if (!isset($this->extensions[$extension])) { |
|
67 | 67 | throw new InvalidArgumentException("Extension [$extension] is not registered."); |
68 | 68 | } |
69 | 69 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | /** @return array<class-string<\Hyde\Pages\Concerns\HydePage>> */ |
96 | 96 | public function getRegisteredPageClasses(): array |
97 | 97 | { |
98 | - return array_unique(array_merge(...array_map(function (string $extension): array { |
|
98 | + return array_unique(array_merge(...array_map(function(string $extension): array { |
|
99 | 99 | /** @var <class-string<\Hyde\Foundation\Concerns\HydeExtension>> $extension */ |
100 | 100 | return $extension::getPageClasses(); |
101 | 101 | }, $this->getRegisteredExtensions()))); |
@@ -17,7 +17,7 @@ |
||
17 | 17 | exit(0); |
18 | 18 | } |
19 | 19 | |
20 | -if (! file_exists('report.xml')) { |
|
20 | +if (!file_exists('report.xml')) { |
|
21 | 21 | exit(404); |
22 | 22 | } |
23 | 23 |
@@ -105,7 +105,7 @@ |
||
105 | 105 | |
106 | 106 | protected function findTasksInAppDirectory(): array |
107 | 107 | { |
108 | - return Filesystem::smartGlob('app/Actions/*BuildTask.php')->map(function (string $file): string { |
|
108 | + return Filesystem::smartGlob('app/Actions/*BuildTask.php')->map(function(string $file): string { |
|
109 | 109 | return static::pathToClassName($file); |
110 | 110 | })->toArray(); |
111 | 111 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | { |
40 | 40 | $this->startClock(); |
41 | 41 | |
42 | - if ($output && ! $this->output) { |
|
42 | + if ($output && !$this->output) { |
|
43 | 43 | $this->setOutput($output); |
44 | 44 | } |
45 | 45 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | protected function isItSafeToCleanOutputDirectory(): bool |
34 | 34 | { |
35 | - if (! $this->isOutputDirectoryWhitelisted() && ! $this->askIfUnsafeDirectoryShouldBeEmptied()) { |
|
35 | + if (!$this->isOutputDirectoryWhitelisted() && !$this->askIfUnsafeDirectoryShouldBeEmptied()) { |
|
36 | 36 | $this->info('Output directory will not be emptied.'); |
37 | 37 | |
38 | 38 | return false; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | static::needsDirectory(static::$sourceDirectory); |
50 | 50 | |
51 | - return new static(DataCollection::findFiles($name, 'md')->mapWithKeys(function (string $file): array { |
|
51 | + return new static(DataCollection::findFiles($name, 'md')->mapWithKeys(function(string $file): array { |
|
52 | 52 | return [static::makeIdentifier($file) => (new MarkdownFileParser($file))->get()]; |
53 | 53 | })); |
54 | 54 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | static::needsDirectory(static::$sourceDirectory); |
66 | 66 | |
67 | - return new static(DataCollection::findFiles($name, ['yaml', 'yml'])->mapWithKeys(function (string $file): array { |
|
67 | + return new static(DataCollection::findFiles($name, ['yaml', 'yml'])->mapWithKeys(function(string $file): array { |
|
68 | 68 | return [static::makeIdentifier($file) => (new MarkdownFileParser($file))->get()->matter()]; |
69 | 69 | })); |
70 | 70 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | { |
81 | 81 | static::needsDirectory(static::$sourceDirectory); |
82 | 82 | |
83 | - return new static(DataCollection::findFiles($name, 'json')->mapWithKeys(function (string $file) use ($asArray): array { |
|
83 | + return new static(DataCollection::findFiles($name, 'json')->mapWithKeys(function(string $file) use ($asArray): array { |
|
84 | 84 | return [static::makeIdentifier($file) => json_decode(Filesystem::get($file), $asArray)]; |
85 | 85 | })); |
86 | 86 | } |