Skip to content

Commit

Permalink
Format to PSR2 standard
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jul 31, 2022
1 parent 8b45e93 commit 2690c34
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
13 changes: 8 additions & 5 deletions packages/framework/src/Commands/HydeBuildStaticSiteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ public function runPostBuildActions(): void
protected function printFinishMessage(float $time_start): void
{
$execution_time = (microtime(true) - $time_start);
$this->info(sprintf('All done! Finished in %s seconds. (%sms)',
number_format($execution_time, 2), number_format($execution_time * 1000, 2)
$this->info(sprintf(
'All done! Finished in %s seconds. (%sms)',
number_format($execution_time, 2),
number_format($execution_time * 1000, 2)
));

$this->info('Congratulations! 🎉 Your static site has been built!');
Expand All @@ -149,10 +151,11 @@ protected function runNodeCommand(string $command, string $message, ?string $act
{
$this->info($message.' This may take a second.');

$output = shell_exec(sprintf('%s%s',
$output = shell_exec(sprintf(
'%s%s',
app()->environment() === 'testing' ? 'echo ' : '',
$command)
);
$command
));

$this->line($output ?? sprintf(
'<fg=red>Could not %s! Is NPM installed?</>',
Expand Down
3 changes: 2 additions & 1 deletion packages/framework/src/Concerns/HasPageMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ public function hasOpenGraphTitleInConfig(): bool

protected function makeRssFeedLink(): string
{
return sprintf('<link rel="alternate" type="application/rss+xml" title="%s" href="%s" />',
return sprintf(
'<link rel="alternate" type="application/rss+xml" title="%s" href="%s" />',
RssFeedService::getDescription(),
Hyde::url(RssFeedService::getDefaultOutputFilename())
);
Expand Down
10 changes: 6 additions & 4 deletions packages/framework/src/Services/BuildService.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public function transferMediaAssets(): void
$collection = DiscoveryService::getMediaAssetFiles();
$this->comment('Transferring Media Assets...');

$this->withProgressBar($collection,
$this->withProgressBar(
$collection,
function ($filepath) {
copy($filepath, Hyde::getSiteOutputPath('media/'.basename($filepath)));
}
Expand All @@ -80,7 +81,8 @@ protected function compilePagesForClass(string $pageClass): void
$collection = $this->router->getRoutesForModel($pageClass);

$this->withProgressBar(
$collection, $this->compileRoute()
$collection,
$this->compileRoute()
);

$this->newLine(2);
Expand Down Expand Up @@ -122,7 +124,7 @@ protected function askIfUnsafeDirectoryShouldBeEmptied(): bool
return $this->confirm(sprintf(
'The configured output directory (%s) is potentially unsafe to empty. '.
'Are you sure you want to continue?',
Hyde::getSiteOutputPath())
);
Hyde::getSiteOutputPath()
));
}
}
8 changes: 4 additions & 4 deletions packages/framework/src/Services/DiscoveryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ public static function getMarkdownPageFiles(): array|false
public static function getMediaAssetFiles(): array
{
return glob(Hyde::path('_media/*.{'.str_replace(
' ',
'',
config('hyde.media_extensions', 'png,svg,jpg,jpeg,gif,ico,css,js')
).'}'), GLOB_BRACE);
' ',
'',
config('hyde.media_extensions', 'png,svg,jpg,jpeg,gif,ico,css,js')
).'}'), GLOB_BRACE);
}

/**
Expand Down

0 comments on commit 2690c34

Please sign in to comment.