diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index 463d83f..0ca45f6 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -15,7 +15,7 @@ jobs: python-version: 3.7 - name: Install dependencies run: | - sudo apt update && sudo apt install -y enchant + sudo apt update && sudo apt install -y enchant-2 python -m pip install --upgrade setuptools python -m pip install --upgrade pyenchant sphinx-rtd-theme sphinxcontrib-spelling - name: Check spelling diff --git a/clients/includes/install-message-factory.inc b/clients/includes/install-message-factory.inc index 2ca6116..fccb721 100644 --- a/clients/includes/install-message-factory.inc +++ b/clients/includes/install-message-factory.inc @@ -18,3 +18,4 @@ accessed through :ref:`factories `. Message factories for .. _Laminas Diactoros: https://github.com/laminas/laminas-diactoros .. _Slim PSR-7: https://github.com/slimphp/Slim-Psr7 .. _Zend Diactoros: https://github.com/zendframework/zend-diactoros +.. _Slim Framework: https://github.com/slimphp/Slim diff --git a/conf.py b/conf.py index 8498f1b..98d2ade 100644 --- a/conf.py +++ b/conf.py @@ -80,7 +80,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = 'en' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: diff --git a/discovery.rst b/discovery.rst index 5fb4ba0..3a79fe6 100644 --- a/discovery.rst +++ b/discovery.rst @@ -30,23 +30,26 @@ implementations but only on the standard. The library should only require the PSR standards. To run tests, you might still need an implementation. We recommend to -explicitly require that, but only for dev. To build a library that needs to -send HTTP requests, you could do: +explicitly require that, but only for development. To build a library that +needs to send HTTP requests, you could do: .. code-block:: bash + $ composer require --dev symfony/http-client $ composer require --dev nyholm/psr7 Then, you can disable the Composer plugin provided by ``php-http/discovery`` -because you just installed the dev dependencies you need for testing: +because you just installed the ``dev`` dependencies you need for testing: .. code-block:: bash + $ composer config allow-plugins.php-http/discovery false Finally, you need to require ``php-http/discovery`` and the generic implementations that your library is going to need: .. code-block:: bash + $ composer require php-http/discovery:^1.17 $ composer require psr/http-client-implementation:* $ composer require psr/http-factory-implementation:* @@ -132,6 +135,7 @@ to prefer. You can specify the implementation for one of the standards: .. code-block:: bash + $ composer config extra.discovery.psr/http-factory-implementation GuzzleHttp\Psr7\HttpFactory This will update your ``composer.json`` file to add the following configuration: @@ -158,6 +162,7 @@ Don't forget to run composer install to apply the changes, and ensure that the composer plugin is enabled: .. code-block:: bash + $ composer config allow-plugins.php-http/discovery true $ composer install @@ -338,7 +343,7 @@ Internally, this class relies on the concrete PSR-17 factories that are installe and can use discovery to find implementations if you do not specify them in the constructor. ``Psr17Factory`` provides two additional methods that allow creating -server requests or URI objects from the PHP super-globals:: +server requests or URI objects from the PHP superglobals:: $serverRequest = $factory->createServerRequestFromGlobals(); $uri = $factory->createUriFromGlobals(); diff --git a/integrations/symfony-bundle.rst b/integrations/symfony-bundle.rst index 2ab0a86..f0af382 100644 --- a/integrations/symfony-bundle.rst +++ b/integrations/symfony-bundle.rst @@ -562,7 +562,7 @@ To mock a response in your tests, do: $client->getContainer()->get('httplug.clients.my_awesome_backend.client')->addResponse($response); If you do not specify the factory in your configuration, you can also directly -overwrite the httplug services: +overwrite the HTTPlug services: .. code-block:: yaml diff --git a/message/message-factory.rst b/message/message-factory.rst index c9099a1..0852733 100644 --- a/message/message-factory.rst +++ b/message/message-factory.rst @@ -139,3 +139,4 @@ to do that yet. Contributions are welcome if you want to define the .. _Laminas Diactoros: https://github.com/laminas/laminas-diactoros .. _Slim PSR-7: https://github.com/slimphp/Slim-Psr7 .. _Zend Diactoros: https://github.com/zendframework/zend-diactoros +.. _Slim Framework: https://github.com/slimphp/Slim diff --git a/plugins/logger.rst b/plugins/logger.rst index f755343..278e439 100644 --- a/plugins/logger.rst +++ b/plugins/logger.rst @@ -26,10 +26,10 @@ compliant logger:: [$loggerPlugin] ); -The log level for exceptions is `error`, the request and responses without exceptions are logged at level `info`. -Request and response/errors can be correlated by looking at the `uid` of the log context. -If you don't want to normally log requests, you can set the logger to normally only log `error` but use the -Fingerscrossed logger of monolog to also log the request in case an exception is encountered. +The log level for exceptions is ``error``, the request and responses without exceptions are logged at level ``info``. +Request and response/errors can be correlated by looking at the ``uid`` of the log context. +If you don't want to normally log requests, you can set the logger to normally only log ``error`` but use the +``Fingerscrossed`` logger of Monolog to also log the request in case an exception is encountered. By default it uses ``Http\Message\Formatter\SimpleFormatter`` to format the request or the response into a string. You can use any formatter implementing the ``Http\Message\Formatter`` interface:: diff --git a/plugins/redirect.rst b/plugins/redirect.rst index 0dfe8d4..965a953 100644 --- a/plugins/redirect.rst +++ b/plugins/redirect.rst @@ -32,7 +32,7 @@ Initiate the redirect plugin as follows:: .. note:: Depending on the status code, redirecting should change POST/PUT requests to GET requests. This - plugin implements this behaviour - except if you set the ``strict`` option to true, as explained + plugin implements this behavior - except if you set the ``strict`` option to true, as explained below. It removes the request body if the method changes, see ``stream_factory`` below. To understand the exact semantics of which HTTP status changes the method and which not, have a diff --git a/spelling_word_list.txt b/spelling_word_list.txt index a209c06..0383be3 100644 --- a/spelling_word_list.txt +++ b/spelling_word_list.txt @@ -27,6 +27,7 @@ plugin plugins matchers matcher +Monolog multipart natively param @@ -35,11 +36,13 @@ profiler PHP phpdoc rebase +redirections Semver Seekable seekable sexualized sublicense +superglobals sync toolbar typehint