PHP Classes

File: docs/Internals/Adapter/AdapterInterface.md

Recommend this page to a friend!
  Classes of Scott Arciszewski   sapient   docs/Internals/Adapter/AdapterInterface.md   Download  
File: docs/Internals/Adapter/AdapterInterface.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: sapient
Add a security layer to server to server requests
Author: By
Last change:
Date: 6 years ago
Size: 709 bytes
 

Contents

Class file image Download

Adapter Interface

All an Adapter needs is the ability to convert a string (containin the data, not a filename) into an implementation of PSR-7's StreamInterface specific to your framework.

Some adapters may also choose to implement the ConvenienceInterface, which provides methods for converting strings or arrays into framework-specfic Request or Response objects.

stringToStream()

Function prototype:

function stringToStream(
    string $input
): StreamInterface;

This must return a Stream object that implements StreamInterface whose contents are populated by $input. Implementations may alter the contents of $input to suit their needs.