Skip to content

Commit d85bd05

Browse files
committed
fix: simplify conditionals in various builders
1 parent 89a2a86 commit d85bd05

4 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/Console/Command/System/CheckCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ private function getLatestLtsNodeVersion(): string
164164

165165
/** @var array<int, array<string, mixed>> $nodes */
166166
foreach ($nodes as $node) {
167-
if (
168-
isset($node['lts'])
167+
if (isset($node['lts'])
169168
&& $node['lts'] !== false
170169
&& isset($node['version'])
171170
&& is_string($node['version'])

src/Service/Hyva/ModuleScanner.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ private function isHyvaCompatibilityPackage(array $composerData): bool
121121
{
122122
// Check if this IS a Hyvä compatibility package
123123
$packageName = $composerData['name'] ?? '';
124-
if (
125-
is_string($packageName)
124+
if (is_string($packageName)
126125
&& str_starts_with($packageName, 'hyva-themes/')
127126
&& str_contains($packageName, '-compat')
128127
) {

src/Service/ThemeBuilder/HyvaThemes/Builder.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ public function detect(string $themePath): bool
6868
if ($this->fileDriver->isExists($themePath . '/composer.json')) {
6969
$composerContent = $this->fileDriver->fileGetContents($themePath . '/composer.json');
7070
$composerJson = json_decode($composerContent, true);
71-
if (
72-
is_array($composerJson)
71+
if (is_array($composerJson)
7372
&& isset($composerJson['name'])
7473
&& is_string($composerJson['name'])
7574
&& str_contains($composerJson['name'], 'hyva')

src/Service/ThemeBuilder/TailwindCSS/Builder.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ public function detect(string $themePath): bool
6868
if ($this->fileDriver->isExists($themePath . '/composer.json')) {
6969
$composerContent = $this->fileDriver->fileGetContents($themePath . '/composer.json');
7070
$composerJson = json_decode($composerContent, true);
71-
if (
72-
\is_array($composerJson)
71+
if (\is_array($composerJson)
7372
&& isset($composerJson['name'])
7473
&& \is_string($composerJson['name'])
7574
&& !str_contains($composerJson['name'], 'hyva')

0 commit comments

Comments
 (0)