Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[console] make table width max 60, to ease line readings; cleanup unused view files #31

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions src/Console/ViewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,18 @@ public function __construct(
) {
}

public function newLine(): self
public function newLine(): void
{
$this->symfonyStyle->writeln('');

return $this;
}

// public function write(string $string): self
// {
// $this->symfonyStyle->write($string);
//
// return $this;
// }

/**
* @param array<string, mixed> $data
*/
public function render(string $view, array $data): self
public function render(string $view, array $data): void
{
render($this->getViewContent($view, $data));

return $this;
$viewContent = $this->getViewContent($view, $data);
render($viewContent);
}

/**
Expand Down
11 changes: 0 additions & 11 deletions src/Console/views/loading.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Console/views/table.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/** @var ?bool $includeRelative */
/** @var array<array{}|array{name: string, count: int|float|string, percent: float|string|null, isChild: bool}> $rows */
?>
<div class="mt-1 mx-2 max-w-150">
<div class="mt-1 mx-2 max-w-60">
<div class="flex justify-between">
<span class="text-green font-bold">
<?php echo $title; ?>
Expand Down
55 changes: 0 additions & 55 deletions src/Console/views/vendor.php

This file was deleted.

4 changes: 2 additions & 2 deletions src/DependencyInjection/ContainerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function create(): Container
$application->add($vendorCommand);

// remove basic command to make output clear
$this->defaultDefaultCommands($application);
$this->cleanupDefaultCommands($application);

return $application;
});
Expand All @@ -52,7 +52,7 @@ public function create(): Container
return $container;
}

public function defaultDefaultCommands(Application $application): void
public function cleanupDefaultCommands(Application $application): void
{
PrivatesAccessor::propertyClosure($application, 'commands', static function (array $commands): array {
// remove default commands, as not needed here
Expand Down