Skip to content

Commit

Permalink
Merge branch '5.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Feb 25, 2020
2 parents 799532b + a5c71dc commit f64aa69
Show file tree
Hide file tree
Showing 15 changed files with 10 additions and 152 deletions.
1 change: 0 additions & 1 deletion .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ return PhpCsFixer\Config::create()
'no_extra_consecutive_blank_lines' => false,
'no_unneeded_control_parentheses' => false,
'not_operator_with_successor_space' => true,
'no_superfluous_phpdoc_tags' => false,
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'phpdoc_align' => false,
'phpdoc_no_empty_return' => false,
Expand Down
14 changes: 0 additions & 14 deletions src/Bootstrap/LoadCurrentTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ class LoadCurrentTheme
{
/**
* Bootstrap the given application.
*
* @param \Illuminate\Contracts\Foundation\Application $app
*
* @return void
*/
public function bootstrap(Application $app): void
{
Expand All @@ -24,11 +20,6 @@ public function bootstrap(Application $app): void

/**
* Set current theme for request.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Orchestra\Contracts\Theme\Theme $theme
*
* @return void
*/
protected function setCurrentTheme(Application $app, Theme $theme): void
{
Expand All @@ -51,11 +42,6 @@ protected function setCurrentTheme(Application $app, Theme $theme): void

/**
* Boot theme resolver.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Orchestra\Contracts\Theme\Theme $theme
*
* @return void
*/
protected function setThemeResolver(Application $app, Theme $theme): void
{
Expand Down
6 changes: 0 additions & 6 deletions src/CommandServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class CommandServiceProvider extends ServiceProvider

/**
* Register the service provider.
*
* @return void
*/
public function registerActivateCommand(): void
{
Expand All @@ -35,8 +33,6 @@ public function registerActivateCommand(): void

/**
* Register the service provider.
*
* @return void
*/
public function registerDetectCommand(): void
{
Expand All @@ -47,8 +43,6 @@ public function registerDetectCommand(): void

/**
* Register the service provider.
*
* @return void
*/
public function registerOptimizeCommand(): void
{
Expand Down
11 changes: 0 additions & 11 deletions src/Console/ActivateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ class ActivateCommand extends Command
/**
* Execute the console command.
*
* @param \Orchestra\View\Theme\Finder $finder
*
* @return void
*
* @return int
*/
public function handle(Finder $finder)
Expand All @@ -68,13 +65,10 @@ public function handle(Finder $finder)
/**
* Validate provided theme.
*
* @param string $group
* @param string|int $id
* @param object|null $theme
*
* @throws \InvalidArgumentException
*
* @return bool
*/
protected function validateProvidedTheme(string $group, $id, $theme): bool
{
Expand All @@ -91,11 +85,6 @@ protected function validateProvidedTheme(string $group, $id, $theme): bool

/**
* Get all available theme by type.
*
* @param \Orchestra\View\Theme\Finder $finder
* @param string $type
*
* @return \Illuminate\Support\Collection
*/
protected function getAvailableTheme(Finder $finder, string $type): Collection
{
Expand Down
5 changes: 0 additions & 5 deletions src/Console/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ abstract class Command extends BaseCommand
/**
* Execute the console command.
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
*
* @return mixed
*/
protected function execute(InputInterface $input, OutputInterface $output)
Expand All @@ -27,8 +24,6 @@ protected function execute(InputInterface $input, OutputInterface $output)

/**
* Finish the console command.
*
* @return void
*/
protected function finish(): void
{
Expand Down
8 changes: 0 additions & 8 deletions src/Console/DetectCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class DetectCommand extends Command
/**
* Execute the console command.
*
* @param \Orchestra\View\Theme\Finder $finder
*
* @return int
*/
public function handle(Finder $finder)
Expand All @@ -52,12 +50,6 @@ public function handle(Finder $finder)

/**
* Get theme status.
*
* @param string $type
* @param \Orchestra\View\Theme\Manifest $theme
* @param bool $active
*
* @return string
*/
protected function getThemeStatus(string $type, Manifest $theme, bool $active = false): string
{
Expand Down
9 changes: 0 additions & 9 deletions src/Console/OptimizeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ public function handle()

/**
* Compile all view files.
*
* @return void
*/
protected function compileViews(): void
{
Expand All @@ -50,10 +48,6 @@ protected function compileViews(): void

/**
* Compile all views files in path.
*
* @param string $path
*
* @return void
*/
protected function compileViewsInPath(string $path): void
{
Expand All @@ -72,9 +66,6 @@ protected function compileViewsInPath(string $path): void
* Compile single view file.
*
* @param mixed $engine
* @param string $file
*
* @return void
*/
protected function compileSingleViewFile($engine, string $file): void
{
Expand Down
9 changes: 0 additions & 9 deletions src/Decorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ class Decorator

/**
* Registers a custom macro.
*
* @param string $name
* @param \Closure $macro
*
* @return void
*/
public function macro(string $name, callable $macro): void
{
Expand All @@ -29,7 +24,6 @@ public function macro(string $name, callable $macro): void
/**
* Render the macro.
*
* @param string $name
* @param mixed $parameters
*
* @throws \BadMethodCallException
Expand All @@ -48,9 +42,6 @@ public function render(string $name, ...$parameters)
/**
* Dynamically handle calls to custom macros.
*
* @param string $method
* @param array $parameters
*
* @return mixed
*/
public function __call(string $method, array $parameters)
Expand Down
8 changes: 0 additions & 8 deletions src/Theme/Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class Finder implements FinderContract

/**
* Construct a new finder.
*
* @param \Illuminate\Filesystem\Filesystem $files
*/
public function __construct(Filesystem $files, string $publicPath)
{
Expand All @@ -37,8 +35,6 @@ public function __construct(Filesystem $files, string $publicPath)
* Detect available themes.
*
* @throws \RuntimeException
*
* @return \Illuminate\Support\Collection
*/
public function detect(): Collection
{
Expand All @@ -53,10 +49,6 @@ public function detect(): Collection

/**
* Get folder name from full path.
*
* @param string $path
*
* @return string
*/
protected function parseThemeNameFromPath(string $path): string
{
Expand Down
31 changes: 5 additions & 26 deletions src/Theme/Manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ class Manifest
/**
* Load the theme.
*
* @param \Illuminate\Filesystem\Filesystem $files
* @param string $path
*
* @throws \RuntimeException
*/
public function __construct(Filesystem $files, string $path)
Expand All @@ -55,9 +52,7 @@ public function __construct(Filesystem $files, string $path)

if (\is_null($jsonable)) {
// json_decode couldn't parse, throw an exception.
throw new RuntimeException(
"Theme [{$path}]: cannot decode theme.json file"
);
throw new RuntimeException("Theme [{$path}]: cannot decode theme.json file");
}

$this->items = new Fluent($this->generateManifestConfig($jsonable));
Expand All @@ -70,7 +65,6 @@ public function __construct(Filesystem $files, string $path)
/**
* Get single attribute.
*
* @param string $key
* @param mixed|null $default
*
* @return mixed
Expand All @@ -82,8 +76,6 @@ public function get(string $key, $default = null)

/**
* Get collection.
*
* @return \Illuminate\Support\Fluent
*/
public function items(): Fluent
{
Expand All @@ -95,24 +87,17 @@ public function items(): Fluent
* would allow other part of the application to use this configuration
* to migrate, load service provider as well as preload some
* configuration.
*
* @param array $config
*
* @return array
*/
protected function generateManifestConfig(array $config): array
{
return Collection::make($this->manifestOptions)->mapWithKeys(static function ($default, $key) use ($config) {
return [$key => ($config[$key] ?? $default)];
})->all();
return Collection::make($this->manifestOptions)
->mapWithKeys(static function ($default, $key) use ($config) {
return [$key => ($config[$key] ?? $default)];
})->all();
}

/**
* Get theme name from path.
*
* @param string $path
*
* @return string
*/
protected function parseThemeNameFromPath(string $path): string
{
Expand All @@ -125,8 +110,6 @@ protected function parseThemeNameFromPath(string $path): string
/**
* Magic method to get items by key.
*
* @param string $key
*
* @return mixed
*/
public function __get(string $key)
Expand All @@ -136,10 +119,6 @@ public function __get(string $key)

/**
* Magic Method to check isset by key.
*
* @param string $key
*
* @return bool
*/
public function __isset(string $key): bool
{
Expand Down

0 comments on commit f64aa69

Please sign in to comment.