From b5e7467a6c2d655e863f2a9c1201041b3fe5b600 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Fri, 18 Nov 2016 09:01:26 +0100 Subject: [PATCH 1/7] Added more common errors --- discovery.rst | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/discovery.rst b/discovery.rst index b246fb1..2999772 100644 --- a/discovery.rst +++ b/discovery.rst @@ -84,23 +84,52 @@ Read more about setting up Puli in their `official documentation`_. Common Errors ------------- +Could not find resource using any discovery strategy +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If you get an error saying "*Could not find resource using any discovery strategy.*" it means that all the +:doc:`discovery strategies ` have failed. The cause of this is probably because you have not installed message factories +and/or a PSR-7 implementation. See the :doc:`user documentation `. + +To resolve this you may run + +.. code-block:: bash + + $ composer require php-http/curl-client guzzlehttp/psr7 php-http/message + Puli Factory is not available ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you get an error that says "*Puli Factory is not available*", it means that you have failed to install Puli. -You should make sure you install the latest version of ``puli/composer-plugin``. +Using Puli is optional and you will be able to use common clients and message factories without Puli +(:doc:`See documentation `).If you want to use Puli, make sure to install the latest version of +``puli/composer-plugin``. + +.. code-block:: bash + + $ composer require puli/composer-plugin No factories found ^^^^^^^^^^^^^^^^^^ -The error "*No factories found. To use Guzzle or Diactoros factories install php-http/message and the chosen message implementation.*" -tells you that Puli could not find an installed implementation of PSR-7 and/or factories to that implementation. You -need to install those libraries. If you want to use Guzzle you may run: +The error "*No message factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message +and the chosen message implementation.*" +tells you that no discovery strategy could not find an installed implementation of PSR-7 and/or factories for that +implementation. You need to install those libraries. If you want to use Guzzle you may run: .. code-block:: bash $ composer require php-http/message guzzlehttp/psr7 +No HTTPlug clients found +^^^^^^^^^^^^^^^^^^^^^^^^ + +The error "No HTTPlug clients found. Make sure to install a package providing "php-http/client-implementation"*" says that +we cant find a client. See our :doc:`list of clients ` and install one of them. + +.. code-block:: bash + + $ composer require php-http/curl-client HTTP Client Discovery --------------------- @@ -118,7 +147,7 @@ This type of discovery finds an HTTP Client implementation:: protected $httpClient; /** - * @param HttpClient|null $httpClient Client to do HTTP requests, if not set, autodiscovery will be used to find a HTTP client. + * @param HttpClient|null $httpClient Client to do HTTP requests, if not set, auto discovery will be used to find a HTTP client. */ public function __construct(HttpClient $httpClient = null) { @@ -142,7 +171,7 @@ This type of discovery finds a HTTP asynchronous Client implementation:: protected $httpAsyncClient; /** - * @param HttpAsyncClient|null $httpAsyncClient Client to do HTTP requests, if not set, autodiscovery will be used to find an asynchronous client. + * @param HttpAsyncClient|null $httpAsyncClient Client to do HTTP requests, if not set, auto discovery will be used to find an asynchronous client. */ public function __construct(HttpAsyncClient $httpAsyncClient = null) { From e0f80cd20ae30e9001ec3a301e6dc28697bdfc41 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Fri, 18 Nov 2016 09:26:57 +0100 Subject: [PATCH 2/7] Fixed typos --- discovery.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/discovery.rst b/discovery.rst index 2999772..8b24047 100644 --- a/discovery.rst +++ b/discovery.rst @@ -88,7 +88,7 @@ Could not find resource using any discovery strategy ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you get an error saying "*Could not find resource using any discovery strategy.*" it means that all the -:doc:`discovery strategies ` have failed. The cause of this is probably because you have not installed message factories +discovery [#strategies]_ have failed. The cause of this is probably because you have not installed message factories and/or a PSR-7 implementation. See the :doc:`user documentation `. To resolve this you may run @@ -102,7 +102,7 @@ Puli Factory is not available If you get an error that says "*Puli Factory is not available*", it means that you have failed to install Puli. Using Puli is optional and you will be able to use common clients and message factories without Puli -(:doc:`See documentation `).If you want to use Puli, make sure to install the latest version of +(:doc:`see how `). If you want to use Puli, make sure to install the latest version of ``puli/composer-plugin``. .. code-block:: bash @@ -124,7 +124,7 @@ implementation. You need to install those libraries. If you want to use Guzzle y No HTTPlug clients found ^^^^^^^^^^^^^^^^^^^^^^^^ -The error "No HTTPlug clients found. Make sure to install a package providing "php-http/client-implementation"*" says that +The error "No HTTPlug clients found. Make sure to install a package providing 'php-http/client-implementation'*" says that we cant find a client. See our :doc:`list of clients ` and install one of them. .. code-block:: bash From faf41d26e58975d12a896d03223cfd153ae2eede Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Fri, 18 Nov 2016 10:24:57 +0100 Subject: [PATCH 3/7] Corrections --- discovery.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discovery.rst b/discovery.rst index 8b24047..df1bba3 100644 --- a/discovery.rst +++ b/discovery.rst @@ -114,7 +114,7 @@ No factories found The error "*No message factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message and the chosen message implementation.*" -tells you that no discovery strategy could not find an installed implementation of PSR-7 and/or factories for that +tells you that no discovery strategy could find an installed implementation of PSR-7 and/or factories for that implementation. You need to install those libraries. If you want to use Guzzle you may run: .. code-block:: bash @@ -125,7 +125,7 @@ No HTTPlug clients found ^^^^^^^^^^^^^^^^^^^^^^^^ The error "No HTTPlug clients found. Make sure to install a package providing 'php-http/client-implementation'*" says that -we cant find a client. See our :doc:`list of clients ` and install one of them. +we cannot find a client. See our :doc:`list of clients ` and install one of them. .. code-block:: bash From 8b07ee8b07528ae6956f304c81a3e903adb3ccb9 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Fri, 18 Nov 2016 13:22:52 +0100 Subject: [PATCH 4/7] Corrections --- discovery.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/discovery.rst b/discovery.rst index df1bba3..e07c7a9 100644 --- a/discovery.rst +++ b/discovery.rst @@ -88,8 +88,8 @@ Could not find resource using any discovery strategy ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you get an error saying "*Could not find resource using any discovery strategy.*" it means that all the -discovery [#strategies]_ have failed. The cause of this is probably because you have not installed message factories -and/or a PSR-7 implementation. See the :doc:`user documentation `. +discovery [#strategies]_ have failed. Most likely, your project is missing the message factories and/or a PRS-7 +implementation. See the :doc:`user documentation `. To resolve this you may run @@ -124,7 +124,7 @@ implementation. You need to install those libraries. If you want to use Guzzle y No HTTPlug clients found ^^^^^^^^^^^^^^^^^^^^^^^^ -The error "No HTTPlug clients found. Make sure to install a package providing 'php-http/client-implementation'*" says that +The error "*No HTTPlug clients found. Make sure to install a package providing 'php-http/client-implementation'*" says that we cannot find a client. See our :doc:`list of clients ` and install one of them. .. code-block:: bash From 632dfb4f1f8bc2e018514195104824adcbeaabb2 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Fri, 18 Nov 2016 14:09:00 +0100 Subject: [PATCH 5/7] syntax fix --- discovery.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discovery.rst b/discovery.rst index e07c7a9..aec6e4f 100644 --- a/discovery.rst +++ b/discovery.rst @@ -25,6 +25,7 @@ Discovery is simply a convenience wrapper to statically access clients and facto Dependency Injection is not an option. Discovery is useful in libraries that want to offer zero-configuration services relying on the virtual packages. +.. _discovery-strategies: Strategies ---------- @@ -88,7 +89,7 @@ Could not find resource using any discovery strategy ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you get an error saying "*Could not find resource using any discovery strategy.*" it means that all the -discovery [#strategies]_ have failed. Most likely, your project is missing the message factories and/or a PRS-7 +discovery :ref:`strategies have failed. Most likely, your project is missing the message factories and/or a PRS-7 implementation. See the :doc:`user documentation `. To resolve this you may run From 49741145e00f0c93a523eff0b3f20f552a1107f6 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Fri, 18 Nov 2016 14:11:08 +0100 Subject: [PATCH 6/7] typo --- discovery.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discovery.rst b/discovery.rst index aec6e4f..3a861c3 100644 --- a/discovery.rst +++ b/discovery.rst @@ -89,7 +89,7 @@ Could not find resource using any discovery strategy ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you get an error saying "*Could not find resource using any discovery strategy.*" it means that all the -discovery :ref:`strategies have failed. Most likely, your project is missing the message factories and/or a PRS-7 +discovery :ref:`strategies ` have failed. Most likely, your project is missing the message factories and/or a PRS-7 implementation. See the :doc:`user documentation `. To resolve this you may run From 8ea9b694028c12ab883f3875561b71dd7db7d1f9 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 24 Nov 2016 10:30:35 +0100 Subject: [PATCH 7/7] Fixed line length --- discovery.rst | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/discovery.rst b/discovery.rst index 3a861c3..6c01b03 100644 --- a/discovery.rst +++ b/discovery.rst @@ -88,9 +88,10 @@ Common Errors Could not find resource using any discovery strategy ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -If you get an error saying "*Could not find resource using any discovery strategy.*" it means that all the -discovery :ref:`strategies ` have failed. Most likely, your project is missing the message factories and/or a PRS-7 -implementation. See the :doc:`user documentation `. +If you get an error saying "*Could not find resource using any discovery strategy.*" +it means that all the discovery :ref:`strategies ` have failed. +Most likely, your project is missing the message factories and/or a PRS-7 implementation. +See the :doc:`user documentation `. To resolve this you may run @@ -101,9 +102,10 @@ To resolve this you may run Puli Factory is not available ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -If you get an error that says "*Puli Factory is not available*", it means that you have failed to install Puli. -Using Puli is optional and you will be able to use common clients and message factories without Puli -(:doc:`see how `). If you want to use Puli, make sure to install the latest version of +If you get an error that says "*Puli Factory is not available*", it means that you +have failed to install Puli. Using Puli is optional and you will be able to use +common clients and message factories without Puli (:doc:`see how `). +If you want to use Puli, make sure to install the latest version of ``puli/composer-plugin``. .. code-block:: bash @@ -113,10 +115,11 @@ Using Puli is optional and you will be able to use common clients and message fa No factories found ^^^^^^^^^^^^^^^^^^ -The error "*No message factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message -and the chosen message implementation.*" -tells you that no discovery strategy could find an installed implementation of PSR-7 and/or factories for that -implementation. You need to install those libraries. If you want to use Guzzle you may run: +The error "*No message factories found. To use Guzzle, Diactoros or Slim Framework +factories install php-http/message and the chosen message implementation.*" tells +you that no discovery strategy could find an installed implementation of PSR-7 +and/or factories for that implementation. You need to install those libraries. +If you want to use Guzzle you may run: .. code-block:: bash @@ -125,8 +128,9 @@ implementation. You need to install those libraries. If you want to use Guzzle y No HTTPlug clients found ^^^^^^^^^^^^^^^^^^^^^^^^ -The error "*No HTTPlug clients found. Make sure to install a package providing 'php-http/client-implementation'*" says that -we cannot find a client. See our :doc:`list of clients ` and install one of them. +The error "*No HTTPlug clients found. Make sure to install a package providing +'php-http/client-implementation'*" says that we cannot find a client. See our +:doc:`list of clients ` and install one of them. .. code-block:: bash