PHPackages                             fullkawa/line-at-cost - 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. fullkawa/line-at-cost

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

fullkawa/line-at-cost
=====================

LINE@ cost estimating library

1.0.0(7y ago)08MITPHPPHP &gt;=5.5.9

Since Dec 22Pushed 7y agoCompare

[ Source](https://github.com/fullkawa/line-at-cost)[ Packagist](https://packagist.org/packages/fullkawa/line-at-cost)[ RSS](/packages/fullkawa-line-at-cost/feed)WikiDiscussions master Synced 4d ago

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

line-at-cost
============

[](#line-at-cost)

[![Build Status](https://camo.githubusercontent.com/ed742dc962e47d23ab07a632c26eeb86b918cc81caa25847c626541e922d6515/68747470733a2f2f7472617669732d63692e6f72672f66756c6c6b6177612f6c696e652d61742d636f73742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/fullkawa/line-at-cost)

Line@ cost(not including tax) estimating library

日本語ドキュメントを希望する方は[こちら](https://qiita.com/fullkawa/items/20b1790a9991996a91ea)をご覧ください。

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

[](#installation)

`composer require fullkawa/line-at-cost`

Usage
-----

[](#usage)

### For current plan

[](#for-current-plan)

```
use LineAtCost\PlanFactory;
use LineAtCost\Estimator;

$factory = new PlanFactory();

$plan_free = $factory->getInstance(1); // Free plan
$cost_free = Estimator::estimate($plan_free);
$this->assertEquals(0, $cost_free);

$plan_basic = $factory->getInstance(2); // Basic plan
$cost_basic = Estimator::estimate($plan_basic);
$this->assertEquals(5000, $cost_basic);

$plan_pro = $factory->getInstance(4); // Pro plan
$cost_pro = Estimator::estimate($plan_pro);
$this->assertEquals(30000, $cost_pro);

```

### For 2019 spring~ plan

[](#for-2019-spring-plan)

```
use LineAtCost\PlanFactory;
use LineAtCost\Estimator;

$factory = new PlanFactory(PlanFactory::TARGET_2019);

$plan_free = $factory->getInstance(1); // Free plan
$usages_free = ['message_count' => 1000];
$cost_free = Estimator::estimate($plan_free, $usages_free);
$this->assertEquals(0, $cost_free);

$plan_light = $factory->getInstance(2); // Light plan
$usages_light = ['message_count' => 16000];
$cost_light = Estimator::estimate($plan_light, $usages_light);
$this->assertEquals(10000, $cost_light);

$plan_standard = $factory->getInstance(3); // Standard plan
$usages_standard = ['message_count' => 145000];
$cost_standard = Estimator::estimate($plan_standard, $usages_standard);
$this->assertEquals(305000, $cost_standard);

```

### Other usage

[](#other-usage)

```
use LineAtCost\PlanFactory;
use LineAtCost\Estimator;

$factory = new PlanFactory(PlanFactory::TARGET_ALL);

$plan_2016free = $factory->getInstance(PlanFactory::PLAN2016FREE_ID);
$cost_2016free = Estimator::estimate($plan_2016free);
$this->assertEquals(0, $cost_2016free);

$plan_2019light = $factory->getInstance(PlanFactory::PLAN2019LIGHT_ID);
$usages_2019light = ['message_count' => 16000];
$cost_2019light = Estimator::estimate($plan_2019light, $usages_2019light);
$this->assertEquals(10000, $cost_2019light);

```

Reference
---------

[](#reference)

```
class PlanFactory
{
    const TARGET_ALL = 0;

    /**
     * 2016年6月からの料金プランのみ
     * @var integer
     */
    const TARGET_2016 = 10;

    const PLAN2016FREE_ID = 11; // フリー
    const PLAN2016BASIC_ID = 12; // ベーシック
    const PLAN2016PRO_ID = 13; // プロ(月額21,600円(税込))
    const PLAN2016PRO2_ID = 14; // プロ(月額32,400円(税込))
    const PLAN2016DEVELOPER_ID = 19; // Developer Trial

    /**
     * 2019年春からの料金プランのみ
     * @var integer
     */
    const TARGET_2019 = 20;

    const PLAN2019FREE_ID = 21; // フリー
    const PLAN2019LIGHT_ID = 22; // ライト
    const PLAN2019STANDARD_ID = 23; // スタンダード

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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

Unknown

Total

1

Last Release

2702d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c62998cb8382aa511cabd3bf8ce7b16bab18ed709b0699c81c364c9a7906bc1?d=identicon)[fullkawa](/maintainers/fullkawa)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fullkawa-line-at-cost/health.svg)

```
[![Health](https://phpackages.com/badges/fullkawa-line-at-cost/health.svg)](https://phpackages.com/packages/fullkawa-line-at-cost)
```

###  Alternatives

[apen/additional_reports

Useful information in the reports module : xclass, ajax, cliKeys, eID, general status of the system (encoding, DB, php vars...), hooks, compare local and TER extension (diff), used content type, used plugins, ExtDirect... It can really help you during migration or new existing project (to have a global reports of the system).

14157.8k](/packages/apen-additional-reports)

PHPackages © 2026

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