Skip to content

Commit

Permalink
Merge pull request #53 from lion-packages/new
Browse files Browse the repository at this point in the history
Updated dependencies and new features
  • Loading branch information
Sleon4 authored Apr 11, 2024
2 parents 988d767 + 3b7fd96 commit 00b63a4
Show file tree
Hide file tree
Showing 62 changed files with 453 additions and 253 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
"lion/command": "^3.1",
"lion/database": "^9.0",
"lion/files": "^6.0",
"lion/helpers": "^3.0",
"lion/helpers": "^3.2",
"lion/mailer": "^6.0",
"lion/request": "^6.0",
"lion/route": "^10.3",
"lion/security": "^9.0",
"lion/security": "^9.1",
"monolog/monolog": "^3.3",
"nesbot/carbon": "^2.66",
"predis/predis": "^2.2",
Expand Down
55 changes: 27 additions & 28 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

use Lion\Bundle\Helpers\ExceptionCore;
use Lion\Bundle\HttpKernel;
use Lion\DependencyInjection\Container;
use Lion\Dependency\Injection\Container;

(new ExceptionCore)->exceptionHandler();

Expand Down
8 changes: 4 additions & 4 deletions src/LionBundle/Commands/CommandHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Lion\Command\Command;
use Lion\Command\Kernel;
use Lion\DependencyInjection\Container;
use Lion\Dependency\Injection\Container;
use Lion\Files\Store;
use Symfony\Component\Console\Application;

Expand All @@ -22,14 +22,14 @@
class CommandHandler
{
/**
* [Application class object]
* [An Application is the container for a collection of commands]
*
* @var Application $application
*/
private Application $application;

/**
* [Container class object]
* [Container to generate dependency injection]
*
* @var Container $container
*/
Expand Down Expand Up @@ -86,7 +86,7 @@ private function getCommands(string $pathCommands, string $namespace, string $pa

foreach ($this->container->getFiles($pathCommands) as $file) {
if (isSuccess($this->store->validate([$file], ['php']))) {
$class = $this->container->getNamespace($file, $namespace, $this->container->normalizePath($pathSplit));
$class = $this->container->getNamespace($file, $namespace, $pathSplit);
$commands[] = $this->container->injectDependencies(new $class());
}
}
Expand Down
12 changes: 4 additions & 8 deletions src/LionBundle/Commands/Lion/DB/DBSeedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Lion\Bundle\Interface\SeedInterface;
use Lion\Command\Command;
use Lion\DependencyInjection\Container;
use Lion\Dependency\Injection\Container;
use Lion\Files\Store;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand Down Expand Up @@ -101,13 +101,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
/** @var array<SeedInterface> $files */
$files = [];

foreach ($this->container->getFiles($this->container->normalizePath('./database/Seed/')) as $seed) {
foreach ($this->container->getFiles('./database/Seed/') as $seed) {
if (isSuccess($this->store->validate([$seed], ['php']))) {
$class = $this->container->getNamespace(
$seed,
'Database\\Seed\\',
$this->container->normalizePath('Seed/')
);
$class = $this->container->getNamespace($seed, 'Database\\Seed\\', 'Seed/');

/** @var SeedInterface $seedInterface */
$seedInterface = new $class();
Expand Down Expand Up @@ -144,7 +140,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
*/
private function orderList(array $files): array
{
uasort($files, function($classA, $classB) {
uasort($files, function ($classA, $classB) {
$namespaceA = $classA::class;
$namespaceB = $classB::class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Lion\Bundle\Interface\MigrationUpInterface;
use Lion\Command\Command;
use Lion\Database\Drivers\Schema\MySQL as Schema;
use Lion\DependencyInjection\Container;
use Lion\Dependency\Injection\Container;
use Lion\Files\Store;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -183,7 +183,7 @@ private function dropTables(OutputInterface $output): void
*/
private function orderList(array $files): array
{
uasort($files, function($classA, $classB) {
uasort($files, function ($classA, $classB) {
$namespaceA = $classA::class;

$namespaceB = $classB::class;
Expand Down
4 changes: 2 additions & 2 deletions src/LionBundle/Commands/Lion/New/AESCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$input,
$output,
new ChoiceQuestion(
('Select project ' . $this->warningOutput('(default: ' . reset($aesMethods) . ')')),
('Select AES method ' . $this->warningOutput('(default: ' . reset($aesMethods) . ')')),
$aesMethods,
0
)
);

$config = $this->aes->create($aesMethod)->toObject()->get();

$output->writeln($this->errorOutput("\t>> AES METHOD: {$aesMethod}"));
$output->writeln($this->infoOutput("\t>> AES METHOD: {$aesMethod}"));
$output->writeln($this->warningOutput("\t>> AES KEY: {$config->key}"));
$output->writeln($this->warningOutput("\t>> AES IV: {$config->iv}"));
$output->writeln($this->successOutput("\t>> Keys created successfully"));
Expand Down
Loading

0 comments on commit 00b63a4

Please sign in to comment.