PHPackages                             eyroot/lx-utils - 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. eyroot/lx-utils

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

eyroot/lx-utils
===============

A collection of various php utils

1.2.2(7y ago)3133[2 issues](https://github.com/eyroot/lx-utils/issues)[2 PRs](https://github.com/eyroot/lx-utils/pulls)GPL-3.0-onlyPHPCI passing

Since Aug 3Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/eyroot/lx-utils)[ Packagist](https://packagist.org/packages/eyroot/lx-utils)[ RSS](/packages/eyroot-lx-utils/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (1)Versions (8)Used By (0)

lx-utils
========

[](#lx-utils)

**Code Clean Up**

Recursively clean up all files in a PHP project by assigning clean up tasks. Clean up tasks available:

- add/remove custom doc block headers for PHP files
- clean up undefined constants in array square brakets
    - beginning with PHP 7.2 unquoted array keys produce the Warning "Use of undefined constant ..." and in future versions this will trigger a hard error)
    - automatically quote all strings which are undefined constants used inside square brackets as array keys
    - old style array usage like $a\[key1\] will be automatically transformed into $a\['key1'\]
    - also parse and compute a list of defined constants in the project/root path specified, and whitelist them them for usage without quotes as array keys
    - add curly brackets around arrays used inside double quote and heredoc string definitions

Notice
------

[](#notice)

- It's recommended to run it for your project on DEV first, check functionality and then push to LIVE.
- When running on a real project, it's a good idea to backup the project files first, just to be sure that what you are doing matches what you're expecting.

Usage
-----

[](#usage)

- Install

```
git clone https://github.com/eyroot/lx-utils lx-utils
cd lx-utils
composer install --no-dev

```

- Console command

```
$ php run/cleanUpSquareBrackets.php /path/you/want/to/clean/up

```

- Project/Library

```
use Lx\Utils\CodeCleanUp\CodeCleanUp;

$result = (new CodeCleanUp())
    ->addFilePath($pathToCleanUp)
    ->addFileExtension('php')
    ->addTask(CodeCleanUp::TASK_QUOTE_UNDEFINED_CONSTANTS_IN_SQUARE_BRACKETS)
    ->run()
;

// Available information:
// $result->filesChanged - list of files which were changed
// $result->errors - list of errors

```

Development set-up
------------------

[](#development-set-up)

- Clone project locally:

```
git clone https://github.com/eyroot/lx-utils lx-utils
cd lx-utils

```

- Set-up project and install composer deps:

```
composer install

```

- Run unit testing:

```
mkdir -p testing/data/Utils/tmp
cd testing/
../vendor/bin/phpunit

```

- Check the code coverage of tests by opening in browser:

```
file:///tmp/coverage-lx-utils/index.html

```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance44

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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 ~80 days

Total

5

Last Release

2568d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12270802?v=4)[ionut](/maintainers/eyroot)[@eyroot](https://github.com/eyroot)

---

Top Contributors

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

---

Tags

phputils

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/eyroot-lx-utils/health.svg)

```
[![Health](https://phpackages.com/badges/eyroot-lx-utils/health.svg)](https://phpackages.com/packages/eyroot-lx-utils)
```

PHPackages © 2026

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