PHPackages                             kafkiansky/option - 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. kafkiansky/option

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

kafkiansky/option
=================

The Option that takes care of what you unwrap.

v0.1.0(2y ago)03MITPHPPHP ^8.1

Since Jul 7Pushed 2y ago1 watchersCompare

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

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

### Option that takes care of what you unwrap.

[](#option-that-takes-care-of-what-you-unwrap)

Requirements
------------

[](#requirements)

- PHP 8.1 or higher.

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

[](#installation)

The package could be installed with composer:

```
composer require kafkiansky/option
```

Motivation
----------

[](#motivation)

Every `Option` pattern implementation I've seen has allowed you to call `unwrap` and get either a value or an exception, which, in my opinion, is no different from calling methods from null. Same behaviour. Same error on production. But what if static analysis would make you check for a value before getting it? No problem.

```
