Re: PSR-7: reuseful Request, how change body content?

2019-10-24 Thread Anton Fedonjuk
1. English is not my first language, so what I said may seem offensive, although I did not want this. 2. If there are rules, then no one bothered to acquaint me with them 3. When has openness/truthfulness become not civilized and unacceptable? I think dialogue must be simple and clear, without

Re: PSR-7: reuseful Request, how change body content?

2019-10-23 Thread Alessandro Lai
Anton please keep it to a civil tone. Talking about "mistification" is not friendly nor acceptable here. As already said by MWOP, supporting PSR-7 alone has absolutely sense, and there are tons of packages that do that, because they care only about working on requests, not creating them. Il

Re: PSR-7: reuseful Request, how change body content?

2019-10-16 Thread Anton Fedonjuk
See my previous comment to Matthew Weier O'Phinney, can u do this? If u cant this disscussion is mistification. вторник, 15 октября 2019 г., 22:39:58 UTC+3 пользователь Alexandru Pătrănescu написал: > > The pattern that PSR-7 promote is the use of immutable objects. > It is maybe a bit harder

Re: PSR-7: reuseful Request, how change body content?

2019-10-16 Thread Anton Fedonjuk
Immutable objects is not problem. I never talked that. But I see hard dependencies between PSR-7 and PSR-17 in real applications - you cant create eggs without chicken... вторник, 15 октября 2019 г., 22:39:58 UTC+3 пользователь Alexandru Pătrănescu написал: > The pattern that PSR-7 promote is

Re: PSR-7: reuseful Request, how change body content?

2019-10-15 Thread Alexandru Pătrănescu
Hi Anton, > > *Not reusable/resettable objects it`s potential problem in future.**Yes, > we can send factories or add empty instances, but it's harder than add > method to reset content.* The pattern that PSR-7 promote is the use of immutable objects. It is maybe a bit harder to use, in some

Re: PSR-7: reuseful Request, how change body content?

2019-10-14 Thread Anton Fedonjuk
There are many contradictions in your comment. If you can replace/reset my FiltredStream from other example to new in any RequestInterface implementation without PSR-17, just show how do it - code please. вторник, 15 октября 2019 г., 1:32:46 UTC+3 пользователь Matthew Weier O'Phinney написал:

Re: PSR-7: reuseful Request, how change body content?

2019-10-14 Thread Anton Fedonjuk
If you replace psr-17 to same your interfaces/classes then it's not "just fine" for me. In your case, external packages included my package cant use any PSR-7 package with my package. вторник, 15 октября 2019 г., 1:32:46 UTC+3 пользователь Matthew Weier O'Phinney написал: > > You can use PSR-7

Re: PSR-7: reuseful Request, how change body content?

2019-10-14 Thread Anton Fedonjuk
At first, I not last in chain - my package used in other packages and I they can add filters or something like this to his StreamInterface implementations. As a result, difference in writed content. See up - I already add Stream examles for display this. вторник, 15 октября 2019 г., 1:32:46

Re: PSR-7: reuseful Request, how change body content?

2019-10-14 Thread Matthew Weier O'Phinney
On Sat, Oct 12, 2019 at 9:25 AM Anton Fedonjuk wrote: > *Not reusable/resettable objects it`s potential problem in future.* > *Yes, we can send factories or add empty instances, but it's harder than > add method to reset content.* > > Resetting content means _resetting the StreamInterface

Re: PSR-7: reuseful Request, how change body content?

2019-10-12 Thread Anton Fedonjuk
*Not reusable/resettable objects it`s potential problem in future.* *Yes, we can send factories or add empty instances, but it's harder than add method to reset content.* My current code: abstract class HttpGateway extends Gateway { protected $client; protected $request; protected

Re: PSR-7: reuseful Request, how change body content?

2019-10-12 Thread Anton Fedonjuk
*Not reusable/resettable objects it`s potential problem in future.* *Yes, we can send factories or add empty instances, but it's harder than add method to reset content.* My current code: abstract class HttpGateway extends Gateway { protected $client; protected $request; protected

Re: PSR-7: reuseful Request, how change body content?

2019-10-12 Thread Anton Fedonjuk
Other StreamInterface implementation not guarantee similar contents - compatible != identical. суббота, 12 октября 2019 г., 16:23:32 UTC+3 пользователь Martijn van der Ven написал: > > Also note that you can use any StreamInterface implementation. > -- You received this message because you

Re: PSR-7: reuseful Request, how change body content?

2019-10-12 Thread Anton Fedonjuk
You cant do this. How u create new FiltredStream? суббота, 12 октября 2019 г., 16:23:32 UTC+3 пользователь Martijn van der Ven написал: > > it is much better to initiate a new Stream and use that through the > withBody() method. This is especially true if you do not know the > underlying

Re: PSR-7: reuseful Request, how change body content?

2019-10-12 Thread Anton Fedonjuk
if stream not writable then we can replace it to any writeble stream. суббота, 12 октября 2019 г., 16:23:32 UTC+3 пользователь Martijn van der Ven написал: > > How will you hande read-only Streams? > -- You received this message because you are subscribed to the Google Groups "PHP Framework

Re: PSR-7: reuseful Request, how change body content?

2019-10-12 Thread Martijn van der Ven
To make something that is compatible with unknown third-party implementations of PSR, I would do something like this: class MySpecialRequestHandler { private $streamFactory; public function __construct(StreamFactoryInterface $streamFactory) { $this->streamFactory =

Re: PSR-7: reuseful Request, how change body content?

2019-10-12 Thread Anton Fedonjuk
These are not copies of the current StreamtInterface implementation returned $this->request->getBody() I am trying to create a class/method that works with any third-party RequestInterface implementation. I do not know the architecture of StreamtInterface implementation used in the

Re: PSR-7: reuseful Request, how change body content?

2019-10-11 Thread Matthew Weier O'Phinney
On Thu, Oct 10, 2019, 6:42 PM Anton Fedonjuk wrote: > Class contains method setRequest(RequestInterface $request), his abstact > code: > Request body already sets: $request->getBody()->write('...'); > I want send this request with other body content, but dont know how: > 1. StreamInterface don't

Re: PSR-7: reuseful Request, how change body content?

2019-10-10 Thread Anton Fedonjuk
You know only: $request instanceof RequestInterface, you dont know other details and can use only methods/classes defined in RequestInterface. пятница, 11 октября 2019 г., 3:29:23 UTC+3 пользователь Woody Gilk написал: > > Not sure what you mean, StreamFactoryInterface is designed to create new

Re: PSR-7: reuseful Request, how change body content?

2019-10-10 Thread Anton Fedonjuk
Also PSR-7 not "include" PSR-17 - maybe that stream created without factory, we dont know. пятница, 11 октября 2019 г., 3:05:42 UTC+3 пользователь Woody Gilk написал: > > Create a new stream using PSR-17 StreamFactory. > > On Thu, Oct 10, 2019 at 6:42 PM Anton Fedonjuk > wrote: > >> Class

Re: PSR-7: reuseful Request, how change body content?

2019-10-10 Thread Woody Gilk
Not sure what you mean, StreamFactoryInterface is designed to create new streams from strings, files, or existing resources. As the editor of PSR-17, I am quite sure this is the case. -- Woody Gilk https://www.shadowhand.com On Thu, Oct 10, 2019 at 7:24 PM Anton Fedonjuk wrote: > Nope, u dont

Re: PSR-7: reuseful Request, how change body content?

2019-10-10 Thread Anton Fedonjuk
Nope, u dont know factory class name пятница, 11 октября 2019 г., 3:05:42 UTC+3 пользователь Woody Gilk написал: > > Create a new stream using PSR-17 StreamFactory. > -- You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group. To

Re: PSR-7: reuseful Request, how change body content?

2019-10-10 Thread Woody Gilk
Create a new stream using PSR-17 StreamFactory. On Thu, Oct 10, 2019 at 6:42 PM Anton Fedonjuk wrote: > Class contains method setRequest(RequestInterface $request), his abstact > code: > Request body already sets: $request->getBody()->write('...'); > I want send this request with other body

PSR-7: reuseful Request, how change body content?

2019-10-10 Thread Anton Fedonjuk
Class contains method setRequest(RequestInterface $request), his abstact code: Request body already sets: $request->getBody()->write('...'); I want send this request with other body content, but dont know how: 1. StreamInterface don't have methods as PHP ftruncate() 2. Constructor not defined in