PHPackages                             alxmsl/psr-7 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. alxmsl/psr-7

ActiveLibrary[HTTP &amp; Networking](/categories/http)

alxmsl/psr-7
============

PSR-7 interfaces with strict types declarations

v0.1.1(10y ago)027Apache-2.0PHPPHP &gt;=7.0

Since Jan 9Pushed 10y ago1 watchersCompare

[ Source](https://github.com/alxmsl/psr-7)[ Packagist](https://packagist.org/packages/alxmsl/psr-7)[ RSS](/packages/alxmsl-psr-7/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

PSR-7 interfaces
================

[](#psr-7-interfaces)

[![License](https://camo.githubusercontent.com/abea93bc7247ab603a500ae3893148ef4a8dfe53b24a5edc2e52266455f1d3bb/68747470733a2f2f706f7365722e707567782e6f72672f616c786d736c2f7073722d372f6c6963656e7365)](https://packagist.org/packages/alxmsl/psr-7)[![Latest Stable Version](https://camo.githubusercontent.com/0d3920f55ecf4ec059f56cff916e1cec0a9011f2bf010d41a072083bb35c596b/68747470733a2f2f706f7365722e707567782e6f72672f616c786d736c2f7073722d372f76657273696f6e)](https://packagist.org/packages/alxmsl/psr-7)[![Total Downloads](https://camo.githubusercontent.com/9383a802e87a549c402b04eca6cbe7eb09bd605562949fc317cb0a03b940a59a/68747470733a2f2f706f7365722e707567782e6f72672f616c786d736c2f7073722d372f646f776e6c6f616473)](https://packagist.org/packages/alxmsl/psr-7)

This repository holds all interfaces related to [PSR-7](http://www.php-fig.org/psr/psr-7/). This's fork of [php-fig/http-message](https://github.com/php-fig/http-message) except usage of strict types. All interface methods have strict type declarations.

For example, if `Psr\Http\RequestInterface` is defined like

```
interface RequestInterface extends MessageInterface {
    /**
     * @return string
     */
    public function getRequestTarget();

    /**
     * @param mixed $requestTarget
     * @return self
     */
    public function withRequestTarget($requestTarget);

    /**
     * @return string Returns the request method.
     */
    public function getMethod();

    /**
     * @param string $method Case-sensitive method.
     * @return self
     * @throws InvalidArgumentException for invalid HTTP methods.
     */
    public function withMethod($method);

    /**
     * @return UriInterface Returns a UriInterface instance representing the URI of the request.
     */
    public function getUri();

    /**
     * @param UriInterface $uri New request URI to use.
     * @param bool $preserveHost Preserve the original state of the Host header.
     * @return self
     */
    public function withUri(UriInterface $uri, $preserveHost = false);
}
```

...then `alxmsl\Psr7\RequestInterface` will be defined like

```
interface RequestInterface extends MessageInterface {
    /**
     * @return string
     */
    public function getRequestTarget(): string;

    /**
     * @param mixed $requestTarget
     * @return self
     */
    public function withRequestTarget(mixed $requestTarget): RequestInterface;

    /**
     * @return string Returns the request method.
     */
    public function getMethod(): string;

    /**
     * @param string $method Case-sensitive method.
     * @return self
     * @throws InvalidArgumentException for invalid HTTP methods.
     */
    public function withMethod(string $method): RequestInterface;

    /**
     * @return UriInterface Returns a UriInterface instance representing the URI of the request.
     */
    public function getUri(): UriInterface;

    /**
     * @param UriInterface $uri New request URI to use.
     * @param bool $preserveHost Preserve the original state of the Host header.
     * @return self
     */
    public function withUri(UriInterface $uri, bool $preserveHost = false): RequestInterface;
}
```

License
-------

[](#license)

Copyright 2016 Alexey Maslov

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

```
http://www.apache.org/licenses/LICENSE-2.0

```

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3773d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/950057?v=4)[Alexey Maslov](/maintainers/alxmsl)[@alxmsl](https://github.com/alxmsl)

---

Top Contributors

[![alxmsl](https://avatars.githubusercontent.com/u/950057?v=4)](https://github.com/alxmsl "alxmsl (4 commits)")

---

Tags

httpresponserequestpsrpsr-7http-message

### Embed Badge

![Health badge](/badges/alxmsl-psr-7/health.svg)

```
[![Health](https://phpackages.com/badges/alxmsl-psr-7/health.svg)](https://phpackages.com/packages/alxmsl-psr-7)
```

###  Alternatives

[psr/http-message

Common interface for HTTP messages

7.1k1.0B5.5k](/packages/psr-http-message)[psr/http-factory

PSR-17: Common interfaces for PSR-7 HTTP message factories

1.9k692.9M1.9k](/packages/psr-http-factory)[fig/http-message-util

Utility classes and constants for use with PSR-7 (psr/http-message)

39489.0M271](/packages/fig-http-message-util)[psr/http-server-handler

Common interface for HTTP server-side request handler

175101.3M917](/packages/psr-http-server-handler)[art4/requests-psr18-adapter

Use WordPress/Requests as a PSR-18 HTTP client

153.3k](/packages/art4-requests-psr18-adapter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
