Skip to content

Commit

Permalink
release: 1.0.1 (#18)
Browse files Browse the repository at this point in the history
### Changed

- Binds the `middleware.sources` in container instead of add a new configuration definition.
- Updates `env` configuration definition to specify `testing` as a valid value.

### Fixed

- Makes the `app:config:list` command to show the correct required values.
  • Loading branch information
Luc-cpl authored May 11, 2024
1 parent c7a0b60 commit 67e59c8
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/allow-target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
types:
- synchronize
- opened
- edited
jobs:
check:
runs-on: ubuntu-latest
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.1] - 2024-05-11

### Changed

- Binds the `middleware.sources` in container instead of add a new configuration definition.
- Updates `env` configuration definition to specify `testing` as a valid value.

### Fixed

- Makes the `app:config:list` command to show the correct required values.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Orchestration for PHP applications",
"type": "project",
"license": "MIT",
"version": "v1.0.0",
"version": "v1.0.1",
"keywords": [
"orkestra"
],
Expand Down
2 changes: 1 addition & 1 deletion src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private function setDefaultConfig(): void
]);

$this->config->set('definition', [
'env' => ['The environment the app is running in (development, production)', 'development'],
'env' => ['The environment the app is running in (development, production or testing)', 'development'],
'root' => ['The root directory of the app', getcwd()],
'slug' => ['The app slug', 'app'],
]);
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/ConfigOptionsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$definition = $this->config->get('definition');

$definition = array_map(function ($value, $key) {
return [$key, isset($value[1]) ? 'Yes' : 'No', $value[0]];
return [$key, isset($value[1]) ? 'No' : 'Yes', $value[0]];
}, $definition, array_keys($definition));

// Create a table to display the configuration options, with key, required, and description columns
Expand Down
7 changes: 1 addition & 6 deletions src/Providers/HttpProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,7 @@ public function boot(App $app): void
}
}

$app->config()->set('definition', [
'middleware_sources' => [
'Middleware stack sources',
$middlewareSources,
],
]);
$app->bind('middleware.sources', fn () => $middlewareSources);

$app->config()->set('middleware', $middlewareStack);

Expand Down
6 changes: 4 additions & 2 deletions src/Services/Http/Commands/MiddlewareListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Orkestra\Services\Http\Commands;

use Orkestra\Interfaces\ConfigurationInterface;
use Psr\Container\ContainerInterface;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\Table;
Expand All @@ -13,7 +14,8 @@
class MiddlewareListCommand extends Command
{
public function __construct(
private ConfigurationInterface $config
private ConfigurationInterface $config,
private ContainerInterface $container,
) {
parent::__construct();
}
Expand All @@ -33,7 +35,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
/** @var array<string, string> */
$middlewareStack = $this->config->get('middleware');
/** @var array<string, string> */
$middlewareSources = $this->config->get('middleware_sources');
$middlewareSources = $this->container->get('middleware.sources');

$definition = array_map(function ($middleware, $alias) use ($middlewareSources) {
return [$alias, $middleware, $middlewareSources[$alias] ?? ''];
Expand Down

0 comments on commit 67e59c8

Please sign in to comment.