Skip to content

Commit

Permalink
style: fix code styling
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-frey authored and github-actions[bot] committed May 4, 2024
1 parent 806f41b commit e6584bb
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/Actions/Forms/Components/HelpAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static function forDocumentable(Documentable $documentable): static
->when(
Filament::getPlugin('guava::filament-knowledge-base')->hasModalPreviews(),
fn (HelpAction $action) => $action
->modalContent(fn() => new HtmlString($documentable->getSimpleHtml()))
->modalContent(fn () => new HtmlString($documentable->getSimpleHtml()))
->modalHeading($documentable->getTitle())
->modalSubmitAction(false)
->modalCancelActionLabel(__('filament-knowledge-base::translations.close'))
Expand Down
1 change: 0 additions & 1 deletion src/Clusters/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
class Test extends Cluster
{
protected static ?string $navigationIcon = 'heroicon-o-squares-2x2';

}
1 change: 0 additions & 1 deletion src/Concerns/HasDocumentable.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Guava\FilamentKnowledgeBase\Concerns;

use Guava\FilamentKnowledgeBase\Contracts\Documentable;
use PhpParser\Comment\Doc;

trait HasDocumentable
{
Expand Down
1 change: 1 addition & 0 deletions src/Contracts/Documentable.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
interface Documentable
{
public function getId(): string;

public function getTitle(): ?string;

public function isRegistered(): bool;
Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/HasKnowledgeBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

interface HasKnowledgeBase
{
public static function getDocumentation(): array|string;
public static function getDocumentation(): array | string;
}
2 changes: 1 addition & 1 deletion src/Filament/DocumentationResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static function getGlobalSearchResultTitle(Model $record): string | Htmla
;
}

public static function resolveRecordRouteBinding(int|string $key): ?Model
public static function resolveRecordRouteBinding(int | string $key): ?Model
{
// TODO: First try to load it from a standalone (App/Docs) class
$record = parent::resolveRecordRouteBinding($key);
Expand Down
1 change: 0 additions & 1 deletion src/FilamentKnowledgeBaseServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Guava\FilamentKnowledgeBase\Commands\MakeDocumentationCommand;
use Guava\FilamentKnowledgeBase\Livewire\HelpMenu;
use Guava\FilamentKnowledgeBase\Providers\KnowledgeBasePanelProvider;
use Illuminate\Support\Facades\Blade;
use Livewire\Livewire;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
Expand Down
1 change: 1 addition & 0 deletions src/Markdown/Parsers/VariableParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function parse(InlineParserContext $inlineContext): bool

return true;
}

return false;
}
}
2 changes: 1 addition & 1 deletion src/Markdown/Renderers/FencedCodeRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function render(
'github-dark',
);
$element->setContents(
$code
$code
);

return view('filament-knowledge-base::code-block', [
Expand Down
6 changes: 3 additions & 3 deletions src/Markdown/Renderers/ImageRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ public function render(Node $node, ChildNodeRendererInterface $childRenderer): \

if (str($node->getUrl())->endsWith('.mov')) {
return new HtmlElement('video', ['muted' => 'muted', 'autoplay' => 'autoplay', 'loop' => 'loop',
'class' => 'rounded-md ring-1 ring-gray-950/5 dark:ring-white/10'
], new HtmlElement('source', $attrs), true);
'class' => 'rounded-md ring-1 ring-gray-950/5 dark:ring-white/10',
], new HtmlElement('source', $attrs), true);
} else {
return new HtmlElement('img', $attrs, '', true);
return new HtmlElement('img', $attrs, '', true);
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/Models/FlatfileDocumentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ public function getAnchors()
if ($event->isEntering() && $node instanceof HeadingPermalink) {
$slug = $node->getSlug();
$next = $node->next();
if (!method_exists($next, 'getLiteral')) {
if (! method_exists($next, 'getLiteral')) {
continue;
}
// dd($node, $node->next());
// }
// dd($node, $node->next());
// }
$anchors[$next->getLiteral()] = $slug;
}
}
Expand Down Expand Up @@ -168,6 +168,6 @@ public function getIcon(): ?string

public function isRegistered(): bool
{
return !empty($this->getTitle());
return ! empty($this->getTitle());
}
}
6 changes: 4 additions & 2 deletions src/Models/RelationalDocumentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public function getFrontMatter(): array
public function getHtml(): RenderedContentInterface
{
$converter = app(MarkdownRenderer::class)
->record($this);
->record($this)
;

return $converter->convertToHtml(file_get_contents($this->path));
}
Expand All @@ -83,7 +84,8 @@ public function getSimpleHtml(): RenderedContentInterface
return $converter->convertToHtml(file_get_contents($this->path));
}

public function getPart(string $id) {
public function getPart(string $id)
{
$walker = $this->getHtml()->getDocument()->walker();

while ($event = $walker->next()) {
Expand Down
1 change: 0 additions & 1 deletion src/Pages/Concerns/HasIcon.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Guava\FilamentKnowledgeBase\Pages\Concerns;

use Closure;
use Illuminate\Support\Str;

trait HasIcon
{
Expand Down
1 change: 0 additions & 1 deletion src/Pages/Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ class Section extends Page
protected static ?string $navigationIcon = 'heroicon-o-document-text';

protected static string $view = 'filament-knowledge-base::pages.section';

}
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Guava\FilamentKnowledgeBase\Tests;

use Guava\FilamentKnowledgeBase\FilamentKnowledgeBaseServiceProvider;
use Illuminate\Database\Eloquent\Factories\Factory;
use Orchestra\Testbench\TestCase as Orchestra;
use Guava\FilamentKnowledgeBase\FilamentKnowledgeBaseServiceProvider;

class TestCase extends Orchestra
{
Expand Down

0 comments on commit e6584bb

Please sign in to comment.