PHPackages                             gong023/ayaml - 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. gong023/ayaml

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

gong023/ayaml
=============

utility to convert yaml to array

0.5.2(2y ago)13109.5k3MITPHPPHP &gt;=5.5

Since Dec 24Pushed 2y ago1 watchersCompare

[ Source](https://github.com/gong023/Ayaml)[ Packagist](https://packagist.org/packages/gong023/ayaml)[ RSS](/packages/gong023-ayaml/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (6)Versions (11)Used By (0)

Ayaml
=====

[](#ayaml)

[![Build Status](https://camo.githubusercontent.com/13fba3918fbdcad4cc4e00f6c9adedc2c4e5854e0761792b97c7b8b965c18b9e/68747470733a2f2f7472617669732d63692e6f72672f676f6e673032332f4179616d6c2e737667)](https://travis-ci.org/gong023/Ayaml)[![Coverage Status](https://camo.githubusercontent.com/a825f74c9ff739a1e974f3157a7d0d911795a2d4405f5d058bfe9435c2d14b50/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f676f6e673032332f4179616d6c2e7376673f7374796c653d666c6174)](https://coveralls.io/r/gong023/Ayaml)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e7d676abcc6e1649f43bd69472f976150d540572a47e419d74898ae4c155daac/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f676f6e673032332f4179616d6c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/gong023/Ayaml/?branch=master)

Utility for making Array from Yaml.

Setup
=====

[](#setup)

Install Ayaml

```
composer require --dev gong023/ayaml:0.2.*
```

Register yaml dir in testing bootstrap.php

```
\Ayaml\Ayaml::registerBasePath('/Dir/YamlFile/Exists');
```

Usage
=====

[](#usage)

Basic
-----

[](#basic)

Example yaml file is below.

```
# /Dir/YamlFile/Exists/User.yaml
valid_user:
  id: 1
  name: Taro
  created: 2014-01
valid_user_collection:
  user1:
    id: 1
    name: Taro
    created: 2014-01
  user2:
    id: 2
    name: Jiro
    created: 2014-01
```

You can create array from above yaml file.

```
// plain pattern
Ayaml::file('user')->schema('valid_user')->dump();
=> ['id' => 1, 'name' => 'Taro', 'created' => '2014-01'];

// with overwriting
Ayaml::file('user')->schema('valid_user')->with(['id' => 2, 'name' => 'John'])->dump();
=> ['id' => 2, 'name' => 'John', 'created' => '2014-01'];

// you can get data from nested yaml
Ayaml::file('user')->schema('valid_user_collection.user2')->dump();
=> ['id' => 2, 'name' => 'Jiro', 'created' => '2014-01'];
```

Create Sequential Data
----------------------

[](#create-sequential-data)

You can create sequential data from yaml data type.

```
$validUser = Ayaml::file('user')->schema('valid_user');

// make incremental id sequence.
Ayaml::seq($validUser)->range('id', 10, 12)->byOne()->dump();
=>
[
  ['id' => 10, 'name' => 'Taro', 'created' => '2014-01'],
  ['id' => 11, 'name' => 'Taro', 'created' => '2014-01'],
  ['id' => 12, 'name' => 'Taro', 'created' => '2014-01'],
];

// make decremental id sequence.
Ayaml::seq($validUser)->range('id', 10, 8)->byOne()->dump();
=>
[
  ['id' => 10, 'name' => 'Taro', 'created' => '2014-01'],
  ['id' => 9,  'name' => 'Taro', 'created' => '2014-01'],
  ['id' => 8,  'name' => 'Taro', 'created' => '2014-01'],
]

// you can specify logic.
Ayaml::seq($validUser)->range('id', 10, 12)->by(function($id) { return $id + 2; })->dump();
=>
[
  ['id' => 10, 'name' => 'Taro', 'created' => '2014-01'],
  ['id' => 12, 'name' => 'Taro', 'created' => '2014-01'],
];

// make incremental date sequence.
// you can specify duration 'byDay','byWeek','byMonth','byYear'
Ayaml::seq($validUser)->between('created', '2014-01', '2014-03')->byMonth()->dump();
=>
[
  ['id' => 1, 'name' => 'Taro', 'created' => '2014-01'],
  ['id' => 1, 'name' => 'Taro', 'created' => '2014-02'],
  ['id' => 1, 'name' => 'Taro', 'created' => '2014-03'],
];

// make decremental date sequence.
Ayaml::seq($validUser)->between('created', '2014-03', '2014-01')->byMonth()->dump();
=>
[
  ['id' => 1, 'name' => 'Taro', 'created' => '2014-03'],
  ['id' => 1, 'name' => 'Taro', 'created' => '2014-02'],
  ['id' => 1, 'name' => 'Taro', 'created' => '2014-01'],
];

// make numeric and date column sequential.
Ayaml::seq($validUser)
  ->range('id', 10, 12)->byOne()
  ->between('created', '2014-01', '2014-03')->byMonth()
  ->dump();
=>
[
  ['id' => 10, 'name' => 'Taro', 'created' => '2014-01'],
  ['id' => 11, 'name' => 'Taro', 'created' => '2014-02'],
  ['id' => 12, 'name' => 'Taro', 'created' => '2014-03'],
];
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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 ~351 days

Recently: every ~645 days

Total

10

Last Release

1035d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/034b987bca6692b17b6a5923eca68302fec17cd13f09f8d2f0a45c6d38125c03?d=identicon)[gong023](/maintainers/gong023)

---

Top Contributors

[![gong023](https://avatars.githubusercontent.com/u/1222856?v=4)](https://github.com/gong023 "gong023 (40 commits)")[![ATOM594](https://avatars.githubusercontent.com/u/26355769?v=4)](https://github.com/ATOM594 "ATOM594 (2 commits)")[![axxapy](https://avatars.githubusercontent.com/u/3088476?v=4)](https://github.com/axxapy "axxapy (2 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/gong023-ayaml/health.svg)

```
[![Health](https://phpackages.com/badges/gong023-ayaml/health.svg)](https://phpackages.com/packages/gong023-ayaml)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.5M916](/packages/statamic-cms)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k45](/packages/friendsoftypo3-content-blocks)[flarum/core

Delightfully simple forum software.

201.4M2.2k](/packages/flarum-core)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1155.2k](/packages/rcsofttech-audit-trail-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9317.2k55](/packages/open-dxp-opendxp)[japanese-date/japanese-date

日本の暦、祝日を取り扱うライブラリ

169.9k](/packages/japanese-date-japanese-date)

PHPackages © 2026

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