PHPackages                             edounar/phpspec-json-matcher - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. edounar/phpspec-json-matcher

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

edounar/phpspec-json-matcher
============================

PhpSpec matcher 'shouldReturnJson'

1.0.0(11y ago)020MITPHPPHP &gt;=5.3.6

Since Jan 31Pushed 11y ago1 watchersCompare

[ Source](https://github.com/eugene-dounar/phpspec-json-matcher)[ Packagist](https://packagist.org/packages/edounar/phpspec-json-matcher)[ Docs](https://github.com/edounar/phpspec-json-matcher)[ RSS](/packages/edounar-phpspec-json-matcher/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

JSON matcher for [phpspec](https://github.com/phpspec/phpspec)
==============================================================

[](#json-matcher-for-phpspec)

PhpSpec matcher 'shouldReturnJson'.

Usage
-----

[](#usage)

```
class SomeSpec extends ObjectBehavior
{
    it_should_return_json()
    {
        $this->getJson()->shouldReturnJson('
            {
                "items": ['a', 'b', 'c']
            }
        ');
    }
}
```

Run phpspec with `-v` flag to see the difference between actual and expected JSON strings

Installation
------------

[](#installation)

Enable the extension in `phpspec.yml`

```
extensions:
  - EDounar\PhpSpec\JsonMatcher\Extension
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

4116d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/063ddca4c600b2baa87af09a1ffc19feb21f081648402089ab3722d1722024a6?d=identicon)[eugene.dounar](/maintainers/eugene.dounar)

---

Top Contributors

[![eugene-dounar](https://avatars.githubusercontent.com/u/193521?v=4)](https://github.com/eugene-dounar "eugene-dounar (2 commits)")

---

Tags

jsonphpspec

### Embed Badge

![Health badge](/badges/edounar-phpspec-json-matcher/health.svg)

```
[![Health](https://phpackages.com/badges/edounar-phpspec-json-matcher/health.svg)](https://phpackages.com/packages/edounar-phpspec-json-matcher)
```

###  Alternatives

[justinrainbow/json-schema

A library to validate a json schema.

3.6k316.9M608](/packages/justinrainbow-json-schema)[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[jms/serializer

Library for (de-)serializing data of any complexity; supports XML, and JSON.

2.3k135.8M849](/packages/jms-serializer)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M622](/packages/jms-serializer-bundle)[colinodell/json5

UTF-8 compatible JSON5 parser for PHP

30422.2M45](/packages/colinodell-json5)[clue/ndjson-react

Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.

15267.7M16](/packages/clue-ndjson-react)

PHPackages © 2026

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