v2.0โœ“ STABLEโ†“ 0 downloads0 files ยท 0 B
Avatar of Tayeb-Aliby Tayeb-Alipublished
$ gh release view v2.0 --repo thesmarter/Tafqeet

Quick install

$ gh release download v2.0 --repo thesmarter/Tafqeet

Downloads

$ NO_ATTACHED_BINARIES โ€” grab the source archive below.

SOURCE_CODE //

โ†“ .tar.gzโ†“ .zip

Release notes

๐ŸŽ‰ What's New in v2

#### ๐Ÿ”ง Code Rebuild

  • Rebuilt the entire library from 5 traits (577 lines) into 1 clean class (384 lines)
  • Removed excessive trait architecture (Validation, Handler, Digit, Calculators, App)
  • Improved code maintainability and reduced complexity

#### โšก Performance & Reliability

  • Added declare(strict_types=1) for strict type checking
  • Fixed digit comparison bugs by using array_map('intval', ...) (integer arrays instead of strings)
  • Replaced die() error handling with proper TafqeetException custom exception
  • Used match expressions replacing if/elseif chains for cleaner dispatch

#### ๐Ÿ› Bug Fixes

  • Fixed strict comparison bug in in_array for fractional word selection
  • Fixed case-sensitivity issue: src/core โ†’ src/Core (PSR-4 compatibility on Linux)
  • Fixed detectClass returning null for lengths > 6 (now returns null gracefully)

#### ๐Ÿ“ฆ Packaging

  • Updated composer.json: added php: ^8.1 requirement, removed duplicate minimum-stability
  • Proper PSR-4 autoloading: thesmarter\Tafqeet\ โ†’ src/
  • Added dev dependencies: PHPUnit 10, PHPCS 3
  • Added composer scripts: test, cs, cs-fix, test:ci

#### ๐Ÿ“– Documentation

  • Complete rewrite of README (English + Arabic)
  • Added 6 shields.io badges (Packagist, PHP 8.1+, License, CI, Downloads, GitHub)
  • Added Packagist link: https://packagist.org/packages/thesmarter/tafqeet
  • Added installation instructions (Composer + manual)
  • Added usage examples and currency support table
  • Created dedicated README-ar.md for Arabic documentation

#### ๐Ÿš€ CI/CD

  • Added .github/workflows/ci.yml - automated testing on push & pull request
  • PHP 8.3, composer validate, lint, and tests

#### ๐Ÿงช Testing

  • Added comprehensive PHPUnit test suite (11 tests, 100% passing)
  • Added phpunit.xml configuration

๐Ÿ“‹ Full Change List

  • New file: src/Core/Tafqeet.php (rebuilt)
  • New file: src/Exception/TafqeetException.php
  • New file: tests/TafqeetTest.php (11 tests)
  • New file: .github/workflows/ci.yml
  • New file: phpunit.xml
  • New file: README.md (English)
  • New file: README-ar.md (Arabic)
  • Deleted: src/helper/App.php, src/helper/Calculators.php, src/helper/Digit.php, src/helper/Handler.php, src/helper/Validation.php
  • Deleted: src/.DS_Store
  • Modified: composer.json, test.php, .gitignore

๐Ÿท๏ธ Breaking Changes

  • PHP 8.1+ required (was unconstrained)
  • Directory renamed: src/core/ โ†’ src/Core/ (case-sensitive for Linux compatibility)
  • Error handling: die() โ†’ TafqeetException (catch exceptions instead of fatal errors)

๐Ÿ’ก Migration Guide

BASH

# Update the package
composer require thesmarter/tafqeet:^2.0

# If upgrading from v1, no code changes needed
# The API remains the same:
Tafqeet::arablic(3150.9); // Same output

Full Changelog: https://github.com/thesmarter/Tafqeet/compare/v1.2...v2.0