PHPackages                             hampom/bari-kata - 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. hampom/bari-kata

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

hampom/bari-kata
================

Map

0.0.2(8mo ago)021MITPHPPHP &gt;=8.2

Since Sep 14Pushed 5mo agoCompare

[ Source](https://github.com/hampom/BariKata)[ Packagist](https://packagist.org/packages/hampom/bari-kata)[ RSS](/packages/hampom-bari-kata/feed)WikiDiscussions main Synced today

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

BariKata(バリ型)
=============

[](#barikataバリ型)

🍜 型安全・配列禁止を徹底した PHP コレクションライブラリ 「BariKata」は **TypedCollection** を中心に設計され、プラグイン拡張やファクトリーによる標準セット化が可能です。

特徴
--

[](#特徴)

- **型安全なコレクション**
    指定したクラス以外は格納できません。 ArrayAccess で自然に操作可能。
- **プラグイン拡張**
    map, filter, orderBy などの操作を簡単に追加できます。
- **Factory**
    あらかじめ定義したプラグインセットを有効化した状態でコレクションを生成可能。

インストール
------

[](#インストール)

```
composer require hampom/bari-kata
```

使い方
---

[](#使い方)

### TypedCollection の生成

[](#typedcollection-の生成)

```
use Hampom\BariKata\TypedCollection;

$ids = new TypedCollection('int');
$ids[] = 1;
$ids[] = 2;

// -> InvalidArgumentException: Value must be of type int, string given.
// $ids[] = 'a';
```

### プラグインの追加

[](#プラグインの追加)

```
use Hampom\BariKata\TypedCollection;
use Hampom\BariKata\Plugins\toArray;

$ids = new TypedCollection('int', [0], [new toArray]);
$ids[] = 1;

// -> array(0 => 0, 1 => 1)
var_export($ids->toArray());
```

### ファクトリーの利用

[](#ファクトリーの利用)

```
final class IntCollectionFactory extends TypedCollectionFactory
{
    protected static string $type = 'int';

    protected static function plugins(): array
    {
        return [
            ["class" => toArray::class]
        ];
    }
}

$ids = (new IntCollectionFactory)->factory([0]);
$ids[] = 1;

// -> array(0 => 0, 1 => 1)
var_export($ids->toArray());
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance65

Regular maintenance activity

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~40 days

Total

2

Last Release

251d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/761915?v=4)[anazawa yasuhiro](/maintainers/hampom)[@hampom](https://github.com/hampom)

---

Top Contributors

[![hampom](https://avatars.githubusercontent.com/u/761915?v=4)](https://github.com/hampom "hampom (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hampom-bari-kata/health.svg)

```
[![Health](https://phpackages.com/badges/hampom-bari-kata/health.svg)](https://phpackages.com/packages/hampom-bari-kata)
```

###  Alternatives

[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[setono/editorjs-php

PHP library for handling data from the EditorJS

4361.4k3](/packages/setono-editorjs-php)[n1ebieski/ksef-php-client

PHP API client that allows you to interact with the API Krajowego Systemu e-Faktur

9067.8k](/packages/n1ebieski-ksef-php-client)[eliashaeussler/cache-warmup

Composer package to warm up website caches, based on a given XML sitemap

76433.8k11](/packages/eliashaeussler-cache-warmup)[integer-net/magento2-sansec-watch

Sansec Watch integration for Magento 2

40206.6k](/packages/integer-net-magento2-sansec-watch)[cpsit/project-builder

Composer package to create new projects from project templates

2639.3k3](/packages/cpsit-project-builder)

PHPackages © 2026

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