PHPackages                             smuuf/strict-object - 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. smuuf/strict-object

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

smuuf/strict-object
===================

Just a simple strict-object trait.

1.0.1(5y ago)06532MITPHPPHP ^7.4|^8

Since Jan 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/smuuf/php-strict-object)[ Packagist](https://packagist.org/packages/smuuf/strict-object)[ RSS](/packages/smuuf-strict-object/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (2)

Strict Objects for PHP 🌻
========================

[](#strict-objects-for-php-)

[![PHP tests](https://github.com/smuuf/php-strict-object/workflows/PHP%20tests/badge.svg)](https://github.com/smuuf/php-strict-object/workflows/PHP%20tests/badge.svg)

Avoid annoying problems caused by PHP being too lax when dealing with undeclared object properties. Let's be more strict. Don't let typos in property names ruin your day ever again. 🌞

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

[](#installation)

```
composer require smuuf/strict-object
```

Usage
-----

[](#usage)

Simple, just `use` the `\Smuuf\StrictObject` trait in your class to make it strict - and to **throw `\LogicException`** when someone tries to **read** or to **write** to an **undeclared property**.

```
