Sekolah Tinggi Teknologi Wastukancana Student ID (NIM) Parser.
- PHP
>= 7.4(tested on 7.4, 8.0, 8.1, 8.2, 8.3) - Composer v2
- cURL
>= 7.19.4
Install the package with:
composer require wastukancana/nim<?php
use Wastukancana\Nim;
use Exception;
require __DIR__ . '/vendor/autoload.php';
try {
$nim = new Nim('211351143');
var_dump($nim->dump());
} catch (Exception $e) {
echo $e->getMessage();
}Example dump without provider (name/gender/isGraduated null):
$student = (new Nim('211351143'))->dump();
/* object(Wastukancana\Student) {
nim: "211351143",
name: null,
gender: null,
isGraduated: null,
admissionYear: 2021,
study: "Teknik Informatika",
educationLevel: "S1",
firstSemester: 1,
sequenceNumber: 143
} */You can enrich student data by plugging one optional provider class (FQCN). Without a provider, only parser-derived fields are available (year, study, level, semester, sequence). Fields like name, gender, and graduation status will be null until a provider is used.
use Wastukancana\Nim;
use Wastukancana\Provider\PDDikti;
use Wastukancana\Provider\WastuFyi;
$nim = '211351143';
// Using PDDikti provider (pass FQCN)
$student = (new Nim($nim, PDDikti::class))->dump();
// Using Wastu.FYI provider (requires a Bearer token)
$token = getenv('WASTU_FYI_TOKEN');
$student = (new Nim($nim, WastuFyi::class, ['token' => $token])))->dump();
/* object(Wastukancana\Student) {
nim: "211351143",
name: "SULUH SULISTIAWAN",
gender: "M",
isGraduated: true,
admissionYear: 2021,
study: "Teknik Informatika",
educationLevel: "S1",
firstSemester: 1,
sequenceNumber: 143
} */Run code style checks and tests locally:
composer psr2check
composer testsThis repository uses GitHub Actions to run the matrix CI against PHP 7.4 and 8.x with coverage reporting to Codecov.
This project is licensed under MIT License.