PHPackages                             kdyby/strict-objects - 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. kdyby/strict-objects

ActiveLibrary

kdyby/strict-objects
====================

Simple trait to make your class strict, when calling or accessing undefined member (property or method).

v2.0.1(5y ago)321.7M—0.9%1118BSD-3-ClausePHPPHP ^7.1

Since Mar 29Pushed 2y ago5 watchersCompare

[ Source](https://github.com/Kdyby/StrictObjects)[ Packagist](https://packagist.org/packages/kdyby/strict-objects)[ Docs](http://kdyby.org)[ RSS](/packages/kdyby-strict-objects/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (8)Used By (18)

Kdyby/StrictObjects
===================

[](#kdybystrictobjects)

Simple set of traits to make your classes strict, when calling or accessing an undefined member (property or method).

[![Build Status](https://camo.githubusercontent.com/69ee9297ef0ed4a1e7bdccd669e2583cccc2316627ff0e16d8de335d5fb8a457/68747470733a2f2f7472617669732d63692e6f72672f4b647962792f5374726963744f626a656374732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Kdyby/StrictObjects)[![Downloads this Month](https://camo.githubusercontent.com/31d6101fde2e378f52b9bcb21a47e4ffbb79c462df7dac1aa0bea0e7a321691e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6b647962792f7374726963742d6f626a656374732e737667)](https://packagist.org/packages/kdyby/strict-objects)[![Latest stable](https://camo.githubusercontent.com/e5c63dff1a19a7ffd90c1ff53204408df6576339dbcb45808c2532526c5946c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b647962792f7374726963742d6f626a656374732e737667)](https://packagist.org/packages/kdyby/strict-objects)[![Coverage Status](https://camo.githubusercontent.com/f5069fdffd1ef49b5afb91aab7d552f35f7c60b7801b31eb5896859c08652b89/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4b647962792f5374726963744f626a656374732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Kdyby/StrictObjects?branch=master)

This library is heavily inspired by [`Nette\ObjectMixin`](https://github.com/nette/utils/blob/e8749e5417bf22b0bd999d4b49ee799a5bad5fb9/src/Utils/ObjectMixin.php).

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

[](#installation)

The best way to install Kdyby/StrictObjects is using [Composer](https://getcomposer.org/):

```
composer require kdyby/strict-objects
```

Usage
-----

[](#usage)

Simply include the trait in your class and it will behave strictly!

```
use Kdyby\StrictObjects\Scream;

class MyClass
{
    use Scream;

    // my code
}
```

If you for some reason can't or don't want to make all undefined property and method access strict, you can enable the behavior selectively by using specific traits:

- `Kdyby\StrictObjects\PropertyReadScreamer`: Will throw when attempting to read an undeclared property.
- `Kdyby\StrictObjects\PropertyWriteScreamer`: Will throw when attempting to write to an undeclared property.
- `Kdyby\StrictObjects\PropertyExistsScreamer`: Will throw when attempting to check existence of an undeclared property.
- `Kdyby\StrictObjects\PropertyRemovalScreamer`: Will throw when attempting to unset an undeclared property.
- `Kdyby\StrictObjects\InstanceMethodCallScreamer`: Will throw when attempting to call an undefined instance method.
- `Kdyby\StrictObjects\StaticMethodCallScreamer`: Will throw when attempting to call an undefined static method.

For convenience, there are also:

- `Kdyby\StrictObjects\PropertyScreamer`: Combines all property access, will throw on any interaction.
- `Kdyby\StrictObjects\MethodCallScreamer`: Combines both method call types, will throw for all methods.
- `Kdyby\StrictObjects\Scream` combines all screamers into one.

---

Homepage  and repository .

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 65.3% 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 ~344 days

Recently: every ~393 days

Total

6

Last Release

1980d ago

Major Versions

v0.1 → v1.0.02016-08-26

v1.0.0 → v2.0.02019-03-21

1.0.x-dev → 2.0.x-dev2020-12-16

PHP version history (3 changes)v0.1PHP &gt;=5.4

v2.0.0PHP ^7.1

1.0.x-devPHP ^5.6 || 7.0.\*

### Community

Maintainers

![](https://www.gravatar.com/avatar/bd7915237f7e5a3e6bbdee4345a36d355f0fd440362b2cecd4d705edda023c92?d=identicon)[fprochazka](/maintainers/fprochazka)

---

Top Contributors

[![fprochazka](https://avatars.githubusercontent.com/u/158625?v=4)](https://github.com/fprochazka "fprochazka (32 commits)")[![Majkl578](https://avatars.githubusercontent.com/u/144181?v=4)](https://github.com/Majkl578 "Majkl578 (15 commits)")[![enumag](https://avatars.githubusercontent.com/u/539462?v=4)](https://github.com/enumag "enumag (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

exceptionsobjectmemberspropertieskdybystrictmethodsmagicaccessorsscream

### Embed Badge

![Health badge](/badges/kdyby-strict-objects/health.svg)

```
[![Health](https://phpackages.com/badges/kdyby-strict-objects/health.svg)](https://phpackages.com/packages/kdyby-strict-objects)
```

###  Alternatives

[myclabs/deep-copy

Create deep copies (clones) of your objects

8.9k849.8M169](/packages/myclabs-deep-copy)[doctrine/persistence

The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.

4.1k286.5M762](/packages/doctrine-persistence)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[bugsnag/bugsnag-laravel

Official Bugsnag notifier for Laravel applications.

90334.6M36](/packages/bugsnag-bugsnag-laravel)[doctrine/mongodb-odm

PHP Doctrine MongoDB Object Document Mapper (ODM) provides transparent persistence for PHP objects to MongoDB.

1.1k23.3M302](/packages/doctrine-mongodb-odm)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)

PHPackages © 2026

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