PHPackages                             devcirclede/attrenv - 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. devcirclede/attrenv

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

devcirclede/attrenv
===================

Library to mark a property or class parseable for EnvReader

0.3.0(3y ago)18[1 issues](https://github.com/vansari/Attrenv/issues)MITPHPPHP ^8.1

Since Mar 13Pushed 3y ago2 watchersCompare

[ Source](https://github.com/vansari/Attrenv)[ Packagist](https://packagist.org/packages/devcirclede/attrenv)[ RSS](/packages/devcirclede-attrenv/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (8)Versions (10)Used By (0)

[![workflow](https://github.com/devcircle-de/Attrenv/actions/workflows/php.yml/badge.svg)](https://github.com/devcircle-de/Attrenv/actions/workflows/php.yml/badge.svg)

Attrenv - Extension for DevCircleDe/EnvReader
=============================================

[](#attrenv---extension-for-devcircledeenvreader)

With the Attrenv you can instantiate classes with Env Variable values.

### Installation

[](#installation)

```
composer require devcirclede/attrenv
```

(It is recommended that you have installed the [EnvReader](https://github.com/devcircle-de/EnvReader).)

### Description

[](#description)

The Parser uses the property name as the ENV Name. But you can also pass a custom ENV Name to the Attribute. Each Parameter/Property must be Type hinted, or you must declare the Type in the EnvironmentValue Attribute.

The EnvironmentValue only supports Types which the [EnvReader](https://github.com/devcircle-de/EnvReader) supports.

If you have created your classes you can automatically load the Values from Env and instantiate your class with the AttributeParser.

#### USAGE

[](#usage)

Usage Attrenv:

```
