Skip to content

Commit 4a97acb

Browse files
authored
Merge pull request #845 from hydephp/housekeeping
Clean up code
2 parents 16e074d + f61ff22 commit 4a97acb

File tree

7 files changed

+29
-9
lines changed

7 files changed

+29
-9
lines changed

.idea/misc.xml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/framework/src/Foundation/Application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ protected function registerBaseBindings(): void
2020
parent::registerBaseBindings();
2121

2222
/*
23-
* Enable auto-discovery.
23+
* Enable package auto-discovery.
2424
*/
25-
$this->app->singleton(PackageManifest::class, function (): \Illuminate\Foundation\PackageManifest {
25+
$this->app->singleton(PackageManifest::class, function (): PackageManifest {
2626
return new PackageManifest(
2727
new Filesystem,
2828
$this->basePath(),

packages/framework/src/Foundation/Facades/Router.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
namespace Hyde\Foundation\Facades;
66

77
use Hyde\Foundation\HydeKernel;
8+
use Hyde\Foundation\RouteCollection;
89
use Illuminate\Support\Facades\Facade;
910

1011
/**
1112
* @mixin \Hyde\Foundation\RouteCollection
1213
*/
1314
class Router extends Facade
1415
{
15-
public static function getFacadeRoot(): \Hyde\Foundation\RouteCollection
16+
public static function getFacadeRoot(): RouteCollection
1617
{
1718
return HydeKernel::getInstance()->routes();
1819
}

packages/framework/src/Foundation/Filesystem.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ public function getBasePath(): string
5151
*
5252
* You may also use the function to generate a fully qualified path to a given file
5353
* relative to the project root directory when supplying the path argument.
54-
*
55-
* @param string $path
5654
*/
5755
public function path(string $path = ''): string
5856
{

packages/framework/src/Framework/Actions/BladeMatterParser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class BladeMatterParser
4646
protected string $contents;
4747
protected array $matter;
4848

49-
/** The directive signature used to determine if a line should be parsed. */
49+
/** @var string The directive signature used to determine if a line should be parsed. */
5050
protected const SEARCH = '@php($';
5151

5252
public static function parseFile(string $localFilePath): array
@@ -86,13 +86,13 @@ public function parse(): static
8686

8787
protected static function lineMatchesFrontMatter(string $line): bool
8888
{
89-
return str_starts_with($line, (string) static::SEARCH);
89+
return str_starts_with($line, static::SEARCH);
9090
}
9191

9292
protected static function extractKey(string $line): string
9393
{
9494
// Remove search prefix
95-
$key = substr($line, strlen((string) static::SEARCH));
95+
$key = substr($line, strlen(static::SEARCH));
9696

9797
// Remove everything after the first equals sign
9898
$key = substr($key, 0, strpos($key, '='));

packages/framework/src/Framework/HydeServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function register(): void
3939

4040
$this->app->singleton(AssetService::class, AssetService::class);
4141

42-
$this->app->singleton(MarkdownConverter::class, function (): \Hyde\Markdown\MarkdownConverter {
42+
$this->app->singleton(MarkdownConverter::class, function (): MarkdownConverter {
4343
return new MarkdownConverter();
4444
});
4545

packages/framework/src/Markdown/Models/FrontMatter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public function __toString(): string
4040
return (new ConvertsArrayToFrontMatter())->execute($this->data);
4141
}
4242

43+
/** @return mixed|static */
4344
public function __get(string $key): mixed
4445
{
4546
return $this->get($key);

0 commit comments

Comments
 (0)