wastukancana/nim
最新稳定版本:2.0.0
Composer 安装命令:
composer require wastukancana/nim
包简介
STT Wastukancana Student ID (NIM) Parser
README 文档
README
Waska NIM
Sekolah Tinggi Teknologi Wastukancana Student ID (NIM) Parser.
Requirements
- PHP
>= 7.4(tested on 7.4, 8.0, 8.1, 8.2, 8.3) - Composer v2
- cURL
>= 7.19.4
Installation
Install the package with:
composer require wastukancana/nim
Usage
<?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 } */
Provider (optional)
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 } */
Development
Run code style checks and tests locally:
composer psr2check composer tests
This repository uses GitHub Actions to run the matrix CI against PHP 7.4 and 8.x with coverage reporting to Codecov.
License
This project is licensed under MIT License.
统计信息
- 总下载量: 55
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-23