PHPackages                             nicklewis/mapping - 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. nicklewis/mapping

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

nicklewis/mapping
=================

This is a way of providing a mappable interface to specific parts of your code for the purpose of reports / integrations

05PHP

Since Mar 27Pushed 10y ago1 watchersCompare

[ Source](https://github.com/nickle799/Mapping)[ Packagist](https://packagist.org/packages/nicklewis/mapping)[ RSS](/packages/nicklewis-mapping/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Mapping
=======

[](#mapping)

This is a way of providing a mappable interface to specific parts of your code for the purpose of reports / integrations

Language
========

[](#language)

- A parsing is made up of parts.
- A part is defined as a set of code that can be individually parsed. This can be a direct string, or a series of methods on an object
- These parts can be combined together using the + operator
- If a part starts and ends with double quotes, it is parsed as directly that string
    - eg: "John"+"Smith" will be parsed as two parts, and then combined together to make JohnSmith
- Otherwise, a part must be a defined in the mappable fields on the current object
- You can traverse down related mappable fields with the . operator
    - eg: if you start with a mouse object: computer.room.house.address.city would return the city
- You can also parameters, if they are defined with the mappable field
- eg: computer.room.relatedRoom("below") will get you the room below the mouse's room
- These sub parameters will each be parsed similar to how the original object is parsed, and then the final output will be passed in
    - eg: computer.room.relatedRoom(computer.setting("roomDirection")) will get you the room based off of the computers current roomDirection setting
- As you can see, these parsings can be nested
- If there is more than one parameter, there should be a comma in between (spaces are optional)
    - eg: computer.room.relatedRoom("below", "2") will get you the room two floors below

Built in Methods
----------------

[](#built-in-methods)

### These methods are always available (Provided they apply to the given current data)

[](#these-methods-are-always-available-provided-they-apply-to-the-given-current-data)

- date("m/d/Y")
    - Parameters
        - Format (Required)
    - This uses the  to format a date object
- map("compareAgainst", "output", ..{2})
    - Parameters
        - Check Against (Required)
        - Parse (Required)
        - Arguments must come in pairs
    - It will compare against the first of each pair
    - if it matches the first part, it will parse the second part use that as the current object
    - If the checkAgainst is the parsed as "\*" this is considered the wildcard option, and if no other option matches is used
    - If you put a \* anywhere in the string (other than being the entire string) it is parsed as a wildcard, with any characters valid
        - eg: abc\*ghi will match abcdefghi, abcghi, and abc123ghi
    - This is a case sensitive match, so you might wish to run a toLowerCase() first
- add("5")
    - Parameters
        - value (Required)
    - This will add a value to the current value
- subtract("5")
    - Parameters
        - value (Required)
    - This will add a value to the current value
- multiply("5")
    - Parameters
        - value (Required)
    - This will add a value to the current value
- divide("5")
    - Parameters
        - value (Required)
    - This will add a value to the current value
- ifThen("true", "false")
    - Parameters
        - trueOption (Optional) defaults to the string of "Yes"
        - falseOption (optional) defaults to the string of "No"
- not()
    - Parameters (None)
    - Converts a true statement to false, and a false to true
- toLowerCase()
    - Parameters (None)
    - Converts to a lower case string
- toUpperCase()
    - Parameters (None)
    - Converts to a upper case string
- lessThan("6")
    - Parameters
        - value (Required)
    - Compares against the passed in value, and returns if the current one is lessThan or not
- greaterThan("6")
    - Parameters
        - value (Required)
    - Compares against the passed in value, and returns if the current one is greaterThan or not
- substring("5", "6")
    - Parameters
        - start (Required)
        - length (Optional)
    - See
    - Values can be negative
- trim(" ")
    - Parameters
        - characterMask (Optional)
    - See
- round("2")
    - Parameters
        - precision (Optional) Defaults to 0
- leftFill("5", "0")
    - Parameters
        - length (Required) The length to fill the string to
        - fill (Required) The padding string
    - This adds characters to the left side of the string
- rightFill("5", " ")
    - Parameters
        - length (Required) The length to fill the string to
        - fill (Required) The padding string
    - This adds characters to the right side of the string
- in("a", "b")
    - Parameters
        - comparison (Required)
        - There must be at least one
    - Returns a boolean that can then be piped into .ifThen
- count()
    - Parameters (None)
    - Returns the size of an array if the current object is an array
- filter(in("abc"))
    - Parameters
        - A sub parse to be ran on each value of the array
    - Filters a list to be a smaller subset of those that pass the requirements
- itemAt("1")
    - Parameters
        - index (Required)
    - Gets an item at a specified index if the current object is an array
    - Index starts at 0

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d8d8eb8fd2da8f01a014b7963fb5b975c6a648655605b65b343629ed9eee115c?d=identicon)[nickle799](/maintainers/nickle799)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/nicklewis-mapping/health.svg)

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

###  Alternatives

[trentrichardson/jquery-timepicker-addon

Adds a timepicker to jQueryUI Datepicker.

2.6k70.2k](/packages/trentrichardson-jquery-timepicker-addon)[vsn4ik/bootstrap-checkbox

A checkbox component based on Bootstrap framework

2109.0k3](/packages/vsn4ik-bootstrap-checkbox)

PHPackages © 2026

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