alathazal / starforged-php
A generic PHP wrapper that loads the JSON data files provided by the alathazal/starforged-data package, to provide them as standard PHP array resources.
Requires
- php: ^8.4
- alathazal/starforged-data: ^1.0
Requires (Dev)
- pestphp/pest: ^5.1
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-12 08:12:12 UTC
README
The starforged-php package is a generic PHP wrapper that loads the JSON data files provided by the alathazal/starforged-data package, to provide them as standard PHP array resources.
Usage
To install the starforged-php package using composer, run the following at the command line in your project folder.
composer require alathazal/starforged-php
You can access the varoius datasets using the getData() method, used in conjuction with the DataTypes enumerator
to select which dataset you're looking for.
OR
There is a helper, shortcut method setup for each dataset that can be called by name.
use Alathazal\StarforgedData\DataTypes; use Alathazal\StarforgedPhp\StarforgedPhp; $starforged = new StarforgedPhp(); // using a named dataset. $truths = $starforged->getData(DataTypes::TRUTHS); // using a named shortcut method. $assets = $starforged->assets(); $asset_types = $starforged->asset_types(); $encounters = $starforged->encounters(); $move_categories = $starforged->move_categories(); $moves = $starforged->moves(); $oracles = $starforged->oracles(); $truths = $starforged->truths();
Testing
Testing for this package is done through a suite of PEST tests, that checks that the data files are parsed properly and that the endpoints for this repository all return data in arrays as expected. These tests can be found in the tests/ folder of the project and can be run using:
composer test
License
MIT License
Copyright (c) 2026 Alathazal
For specific information regarding this license, please see the LICENSE.md file.