Repository navigation
fix: correctness and hygiene pass (0.7.0-beta) - #26
Merged
Merged
Conversation
Data - Plate city codes rebuilt from the persian-tools numberplate dataset, cross-checked against fa.wikipedia (77 → Tehran, not Khuzestan; 88 codes vs 47). Codes issued before a province split list every successor via the new PlateNumberDetails::$provinces. - Plate letters corrected (الف government, پ police, ث/ز/ش/ف military, گ temporary…); Arabic ي/ك folded before lookup. Tables moved to src/Data/PlateCodes.php / PlateLetters.php behind DataSources. - Province::ALBORZ; 026 and Karaj-area national-ID prefixes → Alborz; کهگیلویه spelling fixed with a fromPersian alias for the old one. - IBAN 070 now resolves to Bank::RESALAT. New test asserts every name in src/Data resolves through its enum's fromPersian(). Input / formatting - ErrorInput::digits() strips NBSP, ZWNJ, bidi marks, BOM and Unicode dashes under /u, escapes $extraCharClass; Iban and LegalId use it. - NumberFormatter accepts ، ٬ ٫, leading + and space grouping. - WordsToNumber guards int overflow (null, not TypeError) and rejects rank-violating sequences such as "دو سه". - HtmlSegmenter protects entities and pre/code/textarea; PCRE errors raise FormatException (HTML_SEGMENTATION_FAILED). - Slug strips Persian punctuation, kashida and tashkeel. Docs, packaging, CI: currency example values, eram/daynum name, ^0.7 pins, CHANGELOG, CONTRIBUTING, async cache list, export-ignore list, PHP 8.5 + no-intl job + validate --strict in CI, full ErrorCode snapshot coverage.
8 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
A correctness and hygiene pass for 0.7.0-beta, with no API removals. It fixes wrong lookup data, input-cleaning and formatting bugs, outdated docs and packaging gaps. Each bug below has a regression test that failed before its fix.
77→ Khuzestan) and covered 47 codessrc/Data/PlateCodes.phpالف→ private)PlateType::TEMPORARYadded;GOVERNMENT_CIV/RENTALdeprecated070never resolved toBank::RESALATsrc/Dataresolves through its enum'sfromPersian()ErrorInput::digits()strips this noise (with the/uflag);Iban/LegalIdnow use itNumberFormatterrejectedCurrency's own output (50،000)،٬٫, a leading+and space groupingconvertContent()corrupted‌and rewrote<code>/<pre>/<textarea>WordsToNumberthrew a TypeError pastPHP_INT_MAXand summedدو سهinto 5null; rank-order rules reject sequences that aren't numbers،/؟/ kashida / tashkeel-ي/كwere rejectederamhq/daynum(a Packagist 404), stale pinsAlso in this PR:
Province::ALBORZ; area code 026 and Karaj-area national-ID prefixes now map to Alborz; theکهگیلویهspelling is fixed, with the old spelling kept as an alias.AmountAPI (times/percentOf/compareTo)..gitattributesexport-ignore list completed;.gitignoregainsvar/and.phpbench/.ext-intl,composer validate --strict, read-only token permissions, a concurrency group, and a composer cache keyed oncomposer.lock.Checklist
composer testpasses: 661 tests, also run on PHP 8.1 in Docker.composer phpstanis clean at level 8.composer cs-check(php-cs-fixer) is clean.CHANGELOG.md; the section is titled[0.7.0-beta]so tagging this commit works withrelease.yml.README.md/docs/en/*) updated.Type of change
Notes for reviewers
45maps to Kerman (upstream says Yazd; the two look swapped, since Yazd also has64and Kerman has65/75), and codes 39/50/54/60/70 are added. The header ofsrc/Data/PlateCodes.phpdocuments both.21→ Tehran + Alborz) are listed in the newPlateNumberDetails::$provinces.validate --strictstep first run on this PR.Followed by the 0.8 PR (stacked on this branch).