PHPackages                             sbwerewolf/json-serialize-trait - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sbwerewolf/json-serialize-trait

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sbwerewolf/json-serialize-trait
===============================

Library with trait of ability to output all properties of class-exemplar at call json\_encode()

v1.0.2(1y ago)012.4k↓17.6%5MITPHP

Since Jan 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/SbWereWolf/json-serialize-trait)[ Packagist](https://packagist.org/packages/sbwerewolf/json-serialize-trait)[ RSS](/packages/sbwerewolf-json-serialize-trait/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (5)

JsonSerialize
=============

[](#jsonserialize)

Library with trait of ability to output all properties of class-exemplar at call json\_encode()

How to install
--------------

[](#how-to-install)

`composer require sbwerewolf/json-serialize-trait`

How to use
----------

[](#how-to-use)

To use JsonSerialize you should declare use statement into class

```
use \SbWereWolf\JsonSerializable\JsonSerializeTrait;
```

Example

```
class TraitTest implements JsonSerializable
{
/* Declaration of trait use */
    use \SbWereWolf\JsonSerializable\JsonSerializeTrait;
/* Declaration of class properties */
    private $privateProp = 'privateProp';
    protected $protectedProp = 'protected property value';
    public $publicProp = 'public class member';
}
/* Convert class-exemplar to JSON */
echo json_encode(new TraitTest(),JSON_PRETTY_PRINT);
/*
{
    "privateProp": "privateProp",
    "protectedProp": "protected property value",
    "publicProp": "public class member"
}
*/
```

Contacts
--------

[](#contacts)

```
Volkhin Nikolay
e-mail ulfnew@gmail.com
phone +7-902-272-65-35
Telegram @sbwerewolf

```

Chat with me via messenger

- [Telegram chat with me](https://t.me/SbWereWolf)
- [WhatsApp chat with me](https://wa.me/79022726535)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity47

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

Every ~254 days

Total

3

Last Release

702d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/56415ea6aeceece7248ce372ec911905cab2cd1313ed2bb4ec8cfacdbaa7d08f?d=identicon)[SbWereWolf](/maintainers/SbWereWolf)

---

Top Contributors

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

---

Tags

json-serializationjson-serializerphp-libraryphp-object-to-jsonto-json

### Embed Badge

![Health badge](/badges/sbwerewolf-json-serialize-trait/health.svg)

```
[![Health](https://phpackages.com/badges/sbwerewolf-json-serialize-trait/health.svg)](https://phpackages.com/packages/sbwerewolf-json-serialize-trait)
```

PHPackages © 2026

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