OpenAPI (Swagger) Specification Support for Sunrise Router (and not only)

Overview

OpenAPI (Swagger) Specification Support for Sunrise Router

Build Status Code Coverage Scrutinizer Code Quality Total Downloads Latest Stable Version License


Important to understanding

Installation

composer require 'sunrise/http-router-openapi:^2.1'

QuickStart

use Psr\SimpleCache\CacheInterface;
use Sunrise\Http\Router\OpenApi\Object\Info;
use Sunrise\Http\Router\OpenApi\OpenApi;
use Sunrise\Http\Router\OpenApi\RouteInterface;

$openapi = new OpenApi(new Info('Acme', '1.0.0'));

// Passing PSR-16 cache to the openapi object:
/** @var CacheInterface $cache */
$openapi->setCache($cache);

// Passing all routes to the openapi object:
/** @var RouteInterface[] $routes */
$openapi->addRoute(...$routes);

// When using Sunrise Router:
/** @var \Sunrise\Http\Router\Router $router */
$openapi->addRoute(...$router->getRoutes());

Building OpenAPI Document

// Converting the openapi object to JSON document:
$openapi->toJson();
// Converting the openapi object to YAML document:
$openapi->toYaml();
// Converting the openapi object to an array:
$openapi->toArray();

Building JSON Schemas

Converts an operation part to JSON Schema.

$openapi->getRequestCookieJsonSchema();
$openapi->getRequestHeaderJsonSchema();
$openapi->getRequestQueryJsonSchema();
$openapi->getRequestBodyJsonSchema();
$openapi->getResponseBodyJsonSchema();

PSR-15 Middlewares

RequestValidationMiddleware

Validates a request using a route description.

use Sunrise\Http\Router\OpenApi\Middleware\RequestValidationMiddleware;
use Sunrise\Http\Router\OpenApi\OpenApi;

/** @var OpenApi $openapi */
$middleware = new RequestValidationMiddleware($openapi);

Symfony Commands

GenerateOpenapiDocumentCommand

Generates OpenAPI document.

use Sunrise\Http\Router\OpenApi\Command\GenerateOpenapiDocumentCommand;
use Sunrise\Http\Router\OpenApi\OpenApi;

/** @var OpenApi $openapi */
$command = new GenerateOpenapiDocumentCommand($openapi);
php bin/app router:generate-openapi-document --help

GenerateJsonSchemaCommand

Generates an operation part to JSON Schema.

use Sunrise\Http\Router\OpenApi\Command\GenerateJsonSchemaCommand;
use Sunrise\Http\Router\OpenApi\OpenApi;

/** @var OpenApi $openapi */
$command = new GenerateJsonSchemaCommand($openapi);
php bin/app router:generate-json-schema --help

Test Kit

assertResponseBodyMatchesDescription

The assertion fails if the given response body doesn't match a description of the operation identified by the given ID.

use PHPUnit\Framework\TestCase;
use Psr\Http\Message\ResponseInterface;
use Sunrise\Http\Router\OpenApi\Test\OpenapiTestKit;

class SomeTest extends TestCase
{
    use OpenapiTestKit;

    public function testResponseBodyMatchesDescription() : void
    {
        // some logic to run a route...

        /** @var ResponseInterface $response */
        $this->assertResponseBodyMatchesDescription('route.name', $response);
    }
}

Simple Route Description

class SomeController
{

    /**
     * @OpenApi\Operation(
     *   requestBody=@OpenApi\RequestBody(
     *     content={
     *       "application/json": @OpenApi\MediaType(
     *         schema=@OpenApi\Schema(
     *           type="object",
     *           properties={
     *             "foo": @OpenApi\Schema(
     *               type="string",
     *             ),
     *           },
     *         ),
     *       ),
     *     },
     *   ),
     *   responses={
     *     200: @OpenApi\Response(
     *       description="Ok",
     *     ),
     *   },
     * )
     */
    public function someAction()
    {
    }
}

Look for more examples here: Some App

Comments
  • Create middleware that will convert a request parsed body to DTO

    Create middleware that will convert a request parsed body to DTO

    The idea is as follows: if requestBody refers to a class, then such a class is considered a DTO, therefore we can work not with an array, but with a valid object.

    /**
     * @OpenApi\Operation(
     *   requestBody=@OpenApi\RequestBodyReference("\App\Dto\AdminAuthRequest"),
     *   responses={
     *     200: @OpenApi\Response(
     *       description="OK",
     *     ),
     *   },
     * )
     */
    #[Routing\Route('admin.signIn', path: '/admin/v1/sign-in', method: 'POST')]
    #[Routing\Middleware(RequestBodyMappingMiddleware::class)] // something like that...
    public function signIn(ServerRequestInterface $request) : ResponseInterface
    {
        /** @var \App\Dto\AdminAuthRequest */
        $authRequest = $request->getParsedBody();
    
        // tries to auth an admin by the request...
        $admin = $this->adminService->authByRequest($authRequest);
    
        // some code...
    }
    

    Hydration should based on the following package:

    • https://github.com/sunrise-php/hydrator
    !dea 
    opened by fenric 1
  • Update dependency phpunit/phpunit to v8

    Update dependency phpunit/phpunit to v8

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | phpunit/phpunit (source) | require-dev | major | 7.5.18 -> 8.5.2 |


    Release Notes

    sebastianbergmann/phpunit

    v8.5.2

    Compare Source

    v8.5.1

    Compare Source

    v8.5.0

    Compare Source

    v8.4.3

    Compare Source

    v8.4.2

    Compare Source

    v8.4.1

    Compare Source

    v8.4.0

    Compare Source

    v8.3.5

    Compare Source

    v8.3.4

    Compare Source

    v8.3.3

    Compare Source

    v8.3.2

    Compare Source

    v8.3.1

    Compare Source

    v8.3.0

    Compare Source

    v8.2.5

    Compare Source

    v8.2.4

    Compare Source

    v8.2.3

    Compare Source

    v8.2.2

    Compare Source

    v8.2.1

    Compare Source

    v8.2.0

    Compare Source

    v8.1.6

    Compare Source

    v8.1.5

    Compare Source

    v8.1.4

    Compare Source

    v8.1.3

    Compare Source

    v8.1.2

    Compare Source

    v8.1.1

    Compare Source

    v8.1.0

    Compare Source

    v8.0.6

    Compare Source

    v8.0.5

    Compare Source

    v8.0.4

    Compare Source

    v8.0.3

    Compare Source

    v8.0.2

    Compare Source

    v8.0.1

    Compare Source

    v8.0.0

    Compare Source

    v7.5.20

    Compare Source

    v7.5.19

    Compare Source


    Renovate configuration

    :date: Schedule: At any time (no schedule defined).

    :vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.

    :recycle: Rebasing: Whenever PR becomes conflicted, or if you modify the PR title to begin with "rebase!".

    :no_bell: Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    Newsflash: Renovate has joined WhiteSource, and is now free for all use. Learn more or view updated terms and privacy policies.

    opened by renovate[bot] 1
  • v2.2.0

    v2.2.0

    • New annotations to shorten the code.
    @OpenApi\SchemaArray(@OpenApi\SchemaReference("App\Entity\Company"))
    
    @OpenApi\SchemaObject({
      "company": @OpenApi\SchemaReference("App\Entity\Company")
    })
    
    opened by fenric 0
  • Action Required: Fix Renovate Configuration

    Action Required: Fix Renovate Configuration

    There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

    Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)

    opened by renovate[bot] 0
  • Pin dependency symfony/console to v4.4.45 - autoclosed

    Pin dependency symfony/console to v4.4.45 - autoclosed

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | symfony/console (source) | require-dev | pin | ^4.4 -> 4.4.45 |

    Add the preset :preserveSemverRanges to your config if you don't want to pin your dependencies.


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • v2.0.0

    v2.0.0

    • CLI commands for generating OpenAPI document and JSON schemas;
    • One middleware for validating requests;
    • Test Kit for unit tests;
    • Build and operations cache;
    • Support for YAML format;
    • Support for class methods operations;
    • Improved code quality and performance.
    opened by fenric 0
  • Update dependency doctrine/cache to v2 - autoclosed

    Update dependency doctrine/cache to v2 - autoclosed

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | doctrine/cache (source) | require | major | ^1.6 -> ^2.0 |


    Release Notes

    doctrine/cache

    v2.0.3

    Compare Source

    Release Notes for 2.0.3

    2.0.x bugfix release (patch)

    2.0.3

    v2.0.2

    Compare Source

    Release Notes for 2.0.2

    2.0.x bugfix release (patch)

    2.0.2

    v2.0.1

    Compare Source

    Release Notes for 2.0.1

    2.0.x bugfix release (patch)

    2.0.1

    v2.0.0

    Compare Source

    Release Notes for 2.0.0

    Backwards incompatible release (major)

    2.0.0
    • Total issues resolved: 0
    • Total pull requests resolved: 1
    • Total contributors: 1
    Improvement

    Configuration

    πŸ“… Schedule: At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update circleci/php Docker tag to v7.4 - autoclosed

    Update circleci/php Docker tag to v7.4 - autoclosed

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | circleci/php | docker | minor | 7.3-cli-node-browsers -> 7.4-cli-node-browsers | | circleci/php | docker | minor | 7.2-cli-node-browsers -> 7.4-cli-node-browsers | | circleci/php | docker | minor | 7.1-cli-node-browsers -> 7.4-cli-node-browsers |


    Configuration

    :date: Schedule: At any time (no schedule defined).

    :vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.

    :recycle: Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    :no_bell: Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, check this box.

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Pin dependency sunrise/http-router to 2.16.1 - autoclosed

    Pin dependency sunrise/http-router to 2.16.1 - autoclosed

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | sunrise/http-router | require-dev | pin | ^2.11 -> 2.16.1 |

    Add the preset :preserveSemverRanges to your config if you don't want to pin your dependencies.


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency justinrainbow/json-schema to v5.2.10

    Update dependency justinrainbow/json-schema to v5.2.10

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | justinrainbow/json-schema | require-dev | patch | 5.2.9 -> 5.2.10 |


    Release Notes

    justinrainbow/json-schema

    v5.2.10

    Compare Source

    #​631 Backports for 5.2.10: Fixes in build process and PHP 8


    Renovate configuration

    :date: Schedule: At any time (no schedule defined).

    :vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.

    :recycle: Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    :no_bell: Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by WhiteSource Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency sunrise/http-factory to v2

    Update dependency sunrise/http-factory to v2

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | sunrise/http-factory | require-dev | major | 1.1.0 -> 2.0.2 |


    Release Notes

    sunrise-php/http-factory

    v2.0.2

    Compare Source

    • Insignificant changes.

    v2.0.1

    Compare Source

    • Minor changes.

    v2.0.0

    Compare Source

    • Support for the latest sunrise packages.

    v1.1.1

    Compare Source

    • Minor changes.

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency symfony/console to v6

    Update dependency symfony/console to v6

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | symfony/console (source) | require-dev | major | ^4.4 -> ^6.0 |


    Release Notes

    symfony/console

    v6.1.7

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.1.6...v6.1.7)

    • bug #​47907 Update Application.php (aleksandr-shevchenko)
    • bug #​47883 Fix error output on windows cli (Maximilian.Beckers)

    v6.1.6

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.1.5...v6.1.6)

    • bug #​47779 Fix Helper::removeDecoration hyperlink bug (greew)

    v6.1.5

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.1.4...v6.1.5)

    • bug #​47463 Make fish completion run in non interactive mode (Seldaek)
    • bug #​47394 Make bash completion run in non interactive mode (Seldaek)

    v6.1.4

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.1.3...v6.1.4)

    • bug #​47372 Fix OutputFormatterStyleStack::getCurrent return type (alamirault)
    • bug #​47218 fix dispatch signal event check for compatibility with the contract interface (xabbuh)
    • bug #​45333 Fix ConsoleEvents::SIGNAL subscriber dispatch (GwendolenLynch)

    v6.1.3

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.1.2...v6.1.3)

    • bug #​47022 get full command path for command in search path (remicollet)

    v6.1.2

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.1.1...v6.1.2)

    • bug #​46747 Fix global state pollution between tests run with ApplicationTester (Seldaek)

    v6.1.1

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.1.0...v6.1.1)

    • bug #​46608 Fix deprecation when description is null (HypeMC)
    • bug #​46574 Escape % in command name & description from PHP (getDefault* methods) (ogizanagi)

    v6.1.0

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.1.0-RC1...v6.1.0)

    • bug #​46387 Complete negatable options (Fish) (GromNaN)

    v6.0.15

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.0.14...v6.0.15)

    • bug #​47907 Update Application.php (aleksandr-shevchenko)
    • bug #​47883 Fix error output on windows cli (Maximilian.Beckers)

    v6.0.14

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.0.13...v6.0.14)

    • bug #​47779 Fix Helper::removeDecoration hyperlink bug (greew)

    v6.0.13

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.0.12...v6.0.13)

    • bug #​47394 Make bash completion run in non interactive mode (Seldaek)

    v6.0.12

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.0.11...v6.0.12)

    • bug #​47372 Fix OutputFormatterStyleStack::getCurrent return type (alamirault)
    • bug #​47218 fix dispatch signal event check for compatibility with the contract interface (xabbuh)
    • bug #​45333 Fix ConsoleEvents::SIGNAL subscriber dispatch (GwendolenLynch)

    v6.0.11

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.0.10...v6.0.11)

    • bug #​47022 get full command path for command in search path (remicollet)

    v6.0.10

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.0.9...v6.0.10)

    • bug #​46747 Fix global state pollution between tests run with ApplicationTester (Seldaek)
    • bug #​46608 Fix deprecation when description is null (HypeMC)
    • bug #​46595 Escape % in command name & description from getDefaultName() (ogizanagi)
    • bug #​46574 Escape % in command name & description from PHP (getDefault* methods) (ogizanagi)

    v6.0.9

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.0.8...v6.0.9)

    • bug #​46386 Β Fix missing negative variation of negatable options in shell completion (GromNaN)
    • bug #​46114 Fixes "Incorrectly nested style tag found" error when using multi-line header content (Perturbatio)
    • bug #​46341 Fix aliases handling in command name completion (Seldaek)
    • bug #​46291 Suppress unhandled error in some specific use-cases. (rw4lll)
    • bug #​46264 Better required argument check in InputArgument (jnoordsij)

    v6.0.8

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.0.7...v6.0.8)

    • bug #​45565 Fix table header seperator wrapping (alamirault)

    v6.0.7

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.0.6...v6.0.7)

    • bug #​45851 Fix exit status on uncaught exception with negative code (acoulton)
    • bug #​44915 Fix compact table style to avoid outputting a leading space (Seldaek)

    v6.0.5

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.0.4...v6.0.5)

    v6.0.3

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.0.2...v6.0.3)

    • bug #​43149 Silence warnings during tty detection (neclimdul)
    • bug #​45181 Fix PHP 8.1 deprecation in ChoiceQuestion (BrokenSourceCode)
    • bug #​45109 fix restoring stty mode on CTRL+C (nicolas-grekas)
    • bug #​45088 fix parsing escaped chars in StringInput (nicolas-grekas)
    • bug #​45053 use STDOUT/ERR in ConsoleOutput to save opening too many file descriptors (nicolas-grekas)
    • bug #​44912 Allow OutputFormatter::escape() to be used for escaping URLs used in (Seldaek)

    v6.0.2

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.0.1...v6.0.2)

    • bug #​44730 Β Fix autocompletion of argument with default value (GromNaN)

    v6.0.1

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.0.0...v6.0.1)

    • bug #​44523 Fix polyfill-php73 requirement (Seldaek)
    • bug #​44494 Remove FQCN type hints on properties (fabpot)
    • bug #​44475 Handle alias in completion script (GromNaN)
    • bug #​44467 Fix parameter types for ProcessHelper::mustRun() (derrabus)

    v6.0.0

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v6.0.0-RC1...v6.0.0)

    • no significant changes

    v5.4.15

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.4.14...v5.4.15)

    • bug #​47907 Update Application.php (aleksandr-shevchenko)
    • bug #​47883 Fix error output on windows cli (Maximilian.Beckers)

    v5.4.14

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.4.13...v5.4.14)

    • bug #​47779 Fix Helper::removeDecoration hyperlink bug (greew)

    v5.4.13

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.4.12...v5.4.13)

    • bug #​47394 Make bash completion run in non interactive mode (Seldaek)

    v5.4.12

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.4.11...v5.4.12)

    • bug #​47218 fix dispatch signal event check for compatibility with the contract interface (xabbuh)
    • bug #​45333 Fix ConsoleEvents::SIGNAL subscriber dispatch (GwendolenLynch)

    v5.4.11

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.4.10...v5.4.11)

    • bug #​47022 get full command path for command in search path (remicollet)

    v5.4.10

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.4.9...v5.4.10)

    • bug #​46747 Fix global state pollution between tests run with ApplicationTester (Seldaek)
    • bug #​46608 Fix deprecation when description is null (HypeMC)
    • bug #​46595 Escape % in command name & description from getDefaultName() (ogizanagi)
    • bug #​46574 Escape % in command name & description from PHP (getDefault* methods) (ogizanagi)

    v5.4.9

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.4.8...v5.4.9)

    • bug #​46386 Β Fix missing negative variation of negatable options in shell completion (GromNaN)
    • bug #​46114 Fixes "Incorrectly nested style tag found" error when using multi-line header content (Perturbatio)
    • bug #​46341 Fix aliases handling in command name completion (Seldaek)
    • bug #​46291 Suppress unhandled error in some specific use-cases. (rw4lll)
    • bug #​46264 Better required argument check in InputArgument (jnoordsij)

    v5.4.8

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.4.7...v5.4.8)

    • bug #​45565 Fix table header seperator wrapping (alamirault)

    v5.4.7

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.4.6...v5.4.7)

    • bug #​45851 Fix exit status on uncaught exception with negative code (acoulton)
    • bug #​44915 Fix compact table style to avoid outputting a leading space (Seldaek)

    v5.4.5

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.4.4...v5.4.5)

    v5.4.3

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.4.2...v5.4.3)

    • bug #​43149 Silence warnings during tty detection (neclimdul)
    • bug #​45181 Fix PHP 8.1 deprecation in ChoiceQuestion (BrokenSourceCode)
    • bug #​45109 fix restoring stty mode on CTRL+C (nicolas-grekas)
    • bug #​45088 fix parsing escaped chars in StringInput (nicolas-grekas)
    • bug #​45053 use STDOUT/ERR in ConsoleOutput to save opening too many file descriptors (nicolas-grekas)
    • bug #​44912 Allow OutputFormatter::escape() to be used for escaping URLs used in (Seldaek)

    v5.4.2

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.4.1...v5.4.2)

    • bug #​44730 Β Fix autocompletion of argument with default value (GromNaN)

    v5.4.1

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.4.0...v5.4.1)

    • bug #​44523 Fix polyfill-php73 requirement (Seldaek)
    • bug #​44475 Handle alias in completion script (GromNaN)
    • bug #​44467 Fix parameter types for ProcessHelper::mustRun() (derrabus)

    v5.4.0

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.4.0-RC1...v5.4.0)

    • no significant changes

    v5.3.16

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.3.15...v5.3.16)

    v5.3.14

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.3.13...v5.3.14)

    • bug #​43149 Silence warnings during tty detection (neclimdul)
    • bug #​45181 Fix PHP 8.1 deprecation in ChoiceQuestion (BrokenSourceCode)
    • bug #​45109 fix restoring stty mode on CTRL+C (nicolas-grekas)
    • bug #​45088 fix parsing escaped chars in StringInput (nicolas-grekas)
    • bug #​45053 use STDOUT/ERR in ConsoleOutput to save opening too many file descriptors (nicolas-grekas)
    • bug #​44912 Allow OutputFormatter::escape() to be used for escaping URLs used in (Seldaek)

    v5.3.13

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.3.12...v5.3.13)

    • bug #​44467 Fix parameter types for ProcessHelper::mustRun() (derrabus)

    v5.3.11

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.3.10...v5.3.11)

    • bug #​44176 Default ansi option to null (jderusse)
    • bug #​43884 Runtime conflict for psr/log >= 3.0 instead of composer conflict (fancyweb)

    v5.3.10

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.3.9...v5.3.10)

    • no significant changes

    v5.3.7

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.3.6...v5.3.7)

    • bug #​42685 Fix ProgressBar to correctly clear multi-line formats (rtek)
    • bug #​42381 Don't pass null to preg_replace() (derrabus)
    • bug #​42260 Fix return types for PHP 8.1 (derrabus)

    v5.3.6

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.3.5...v5.3.6)

    • no significant changes

    v5.3.4

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.3.3...v5.3.4)

    • bug #​42207 fix table setHeaderTitle without headers (a1812)
    • bug #​42091 Run commands when implements SignalableCommandInterface without pcntl and they have'nt signals (PaolaRuby)
    • bug #​42174 Indicate compatibility with psr/log 2 and 3 (derrabus)
    • bug #​42009 Fix save correct name in setDefaultCommand() for PHP8 (a1812)
    • bug #​41966 Revert "bug #​41952 fix handling positional arguments" (chalasr, nicolas-grekas)
    • bug #​41952 fix handling positional arguments (nicolas-grekas)

    v5.3.2

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.3.1...v5.3.2)

    • bug #​41686 Fix using #[AsCommand] without DI (nicolas-grekas)
    • bug #​41680 fix managing signals when commands are lazy loaded (nicolas-grekas)
    • bug #​41535 Fix negated options not accessible (jderusse)
    • bug #​41386 Escape synopsis output (jschaedl)

    v5.3.0

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.3.0-RC1...v5.3.0)

    • no significant changes

    v5.2.14

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.2.13...v5.2.14)

    • no significant changes

    v5.2.12

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.2.11...v5.2.12)

    • bug #​42207 fix table setHeaderTitle without headers (a1812)
    • bug #​42091 Run commands when implements SignalableCommandInterface without pcntl and they have'nt signals (PaolaRuby)
    • bug #​42174 Indicate compatibility with psr/log 2 and 3 (derrabus)
    • bug #​41966 Revert "bug #​41952 fix handling positional arguments" (chalasr, nicolas-grekas)
    • bug #​41952 fix handling positional arguments (nicolas-grekas)

    v5.2.11

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.2.10...v5.2.11)

    v5.2.10

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.2.9...v5.2.10)

    • no significant changes

    v5.2.8

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.2.7...v5.2.8)

    v5.2.7

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.2.6...v5.2.7)

    • bug #​40698 Add Helper::width() and Helper::length() (Nyholm, grasmash)

    v5.2.6

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.2.5...v5.2.6)

    • bug #​40593 Uses the correct assignment action for console options depending if they are short or long (topikito)
    • bug #​40524 fix emojis messing up the line width (MarionLeHerisson)
    • bug #​40348 Fix line wrapping for decorated text in block output (grasmash)
    • bug #​40460 Correctly clear lines for multi-line progress bar messages (grasmash)
    • bug #​40450 ProgressBar clears too many lines on update (danepowell)

    v5.2.5

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.2.4...v5.2.5)

    • no significant changes

    v5.2.4

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.2.3...v5.2.4)

    • bug #​40192 fix QuestionHelper::getHiddenResponse() not working with space in project directory name (Yendric)
    • bug #​40187 Fix PHP 8.1 null error for preg_match flag (kylekatarnls)

    v5.2.3

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.2.2...v5.2.3)

    • no changes

    v5.2.2

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.2.1...v5.2.2)

    • bug #​39932 Fix Closure code binding when it is a static anonymous function (fancyweb)

    v5.2.1

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.2.0...v5.2.1)

    • bug #​39361 acces public-deprecated services via the private container to remove false-positive deprecations (nicolas-grekas)
    • bug #​39223 Re-enable hyperlinks in Konsole/Yakuake (OndraM)

    v5.2.0

    Compare Source

    • Added SingleCommandApplication::setAutoExit() to allow testing via CommandTester
    • added support for multiline responses to questions through Question::setMultiline() and Question::isMultiline()
    • Added SignalRegistry class to stack signals handlers
    • Added support for signals:
      • Added Application::getSignalRegistry() and Application::setSignalsToDispatchEvent() methods
      • Added SignalableCommandInterface interface
    • Added TableCellStyle class to customize table cell
    • Removed php prefix invocation from help messages.

    v5.1.11

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.1.10...v5.1.11)

    • bug #​39932 Fix Closure code binding when it is a static anonymous function (fancyweb)

    v5.1.10

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.1.9...v5.1.10)

    • bug #​39361 acces public-deprecated services via the private container to remove false-positive deprecations (nicolas-grekas)
    • bug #​39223 Re-enable hyperlinks in Konsole/Yakuake (OndraM)

    v5.1.9

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.1.8...v5.1.9)

    • bug #​39160 Use a partial buffer in SymfonyStyle (jderusse)
    • bug #​39168 Fix console closing tag (jderusse)
    • bug #​38991 Fix ANSI when stdErr is not a tty (jderusse)

    v5.1.8

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.1.7...v5.1.8)

    • no changes

    v5.1.7

    Compare Source

    v5.1.6

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.1.5...v5.1.6)

    • bug #​38166 work around disabled putenv() (SenTisso)
    • bug #​38116 Silence warnings on sapi_windows_cp_set() call (chalasr)
    • bug #​38114 guard $argv + $token against null, preventing unnecessary exceptions (bilogic)
    • bug #​38080 Make sure $maxAttempts is an int or null (derrabus)

    v5.1.5

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.1.4...v5.1.5)

    • bug #​38024 Fix undefined index for inconsistent command name definition (chalasr)

    v5.1.4

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.1.3...v5.1.4)

    • bug #​37731 Table: support cells with newlines after a cell with colspan >= 2 (GMTA)
    • bug #​37774 Make sure we pass a numeric array of arguments to call_user_func_array() (derrabus)

    v5.1.3

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.1.2...v5.1.3)

    • bug #​37469 always use stty when possible to ask hidden questions (nicolas-grekas)
    • bug #​37385 Fixes question input encoding on Windows (YaFou)

    v5.1.2

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.1.1...v5.1.2)

    • bug #​37286 Reset question validator attempts only for actual stdin (bis) (nicolas-grekas)
    • bug #​37160 Reset question validator attempts only for actual stdin (ostrolucky)

    v5.1.1

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.1.0...v5.1.1)

    • bug #​37130 allow cursor to be used even when STDIN is not defined (xabbuh)

    v5.1.0

    Compare Source

    • Command::setHidden() is final since Symfony 5.1
    • Add SingleCommandApplication
    • Add Cursor class

    v5.0.11

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.0.10...v5.0.11)

    • bug #​37469 always use stty when possible to ask hidden questions (nicolas-grekas)
    • bug #​37385 Fixes question input encoding on Windows (YaFou)
    • bug #​37286 Reset question validator attempts only for actual stdin (bis) (nicolas-grekas)
    • bug #​37160 Reset question validator attempts only for actual stdin (ostrolucky)

    v5.0.10

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.0.9...v5.0.10)

    • no changes

    v5.0.9

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.0.8...v5.0.9)

    • bug #​37007 Fix QuestionHelper::disableStty() (chalasr)
    • bug #​37000 Add meaningful message when using ProcessHelper and Process is not installed (l-vo)
    • bug #​36696 don't check tty on stdin, it breaks with "data lost during stream conversion" (nicolas-grekas)
    • bug #​36590 Default hidden question to 1 attempt for non-tty session (ostrolucky)

    v5.0.8

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.0.7...v5.0.8)

    • no changes

    v5.0.7

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.0.6...v5.0.7)

    v5.0.6

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.0.5...v5.0.6)

    • bug #​36031 Fallback to default answers when unable to read input (ostrolucky)

    v5.0.5

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.0.4...v5.0.5)

    • bug #​35676 Handle zero row count in appendRow() for Table (Adam Prickett)
    • bug #​35696 Don't load same-namespace alternatives on exact match (chalasr)
    • bug #​33897 Consider STDIN interactive (ostrolucky)
    • bug #​34114 SymonfyStyle - Check value isset to avoid PHP notice (leevigraham)

    v5.0.4

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.0.3...v5.0.4)

    • no changes

    v5.0.3

    Compare Source

    Changelog (https://github.com/symfony/console/compare/v5.0.2...v5.0.3)

    • bug #​35094 Fix filtering out identical alternatives when there is a command loader (fancyweb)

    v5.0.2

    Compare Source

    v5.0.1

    Compare Source

    v5.0.0

    Compare Source

    • removed support for finding hidden commands using an abbreviation, use the full name instead
    • removed TableStyle::setCrossingChar() method in favor of TableStyle::setDefaultCrossingChar()
    • removed TableStyle::setHorizontalBorderChar() method in favor of TableStyle::setDefaultCrossingChars()
    • removed TableStyle::getHorizontalBorderChar() method in favor of TableStyle::getBorderChars()
    • removed TableStyle::setVerticalBorderChar() method in favor of TableStyle::setVerticalBorderChars()
    • removed TableStyle::getVerticalBorderChar() method in favor of TableStyle::getBorderChars()
    • removed support for returning null from Command::execute(), return 0 instead
    • ProcessHelper::run() accepts only array|Symfony\Component\Process\Process for its command argument
    • Application::setDispatcher accepts only Symfony\Contracts\EventDispatcher\EventDispatcherInterface for its dispatcher argument
    • renamed Application::renderException() and Application::doRenderException() to renderThrowable() and doRenderThrowable() respectively.

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency sunrise/http-factory to v1.1.1

    Update dependency sunrise/http-factory to v1.1.1

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | sunrise/http-factory | require-dev | patch | 1.1.0 -> 1.1.1 |


    Release Notes

    sunrise-php/http-factory

    v1.1.1

    Compare Source

    • Minor changes.

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    Open

    These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

    Detected dependencies

    circleci
    .circleci/config.yml
    • circleci/php 7.1-cli-node-browsers
    • circleci/php 7.2-cli-node-browsers
    • circleci/php 7.3-cli-node-browsers
    • circleci/php 7.4-cli-node-browsers
    • circleci/php 8.0-cli-node-browsers
    composer
    composer.json
    • doctrine/annotations ^1.6
    • sunrise/coding-standard 1.0.0
    • sunrise/http-factory 1.1.0
    • sunrise/http-router ^2.11
    • symfony/console ^4.4
    • justinrainbow/json-schema 5.2.10

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
  • Update dependency justinrainbow/json-schema to v5.2.12

    Update dependency justinrainbow/json-schema to v5.2.12

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | justinrainbow/json-schema | require-dev | patch | 5.2.10 -> 5.2.12 |


    Release Notes

    justinrainbow/json-schema

    v5.2.12

    Compare Source

    v5.2.11

    Compare Source


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
Releases(v2.2.0)
Owner
Sunrise // PHP
Sunrise // PHP
PHP Router class - A simple Rails inspired PHP router class.

PHP Router class A simple Rails inspired PHP router class. Usage of different HTTP Methods REST / Resourceful routing Reversed routing using named rou

Danny van Kooten 565 Jan 8, 2023
Simple, fast and yet powerful PHP router that is easy to get integrated and in any project.

Simple, fast and yet powerful PHP router that is easy to get integrated and in any project. Heavily inspired by the way Laravel handles routing, with both simplicity and expand-ability in mind.

Simon SessingΓΈ 472 Jan 4, 2023
Pux is a fast PHP Router and includes out-of-box controller tools

Pux Pux is a faster PHP router, it also includes out-of-box controller helpers. 2.0.x Branch Build Status (This branch is under development) Benchmark

Yo-An Lin 1.3k Dec 21, 2022
Toro is a PHP router for developing RESTful web applications and APIs.

Toro Toro is a PHP router for developing RESTful web applications and APIs. It is designed for minimalists who want to get work done. Quick Links Offi

Kunal Anand 1.2k Dec 27, 2022
A lightweight and simple object oriented PHP Router

bramus/router A lightweight and simple object oriented PHP Router. Built by Bram(us) Van Damme (https://www.bram.us) and Contributors Features Support

Bramus! 935 Jan 1, 2023
PhpRouter is a powerful, lightweight, and very fast HTTP URL router for PHP projects.

PhpRouter PhpRouter is a powerful, lightweight, and very fast HTTP URL router for PHP projects. Some of the provided features: Route parameters Predef

Milad Rahimi 152 Dec 28, 2022
A lightweight and fast router for PHP

Piko Router A lightweight and blazing fast router (see benchmarks) using a radix trie to store dynamic routes. This router maps routes to user defined

Piko framework 62 Dec 27, 2022
Thruway - an open source client and router implementation of WAMP (Web Application Messaging Protocol), for PHP.

PHP Client and Router Library for Autobahn and WAMP (Web Application Messaging Protocol) for Real-Time Application Messaging

Voryx 661 Nov 14, 2022
PHPRouter is an easy-to-use, fast, and flexible PHP router package with express-style routing.

PHP-Router is a modern, fast, and adaptable composer package that provides express-style routing in PHP without a framework.

Ayodeji O. 4 Oct 20, 2022
A lightweight and very basic PHP router.

Katya A lightweight PHP router Configuration Para servidor Apache, en el directorio del proyecto crea y edita un archivo .htaccess con lo siguiente: <

Luis RodrΓ­guez 0 Apr 4, 2022
Fast request router for PHP

FastRoute - Fast request router for PHP This library provides a fast implementation of a regular expression based router. Blog post explaining how the

Nikita Popov 4.7k Dec 23, 2022
A fast & flexible router

Klein.php klein.php is a fast & flexible router for PHP 5.3+ Flexible regular expression routing (inspired by Sinatra) A set of boilerplate methods fo

null 2.6k Dec 28, 2022
A web router implementation for PHP.

Aura.Router Powerful, flexible web routing for PSR-7 requests. Installation and Autoloading This package is installable and PSR-4 autoloadable via Com

Aura for PHP 469 Jan 1, 2023
:bird: Simple PHP router

Macaw Macaw is a simple, open source PHP router. It's super small (~150 LOC), fast, and has some great annotated source code. This class allows you to

Noah Buscher 895 Dec 21, 2022
Flight routing is a simple, fast PHP router that is easy to get integrated with other routers.

The PHP HTTP Flight Router divineniiquaye/flight-routing is a HTTP router for PHP 7.1+ based on PSR-7 and PSR-15 with support for annotations, created

Divine Niiquaye Ibok 16 Nov 1, 2022
A simple PHP Router

Panda Router Description the panda-router is a small alternative PHP router that can be used for small projects. With this router you can use differen

Jan Behrens 1 Dec 27, 2021
klein.php is a fast & flexible router for PHP 5.3+

Klein.php klein.php is a fast & flexible router for PHP 5.3+ Flexible regular expression routing (inspired by Sinatra) A set of boilerplate methods fo

null 2.6k Jan 7, 2023
A router for Amp's HTTP Server.

http-server-router This package provides a routing RequestHandler for Amp's HTTP server based on the request URI and method based on FastRoute. Instal

AMPHP 34 Dec 19, 2022
A PHP Router Package

Router A PHP Router Package Basic Concepts A router package is a utility that, once all http requests are redirected to an entry point, can configure

null 0 Aug 26, 2022