Skip to content

Commit

Permalink
chore: coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Oct 10, 2023
1 parent 9fe5548 commit ff777e2
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Components/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ abstract class Element
final public function __construct(
protected OutputInterface $output,
protected array|string $content,
Styles|null $styles = null
Styles $styles = null
) {
$this->styles = $styles ?? new Styles(defaultStyles: static::$defaultStyles);
$this->styles->setElement($this);
Expand Down
2 changes: 1 addition & 1 deletion src/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* Sets the renderer implementation.
*/
function renderUsing(OutputInterface|null $renderer): void
function renderUsing(?OutputInterface $renderer): void
{
Termwind::renderUsing($renderer);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Html/CodeRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ private function lineNumbers(array $lines, int $markLine): string
foreach ($lines as $i => $line) {
$coloredLineNumber = $this->coloredLineNumber(self::LINE_NUMBER, $i, $lineLength);

if (0 !== $markLine) {
if ($markLine !== 0) {
$snippet .= ($markLine === $i + 1
? $this->styleToken(self::ACTUAL_LINE_MARK, $mark)
: self::NO_MARK
Expand Down
4 changes: 2 additions & 2 deletions src/Question.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class Question
/**
* The streamable input to receive the input from the user.
*/
private static StreamableInputInterface|null $streamableInput;
private static ?StreamableInputInterface $streamableInput;

/**
* An instance of Symfony's question helper.
Expand All @@ -35,7 +35,7 @@ public function __construct(SymfonyQuestionHelper $helper = null)
/**
* Sets the streamable input implementation.
*/
public static function setStreamableInput(StreamableInputInterface|null $streamableInput): void
public static function setStreamableInput(?StreamableInputInterface $streamableInput): void
{
self::$streamableInput = $streamableInput ?? new ArgvInput();
}
Expand Down
6 changes: 3 additions & 3 deletions src/Termwind.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ final class Termwind
/**
* The implementation of the output.
*/
private static OutputInterface|null $renderer;
private static ?OutputInterface $renderer;

/**
* Sets the renderer implementation.
*/
public static function renderUsing(OutputInterface|null $renderer): void
public static function renderUsing(?OutputInterface $renderer): void
{
self::$renderer = $renderer ?? new ConsoleOutput();
}
Expand Down Expand Up @@ -287,7 +287,7 @@ public static function getRenderer(): OutputInterface
* @param array<int, string|Element>|string $elements
* @return array<int, string|Element>
*/
private static function prepareElements($elements, string $styles = '', Closure|null $callback = null): array
private static function prepareElements($elements, string $styles = '', Closure $callback = null): array
{
if ($callback === null) {
$callback = static fn ($element): string|Element => $element;
Expand Down
4 changes: 2 additions & 2 deletions src/ValueObjects/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function isEmpty(): bool
/**
* Gets the previous sibling from the node.
*/
public function getPreviousSibling(): static|null
public function getPreviousSibling(): ?static
{
$node = $this->node;

Expand All @@ -127,7 +127,7 @@ public function getPreviousSibling(): static|null
/**
* Gets the next sibling from the node.
*/
public function getNextSibling(): static|null
public function getNextSibling(): ?static
{
$node = $this->node;

Expand Down

0 comments on commit ff777e2

Please sign in to comment.