chesszebra / forsyth-edwards-notation
A PHP library that parses Forsyth-Edwards Notation (FEN) values.
1.2.0
2021-04-01 21:55 UTC
Requires
- php: ^7.4
Requires (Dev)
- chesszebra/coding-standards: dev-master
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^0.12.18
- phpstan/phpstan-strict-rules: ^0.12.2
- phpunit/phpunit: ^8.5
This package is auto-updated.
Last update: 2024-10-29 05:53:26 UTC
README
This library provides support for reading and writing chess boards in the Forsyth-Edwards notation.
Installation
Via composer
composer require chesszebra/forsyth-edwards-notation
Usage
Parse a FEN
use ChessZebra\ForsythEdwardsNotation\FenNotation; $notation = new FenNotation('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1');
Convert a FEN to a string
use ChessZebra\ForsythEdwardsNotation\FenNotation; $notation = new FenNotation('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1'); echo $notation->toString(); // or cast it: (string)$notation
Validating a FEN
use ChessZebra\ForsythEdwardsNotation\Validator; $validator = new Validator(); $validationResult = $validator->validate('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1'); // $validationResult is a ValidationResult constant.
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please report them via HackerOne.
License
The MIT License (MIT). Please see License File for more information.