PHPackages                             amitjoc/breakify - 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. [CLI &amp; Console](/categories/cli)
4. /
5. amitjoc/breakify

ActiveLibrary[CLI &amp; Console](/categories/cli)

amitjoc/breakify
================

Handle new line or line break across different platform (windows, unix, mac) and envirnoment like web, cli

v0.1.0(8mo ago)07[2 issues](https://github.com/amitjoc/breakify/issues)[1 PRs](https://github.com/amitjoc/breakify/pulls)MITPHPPHP &gt;=7.4CI passing

Since Oct 30Pushed 4mo agoCompare

[ Source](https://github.com/amitjoc/breakify)[ Packagist](https://packagist.org/packages/amitjoc/breakify)[ RSS](/packages/amitjoc-breakify/feed)WikiDiscussions master Synced today

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

Breakify
========

[](#breakify)

Breakify is a lightweight PHP utility for managing and transforming line breaks across platforms and formats. Whether you're normalizing text input, preparing content for HTML output, or ensuring consistent formatting in logs or CLI tools, Breakify offers a clean, expressive API to handle it all.

Author
======

[](#author)

**Amit Joshi**
Backend Developer | PHP &amp; JavaScript Specialist
GitHub: [@amitjoc](https://github.com/amitjoc)
LinkedIn: [@amitjoc](https://www.linkedin.com/in/amitjoc/)

[![PHP Version](https://camo.githubusercontent.com/ce0c70c519047d0e507604f03e6e8ae6c27bcc072027e899680d9bf93804dc76/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e342532422d626c7565)](https://camo.githubusercontent.com/ce0c70c519047d0e507604f03e6e8ae6c27bcc072027e899680d9bf93804dc76/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e342532422d626c7565)[![License](https://camo.githubusercontent.com/4eed2ae27a380e671945205d5520763a89b0e81eeb893e66911d775a7e53e9f0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f616d69746a6f632f627265616b696679)](https://camo.githubusercontent.com/4eed2ae27a380e671945205d5520763a89b0e81eeb893e66911d775a7e53e9f0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f616d69746a6f632f627265616b696679)[![Build Status](https://camo.githubusercontent.com/400a629e261045b054a7860a015a8f382b473372655a2577f4ca911a0e1202a5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616d69746a6f632f627265616b6966792f7068702e796d6c)](https://camo.githubusercontent.com/400a629e261045b054a7860a015a8f382b473372655a2577f4ca911a0e1202a5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616d69746a6f632f627265616b6966792f7068702e796d6c)[![Code Style](https://camo.githubusercontent.com/5beafc293f0d1aba699b808c56e9889e59505c75185a86d4605202cc4e393a32/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d50535231322d677265656e)](https://camo.githubusercontent.com/5beafc293f0d1aba699b808c56e9889e59505c75185a86d4605202cc4e393a32/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d50535231322d677265656e)[![Issues](https://camo.githubusercontent.com/50e9fdb3ebbd9d427b44fab46d8818afe15267f4c4c52d31f1713442cb9fa957/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f616d69746a6f632f627265616b696679)](https://camo.githubusercontent.com/50e9fdb3ebbd9d427b44fab46d8818afe15267f4c4c52d31f1713442cb9fa957/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f616d69746a6f632f627265616b696679)[![Stars](https://camo.githubusercontent.com/1e65f62019c072b6e0542680ac7fe390d63b219fa29b93b923e7c5804d5600aa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f616d69746a6f632f627265616b6966793f7374796c653d736f6369616c)](https://camo.githubusercontent.com/1e65f62019c072b6e0542680ac7fe390d63b219fa29b93b923e7c5804d5600aa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f616d69746a6f632f627265616b6966793f7374796c653d736f6369616c)

Table of Contents
=================

[](#table-of-contents)

- [Author](#author)
- [Installation](#installation)
- [Environment](#environment)
- [Feature List](#feature-list)
- [Examples](#example-for-web)
- [CLI Usage](#example-for-cli)
- [Task List](#task-list)
- [Coding Standards](#coding-standard)

Installation
============

[](#installation)

> Download the Breakify library

```
 composer require amitjoshi/breakify
```

> Include composer `autoload` file

```
 include_once dirname(__DIR__) . "/vendor/autoload.php";
```

> Create a Breakify object

```
  $web = new Breakify();
```

Environment
===========

[](#environment)

- `WEB`: Use when a script runs only in browser-based environments.
- `CLI`: Use when a script runs only in command-line environments.
- `BOTH`: Use when the environment is dynamic or unknown.

Feature List
============

[](#feature-list)

- [Web Example](#example-for-web) and [CLI Example](#example-for-cli)
- `beap()` (bell sound for CLI)
- Normalize or convert line breaks across different platforms `(Windows \r\n, Unix \n, Mac \r)`
- Handle other `escape character` too for cli (`in progress`)

Example for WEB
---------------

[](#example-for-web)

When we already know that our `script` only executed on `WEB` environment

- print `br tag`

```
  $web = new Breakify()
  $web->pbr();        // OUTPUT: Print's `break tag` directly
  $web->phr();        // OUTPUT:
  $web->phrDashed();  // OUTPUT: -------
  $web->phrDotted();  // OUTPUT: .......
  $web->phrRidge();   // OUTPUT: _______
  $web->phrDouble();  // OUTPUT: =======
```

Example for CLI
---------------

[](#example-for-cli)

When we already know that our `script` only executed on `cli` environment

```
$cliBreak = new Breakify();

$cliBreak->getLineBreak()   //  returns `PHP_EOL`
$cliBreak->pNewLine()       //  echoes single line break
$cliBreak->pNewLine(true)   //  echoes double line break
```

- print carriage return also `\r`
- print text withing the box with desired character like —, = (in progress)
- Make a bell sound `beap()` from php (available only in cli mode)

Important

1. `functions` with `p` prefix directly give output like `pbr()`,`phr()`,`pLineBreak()`

Task List
=========

[](#task-list)

Default
-------

[](#default)

- `CLI`: Default `LineBreak` is set to `PHP_EOL`
- `WEB`: Default `LineBreak` is ``

Functions
---------

[](#functions)

- `isCliEnv()` function will check is execution environment. return `true` for cli else `false`
- `exeEnvType()` Type `WEB | CLI`. it will return the output accordingly

Functions for `web`
-------------------

[](#functions-for-web)

- print break tag `pbr()`
- print horizontal tag `phr()`
- print `dashed line` use function `phrDashed()`
- print `dotted line` use function `phrDotted()`
- print `ridge line` use function `phrRidge()`
- print `double line` use function `phrDouble()`
- custom hr line width and height and center also with in build stylesheet

Coding Standard
---------------

[](#coding-standard)

- PSR 4 or PSR12

CHANGES
-------

[](#changes)

- namespace updated to `LineBreak\\`
- made breakify class final
-

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance70

Regular maintenance activity

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 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

245d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/34548066?v=4)[Er. Amit Joshi](/maintainers/amitjoc)[@amitjoc](https://github.com/amitjoc)

---

Top Contributors

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

---

Tags

cmdcommand-linephp7php8powershellshell

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/amitjoc-breakify/health.svg)

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

###  Alternatives

[illuminate/console

The Illuminate Console package.

13046.0M6.5k](/packages/illuminate-console)[styleci/cli

The CLI tool for StyleCI

71470.5k9](/packages/styleci-cli)[winbox/args

Windows command-line formatter

20720.9k21](/packages/winbox-args)[tomatophp/filament-artisan

Simple but yet powerful library for running some artisan commands for FilamentPHP

3275.4k1](/packages/tomatophp-filament-artisan)

PHPackages © 2026

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