Skip to content

Commit

Permalink
fix(linting): Fix the whining
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Mar 24, 2020
1 parent 12b6fdf commit 7d21f0a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions src/Poet.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public function __construct($post = [], $taxonomy = [], $block = [])
protected function register()
{
collect($this->post)
->each(function ($config = [], $key) {
->each(function ($config, $key) {
$config = $config ?? [];

if ($this->exists($key)) {
return $this->modify($key, $config);
}
Expand All @@ -63,7 +65,9 @@ protected function register()
});

collect($this->taxonomy)
->each(function ($config = [], $key) {
->each(function ($config, $key) {
$config = $config ?? [];

if ($this->exists($key)) {
return $this->modify($key, $config);
}
Expand All @@ -72,13 +76,13 @@ protected function register()
});

collect($this->block)
->each(function ($config = [], $key) {
->each(function ($config, $key) {
$config = collect($config ?? []);

if (! Str::contains($key, '/')) {
$key = Str::start($key, 'block/');
}

$config = collect($config);

register_block_type($key, [
'render_callback' => function ($data, $content) use ($key, $config) {
return view($config->get('view', 'blocks.' . Str::after($key, '/')), [
Expand Down

0 comments on commit 7d21f0a

Please sign in to comment.