Skip to content

Commit

Permalink
Merge pull request #47 from hydephp/code-formatting
Browse files Browse the repository at this point in the history
Format source code
  • Loading branch information
caendesilva authored Dec 11, 2023
2 parents 7b3dc65 + 6ba71b0 commit b74cc5e
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 21 deletions.
9 changes: 4 additions & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ config/ export-ignore
tests/ export-ignore
app/ export-ignore
bin/ export-ignore

/hyde export-ignore
.gitignore export-ignore
.gitattributes export-ignore
CHANGELOG.md export-ignore
LICENSE.md export-ignore
SECURITY.md export-ignore
composer.lock export-ignore
box.json export-ignore
phpunit.xml export-ignore
.gitattributes export-ignore
.gitignore export-ignore
/hyde export-ignore
box.json export-ignore
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
- name: Test can build anonymous project
run: |
cd ./source/tests/Fixtures/anonymous-project
php ../../System/bin/Assert.php "str_contains(shell_exec('hyde build'), 'Your static site has been built!')"
php ../../System/bin/Assert.php "file_exists_and_is_not_empty('_site/posts/hello-world.html')"
php ../../System/bin/Assert.php "file_exists_and_is_not_empty('_site/docs/search.html')"
Expand All @@ -200,7 +200,7 @@ jobs:
cd ./source/tests/Fixtures/full-project
php ../../System/bin/Assert.php "! str_contains(shell_exec('hyde --version'), 'Experimental Standalone')"
php ../../System/bin/Assert.php "str_contains(shell_exec('hyde'), 'File proxied by standalone')"
test-realtime-compiler:
needs: build-executable

Expand Down Expand Up @@ -271,7 +271,7 @@ jobs:
run: |
# Create fake composer vendor autoload file
mkdir vendor && echo '<?php set_error_handler(function($errno,$errstr,$errfile,$errline){throw new \ErrorException($errstr,0,$errno,$errfile,$errline);});return[];' > vendor/autoload.php
# Create fake app bootstrap file
mkdir app && echo "<?php namespace{echo 'Hello World'.PHP_EOL;return new class{public function make(){return new class{public function handle(){return 0;}public function terminate(){return 0;}};}};}namespace Symfony\Component\Console\Input{class ArgvInput{}}namespace Symfony\Component\Console\Output{class ConsoleOutput{}}" > app/bootstrap.php
Expand Down
6 changes: 3 additions & 3 deletions app/Commands/Internal/BuildApplicationBinaryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace App\Commands\Internal;

use LogicException;
use Illuminate\Support\Facades\File;
use LaravelZero\Framework\Commands\BuildCommand;
use LaravelZero\Framework\Commands\Command;
use LogicException;
use Symfony\Component\Console\Output\ConsoleOutput;
use Throwable;

Expand Down Expand Up @@ -48,7 +48,7 @@ public function handle(): int

protected function getVersion(): string
{
return $this->getApplication()->getVersion() . ($this->option('build-version-suffix') ? sprintf(' (Build %s)', $this->option('build-version-suffix')) : '');
return $this->getApplication()->getVersion().($this->option('build-version-suffix') ? sprintf(' (Build %s)', $this->option('build-version-suffix')) : '');
}

protected function setupBuildEnvironment(): void
Expand All @@ -73,7 +73,7 @@ protected function clearCachedConfiguration(bool $silent = false): void
File::delete($configPath);
}

if (! $silent) {
if (! $silent) {
$this->components->info('Configuration cache cleared successfully.');
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/Commands/Internal/Describer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Describer extends BaseDescriber
protected static function sortCommandsInGroup(array &$commands): void
{
usort($commands, function ($a, $b) {
if ($a->getName() === 'new') {
if ($a->getName() === 'new') {
return -1;
}

Expand Down
6 changes: 3 additions & 3 deletions app/Commands/ServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ protected function getServerStub(string $phar): string
return <<<PHP
<?php
// Proxies the realtime compiler server from the Phar archive
Phar::loadPhar('$phar', 'hyde.phar');
putenv('HYDE_AUTOLOAD_PATH=phar://hyde.phar/vendor/autoload.php');
return require 'phar://hyde.phar/vendor/hyde/realtime-compiler/bin/server.php';
PHP;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Providers;

use App\Commands\Internal\Describer;
use App\Commands\NewProjectCommand;
use App\Commands\ServeCommand;
use App\Commands\Internal\Describer;
use App\Commands\VendorPublishCommand;
use Illuminate\Support\ServiceProvider;
use NunoMaduro\LaravelConsoleSummary\Contracts\DescriberContract;
Expand Down
2 changes: 1 addition & 1 deletion app/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
|
*/

'version' => sprintf("v%s <fg=gray>-</> <comment>Experimental Standalone</comment> <fg=gray>-</> <fg=gray>(HydePHP v%s)</>",
'version' => sprintf('v%s <fg=gray>-</> <comment>Experimental Standalone</comment> <fg=gray>-</> <fg=gray>(HydePHP v%s)</>',
\App\Application::APP_VERSION, \Hyde\Foundation\HydeKernel::VERSION
),

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/BootstrapTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php /** @noinspection PhpPossiblePolymorphicInvocationInspection */
<?php

use Hyde\Foundation\Application;
use Hyde\Foundation\ConsoleKernel;
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/NewProjectCommandTest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

use App\Application;
use Illuminate\Process\Factory;
use Illuminate\Console\OutputStyle;
use App\Commands\NewProjectCommand;
use Illuminate\Console\OutputStyle;
use Illuminate\Process\Factory;
use Illuminate\Support\Facades\Process;
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Formatter\OutputFormatterInterface;

test('can create new project', function () {
Process::swap(new Factory());
Expand Down

0 comments on commit b74cc5e

Please sign in to comment.