• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

valksor / php-dev-build / 19384258487

15 Nov 2025 04:07AM UTC coverage: 19.747% (+2.5%) from 17.283%
19384258487

push

github

k0d3r1s
prettier

16 of 30 new or added lines in 4 files covered. (53.33%)

516 existing lines in 7 files now uncovered.

484 of 2451 relevant lines covered (19.75%)

1.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/Command/BinaryInstallCommand.php
1
<?php declare(strict_types = 1);
2

3
/*
4
 * This file is part of the Valksor package.
5
 *
6
 * (c) Davis Zalitis (k0d3r1s)
7
 * (c) SIA Valksor <packages@valksor.com>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12

13
namespace ValksorDev\Build\Command;
14

15
use Exception;
16
use Symfony\Component\Console\Attribute\AsCommand;
17
use Symfony\Component\Console\Command\Command;
18
use Symfony\Component\Console\Input\InputInterface;
19
use Symfony\Component\Console\Output\OutputInterface;
20
use Symfony\Component\Console\Style\SymfonyStyle;
21
use Symfony\Component\DependencyInjection\Attribute\Autowire;
22
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
23
use ValksorDev\Build\Binary\BinaryRegistry;
24
use ValksorDev\Build\Provider\ProviderRegistry;
25

26
use function count;
27
use function sprintf;
28

29
#[AsCommand(name: 'valksor:binaries:install', description: 'Install all required binaries.')]
30
final class BinaryInstallCommand extends AbstractCommand
31
{
32
    public function __construct(
33
        ParameterBagInterface $parameterParameterBag,
34
        private readonly BinaryRegistry $binaryRegistry,
35
        #[Autowire(
36
            param: 'valksor.build.services',
37
        )]
38
        private readonly array $servicesConfig,
39
        ProviderRegistry $providerRegistry,
40
    ) {
41
        parent::__construct($parameterParameterBag, $providerRegistry);
×
42
    }
43

44
    public function __invoke(
45
        InputInterface $input,
46
        OutputInterface $output,
47
    ): int {
48
        $io = new SymfonyStyle($input, $output);
×
49

50
        $io->title('Installing Required Binaries');
×
51

52
        // Get required binaries from services configuration
53
        $binaryService = $this->servicesConfig['binaries'] ?? [];
×
54
        $requiredBinaries = $binaryService['options']['required'] ?? ['tailwindcss', 'esbuild', 'daisyui', 'lucide'];
×
55

56
        if (empty($requiredBinaries)) {
×
57
            $io->warning('No binaries required in configuration.');
×
58

59
            return Command::SUCCESS;
×
60
        }
61

62
        $projectRoot = $this->parameterBag->get('kernel.project_dir');
×
63
        $varDir = $projectRoot . '/var';
×
64

65
        $successCount = 0;
×
66
        $totalCount = count($requiredBinaries);
×
67

68
        foreach ($requiredBinaries as $binary) {
×
69
            $io->section(sprintf('Installing %s', $binary));
×
70

71
            if (!$this->binaryRegistry->has($binary)) {
×
72
                $io->warning(sprintf('Binary %s not found in registry, skipping...', $binary));
×
73

74
                continue;
×
75
            }
76

77
            try {
NEW
78
                $tag = $this->binaryRegistry->get($binary)->createManager($varDir, $binary)->ensureLatest([$io, 'text']);
×
79
                $io->success(sprintf('✓ %s installed (%s)', $binary, $tag));
×
80
                $successCount++;
×
81
            } catch (Exception $e) {
×
82
                $io->error(sprintf('Failed to install %s: %s', $binary, $e->getMessage()));
×
83
            }
84
        }
85

86
        $io->newLine();
×
87

88
        if ($successCount === $totalCount) {
×
89
            $io->success(sprintf('All %d binaries installed successfully!', $totalCount));
×
90

91
            return Command::SUCCESS;
×
92
        }
93
        $io->warning(sprintf('%d/%d binaries installed successfully.', $successCount, $totalCount));
×
94

95
        return Command::FAILURE;
×
96
    }
97
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc