PHPackages                             waynestate/parse-promos - 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. waynestate/parse-promos

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

waynestate/parse-promos
=======================

Parse promotion arrays from the Wayne State University API

2.0.0(8y ago)036.8k↓50%MITPHPPHP &gt;=7

Since Sep 4Pushed 8y ago2 watchersCompare

[ Source](https://github.com/waynestate/parse-promos)[ Packagist](https://packagist.org/packages/waynestate/parse-promos)[ Docs](http://github.com/waynestate/parse-promos)[ RSS](/packages/waynestate-parse-promos/feed)WikiDiscussions master Synced 1mo ago

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

ParsePromos Class
=================

[](#parsepromos-class)

Parse promotion arrays from the Wayne State University API

[![Latest Stable Version](https://camo.githubusercontent.com/71ff8d591bf4c8f60c22a0ddbc5d07cfb43b6dcc131dbd1d79b9d2fde005271c/68747470733a2f2f706f7365722e707567782e6f72672f7761796e6573746174652f70617273652d70726f6d6f732f762f737461626c652e737667)](https://packagist.org/packages/waynestate/parse-promos)[![Build Status](https://camo.githubusercontent.com/13a3b39b2658a7b33ace8bdf2a673938b65c3c96a2a454aa3b4a08644bf94e01/68747470733a2f2f7472617669732d63692e6f72672f7761796e6573746174652f70617273652d70726f6d6f732e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/waynestate/parse-promos)[![Total Downloads](https://camo.githubusercontent.com/6571f1262a53ee19b321bdf2503733bcc5dd695bc46521014c2ddf0bc2c464f2/68747470733a2f2f706f7365722e707567782e6f72672f7761796e6573746174652f70617273652d70726f6d6f732f646f776e6c6f6164732e737667)](https://packagist.org/packages/waynestate/parse-promos)[![License](https://camo.githubusercontent.com/973adaf3a1bbfded62b0e3865a88ddf0e49f4519d8da7a0911d32025a996b0bc/68747470733a2f2f706f7365722e707567782e6f72672f7761796e6573746174652f70617273652d70726f6d6f732f6c6963656e73652e737667)](https://packagist.org/packages/waynestate/parse-promos)

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

[](#installation)

To install this library, run the command below and you will get the latest version

```
composer require waynestate/parse-promos

```

Usage
-----

[](#usage)

Create the object

```
use Waynestate\Promotions\ParsePromos;

...

$parsePromos = new Waynestate\Promotions\ParsePromos();
```

Make an API call for promotions

```
// Promotion groups to pull ( id => short_name )
$group_reference = [
    123 => 'circle',
    124 => 'alumni-links',
    125 => 'contact',
    126 => 'progress-amount',
    127 => 'progress-text',
];

// How to parse each group after the return ( short_name => config_option )
$group_config = [
    'contact' => 'first',
    'progress-amount' => 'limit:1',
    'progress-text' => 'randomize|first',
];

// Pull all the active items from the API
$params = [
    'promo_group_id' => array_keys($group_reference),
    'is_active' => '1',
    'ttl' => TTL,
];

// Get the raw promotions from the API
$raw_promos = $api->sendRequest('cms.promotions.listing', $params);

// Parse the promotions based on the config set
$parsed_promos = $parsePromos->parse($raw_promos, $group_reference, $group_config);
```

Config options

```
'first' = Return only the first item in the list (not part of an array)
'randomize' = Take the returned list and mix it up
'limit:#' = Return just # number of results from the list
'order:start_date_desc' = Return an ordered list by 'start_date' DESC
'order:start_date_asc' = Return an ordered list by 'start_date' ASC
'order:display_date_desc' = Return an ordered list by 'display_date' DESC
'order:display_date_asc' = Return an ordered list by 'display_date' ASC
'order:title_desc' = Return an ordered list by 'title' DESC
'order:title_asc' = Return an ordered list by 'title' ASC
'page_id:#' = Return only promotions in the list marked for this page
'youtube' = Parse the 'link' field for YouTube video ID, place in a new 'video_id' field

'order:start_date_desc|first' = Options can be run in combination by piping to another config

```

Tests

```
phpunit

```

Code Coverage

```
phpunit --coverage-html ./coverage

```

###  Health Score

36

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% 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 ~107 days

Recently: every ~130 days

Total

13

Last Release

2978d ago

Major Versions

0.2.0 → 1.0.02016-02-19

1.2.0 → 2.0.02018-03-14

PHP version history (3 changes)0.0.1PHP &gt;=5.3.0

1.1.0PHP &gt;=5.4.0

2.0.0PHP &gt;=7

### Community

Maintainers

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

---

Top Contributors

[![nickdenardis](https://avatars.githubusercontent.com/u/37359?v=4)](https://github.com/nickdenardis "nickdenardis (72 commits)")[![robertvrabel](https://avatars.githubusercontent.com/u/634788?v=4)](https://github.com/robertvrabel "robertvrabel (8 commits)")[![chrispelzer](https://avatars.githubusercontent.com/u/636531?v=4)](https://github.com/chrispelzer "chrispelzer (4 commits)")

---

Tags

arrayparse

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/waynestate-parse-promos/health.svg)

```
[![Health](https://phpackages.com/badges/waynestate-parse-promos/health.svg)](https://phpackages.com/packages/waynestate-parse-promos)
```

###  Alternatives

[doctrine/collections

PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.

6.0k411.1M1.2k](/packages/doctrine-collections)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)[openlss/lib-array2xml

Array2XML conversion library credit to lalit.org

31052.5M47](/packages/openlss-lib-array2xml)

PHPackages © 2026

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