Skip to content

Commit 18f1ce6

Browse files
authored
Merge pull request #4 from yawik/composer_symfony_incompatibilityy
fix: Do not use symfony/console output styling
2 parents f3477ef + 6a0e110 commit 18f1ce6

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/AssetsInstaller.php

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
use Core\Application;
1414
use Symfony\Component\Filesystem\Filesystem;
15-
use Symfony\Component\Console\Style\SymfonyStyle;
1615
use Symfony\Component\Finder\Finder;
1716
use Yawik\Composer\Event\ConfigureEvent;
1817

@@ -108,13 +107,13 @@ public function install($modules, $expectedMethod = null)
108107
}
109108

110109
if ($method === $expectedMethod) {
111-
$rows[] = array(sprintf('<fg=green;options=bold>%s</>', '\\' === DIRECTORY_SEPARATOR ? 'OK' : "\xE2\x9C\x94" /* HEAVY CHECK MARK (U+2714) */), $message, $method);
110+
$rows[] = array('\\' === DIRECTORY_SEPARATOR ? 'OK' : "\xE2\x9C\x94" /* HEAVY CHECK MARK (U+2714) */, $message, $method);
112111
} else {
113-
$rows[] = array(sprintf('<fg=yellow;options=bold>%s</>', '\\' === DIRECTORY_SEPARATOR ? 'WARNING' : '!'), $message, $method);
112+
$rows[] = array('\\' === DIRECTORY_SEPARATOR ? 'WARNING' : '!', $message, $method);
114113
}
115114
} catch (\Exception $e) {
116115
$exitCode = 1;
117-
$rows[] = array(sprintf('<fg=red;options=bold>%s</>', '\\' === DIRECTORY_SEPARATOR ? 'ERROR' : "\xE2\x9C\x98" /* HEAVY BALLOT X (U+2718) */), $message, $e->getMessage());
116+
$rows[] = array('\\' === DIRECTORY_SEPARATOR ? 'ERROR' : "\xE2\x9C\x98" /* HEAVY BALLOT X (U+2718) */, $message, $e->getMessage());
118117
}
119118
}
120119

@@ -161,23 +160,30 @@ public function getRootDir()
161160

162161
public function renderInstallOutput($copyUsed, $rows, $exitCode)
163162
{
164-
$io = new SymfonyStyle($this->getInput(), $this->getOutput());
165-
$io->newLine();
163+
$io = $this->getOutput();
164+
$io->writeln('');
166165

167-
$io->section('Yawik Assets Installed!');
166+
$io->writeln('Yawik Assets Installed!');
167+
$io->writeln('-----------------------');
168168

169169
if ($rows) {
170-
$io->table(array('', 'Module', 'Method / Error'), $rows);
170+
foreach ($rows as [$check, $name, $method]) {
171+
$io->writeln("$name $check ($method)");
172+
}
171173
}
172174

175+
$io->writeln('-----------------------');
176+
177+
173178
if (0 !== $exitCode) {
174-
$io->error('Some errors occurred while installing assets.');
179+
$io->writeln('Some errors occurred while installing assets.');
175180
} else {
176181
if ($copyUsed) {
177-
$io->note('Some assets were installed via copy. If you make changes to these assets you have to run this command again.');
182+
$io->writeln('Some assets were installed via copy. If you make changes to these assets you have to run this command again.');
178183
}
179-
$io->success($rows ? 'All assets were successfully installed.' : 'No assets were provided by any bundle.');
184+
$io->writeln($rows ? 'All assets were successfully installed.' : 'No assets were provided by any bundle.');
180185
}
186+
$io->writeln('');
181187
}
182188

183189
/**

0 commit comments

Comments
 (0)