Skip to content

Commit

Permalink
Fix README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ebln committed Aug 22, 2020
1 parent 7af6b24 commit 15252d2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Partial PSR-7 Adapters for Symfony 1.5
======================================

To enable the use of future-proof PSR-15 middlewares via partial PSR-7 adapers.
To enable the use of future-proof PSR-15 middlewares via partial PSR-7 adapters.

## Quickstart
```php
Expand All @@ -13,17 +13,15 @@ $responseAdapter = \brnc\Symfony1\Message\Adapter\Response::fromSfWebRespon
## ServerRequest
Please mind the following PSR-7 violation which is enabled by default:
### No immutability by default
As this is just an adapter for `\sfWebRequest` which cannot just be switched with another instance;
as this is just an adapter for `\sfWebRequest` which cannot easily be replaced with another instance.

This adapter – by default – also returns the very same instance when calling `with*()` methods.
For the same reason calls to methods which cannot act on and alter the underlying `\sfWebRequest`
will throw an `\brnc\Symfony1\Message\Exception\LogicException`.

This default behaviour can by changes by creating the `Request` using
the `Request::OPTION_IMMUTABLE_VIOLATION` option set to `true`.
The `Request`-adapter will then always return a close when used
with `with*()` methods and won't throw exceptions
which cannot transparently act on the `\sfWebRequest`- object
This default behaviour can be changed by creating the `Request` using
the `Request::OPTION_IMMUTABLE_VIOLATION` option set to `false`.
The `Request`-adapter will then always return new instances when `with*()`-methods are called and won't throw exceptions on calls which cannot transparently act on the `\sfWebRequest`- object.


```php
Expand Down

0 comments on commit 15252d2

Please sign in to comment.