Skip to content
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"require-dev": {
"cakephp/cakephp-codesniffer": "^5.0.0",
"cakephp/debug_kit": "^5.0.0",
"phpunit/phpunit": "^10.5.5 || ^11.1.3"
"phpunit/phpunit": "^10.5.40 || ^11.5.20 || ^12.2.4"
},
"autoload": {
"psr-4": {
Expand Down
6 changes: 3 additions & 3 deletions src/Command/AllCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,16 @@
}

$message = sprintf('Error generating %s for %s: %s', $commandName, $table, $e->getMessage());
$io->err('<error>' . $message . '</error>');
$io->error($message);

Check warning on line 127 in src/Command/AllCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Command/AllCommand.php#L127

Added line #L127 was not covered by tests
$errors++;
}
}
}

if ($errors) {
$io->out(sprintf('<warning>Bake All completed, but with %s errors.</warning>', $errors), 1, ConsoleIo::NORMAL);
$io->warning(sprintf('Bake All completed, but with %s errors.', $errors));

Check warning on line 134 in src/Command/AllCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Command/AllCommand.php#L134

Added line #L134 was not covered by tests
} else {
$io->out('<success>Bake All complete.</success>', 1, ConsoleIo::NORMAL);
$io->success('Bake All complete.');
}

return $errors ? static::CODE_ERROR : static::CODE_SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion src/Command/BakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
{
if (file_exists($path)) {
unlink($path);
$io->out(sprintf('<success>Deleted</success> `%s`', $path), 1, ConsoleIo::NORMAL);
$io->out(sprintf('<success>Deleted</success> `%s`', $path));

Check warning on line 183 in src/Command/BakeCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Command/BakeCommand.php#L183

Added line #L183 was not covered by tests
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/Command/EntryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
$parser->argumentNames(),
);
} catch (ConsoleException $e) {
$io->err('Error: ' . $e->getMessage());
$io->error('Error: ' . $e->getMessage());

Check warning on line 85 in src/Command/EntryCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Command/EntryCommand.php#L85

Added line #L85 was not covered by tests

return static::CODE_ERROR;
}
Expand All @@ -109,14 +109,14 @@
{
if ($args->hasArgumentAt(0)) {
$name = $args->getArgumentAt(0);
$io->err(
"<error>Could not find bake command named `$name`."
. ' Run `bake --help` to get a list of commands.</error>',
$io->error(
"Could not find bake command named `$name`."
. ' Run `bake --help` to get a list of commands.',
);

return static::CODE_ERROR;
}
$io->err('<warning>No command provided. Run `bake --help` to get a list of commands.</warning>');
$io->warning('No command provided. Run `bake --help` to get a list of commands.');

Check warning on line 119 in src/Command/EntryCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Command/EntryCommand.php#L119

Added line #L119 was not covered by tests

return static::CODE_ERROR;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/FixtureCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public function generateFixtureFile(Arguments $args, ConsoleIo $io, string $mode
->set($vars)
->generate('Bake.tests/fixture');

$io->out("\n" . sprintf('Baking test fixture for %s...', $model), 1, ConsoleIo::NORMAL);
$io->out("\n" . sprintf('Baking test fixture for %s...', $model));
$io->createFile($path . $filename, $contents, $this->force);
$emptyFile = $path . '.gitkeep';
$this->deleteEmptyFile($emptyFile, $io);
Expand Down
4 changes: 2 additions & 2 deletions src/Command/ModelCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ public function bakeEntity(Table $model, array $data, Arguments $args, ConsoleIo
}

$name = $this->_entityName($model->getAlias());
$io->out("\n" . sprintf('Baking entity class for %s...', $name), 1, ConsoleIo::NORMAL);
$io->out("\n" . sprintf('Baking entity class for %s...', $name));

$namespace = Configure::read('App.namespace');
$pluginPath = '';
Expand Down Expand Up @@ -1198,7 +1198,7 @@ public function bakeTable(Table $model, array $data, Arguments $args, ConsoleIo
}

$name = $model->getAlias();
$io->out("\n" . sprintf('Baking table class for %s...', $name), 1, ConsoleIo::NORMAL);
$io->out("\n" . sprintf('Baking table class for %s...', $name));

$namespace = Configure::read('App.namespace');
$pluginPath = '';
Expand Down
6 changes: 3 additions & 3 deletions src/Command/PluginCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
{
$name = $args->getArgument('name');
if (empty($name)) {
$io->err('<error>You must provide a plugin name in CamelCase format.</error>');
$io->err('To make an "MyExample" plugin, run <info>`cake bake plugin MyExample`</info>.');
$io->error('You must provide a plugin name in CamelCase format.');
$io->out('To make an "MyExample" plugin, run <info>`cake bake plugin MyExample`</info>.');

return static::CODE_ERROR;
}
Expand All @@ -70,7 +70,7 @@
$this->isVendor = true;

if (!is_dir($this->path)) {
$io->err(sprintf('Path `%s` does not exist.', $this->path));
$io->error(sprintf('Path `%s` does not exist.', $this->path));

Check warning on line 73 in src/Command/PluginCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Command/PluginCommand.php#L73

Added line #L73 was not covered by tests

return static::CODE_ERROR;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/SimpleBakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
$this->extractCommonProperties($args);
$name = $args->getArgumentAt(0);
if (empty($name)) {
$io->err('You must provide a name to bake a ' . $this->name());
$io->error('You must provide a name to bake a ' . $this->name());

Check warning on line 81 in src/Command/SimpleBakeCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Command/SimpleBakeCommand.php#L81

Added line #L81 was not covered by tests
$this->abort();
}
$name = $this->_getName($name);
Expand Down
4 changes: 2 additions & 2 deletions src/Command/TemplateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,14 @@
}
if (empty($content)) {
// phpcs:ignore Generic.Files.LineLength
$io->err("<warning>No generated content for '{$template}.{$this->ext}', not generating template.</warning>");
$io->warning("No generated content for '{$template}.{$this->ext}', not generating template.");

Check warning on line 363 in src/Command/TemplateCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Command/TemplateCommand.php#L363

Added line #L363 was not covered by tests

return;
}
$path = $this->getTemplatePath($args);
$filename = $path . Inflector::underscore($outputFile) . '.' . $this->ext;

$io->out("\n" . sprintf('Baking `%s` view template file...', $outputFile), 1, ConsoleIo::NORMAL);
$io->out("\n" . sprintf('Baking `%s` view template file...', $outputFile));
$io->createFile($filename, $content, $this->force);
}

Expand Down
8 changes: 4 additions & 4 deletions src/Command/TestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
$name = $this->_getName($name);

if ($this->bake($type, $name, $args, $io)) {
$io->out('<success>Done</success>');
$io->success('Done');
}

return static::CODE_SUCCESS;
Expand Down Expand Up @@ -188,13 +188,13 @@

foreach ($classes as $class) {
if ($this->bake($type, $class, $args, $io)) {
$io->out('<success>Done - ' . $class . '</success>');
$io->success('Done - ' . $class);
} else {
$io->out('<error>Failed - ' . $class . '</error>');
$io->error('Failed - ' . $class);

Check warning on line 193 in src/Command/TestCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Command/TestCommand.php#L193

Added line #L193 was not covered by tests
}
}

$io->out('<info>Bake finished</info>');
$io->info('Bake finished');
}

/**
Expand Down
Loading