Skip to content

Add a documentation website - #22

Merged
dereuromark merged 1 commit into
masterfrom
docs-site
Oct 11, 2026
Merged

dereuromark merged 1 commit into
masterfrom
docs-site

Conversation

@dereuromark

@dereuromark dereuromark commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

The documentation was one README that listed method names. This adds a VitePress site under docs/, built and deployed to GitHub Pages by .github/workflows/deploy-docs.yml on pushes to master. Setup and theme follow dereuromark/cakephp-decimal, with a blue palette and its own logo.

Target URL: https://php-collective.github.io/decimal-object/

Pages

  • Guide: Installation, Getting started, Creating decimals, Arithmetic, Precision and scale, Rounding, Comparison and checks, Conversion
  • Reference: API (every public method, constants, exceptions), Integrations, Alternatives, Upgrading

Every example output was produced by running the code against this branch.

Things the old docs did not mention and the new ones do:

  • A scale passed to the constructor cuts off digits, and a larger scale is recorded without padding the string.
  • divide(), pow() and sqrt() cut off at the scale and do not round.
  • Scientific notation from untrusted input can expand to a very large string.
  • == on two objects does not compare values.
  • The 1.x limits that Apply the behavior changes held back from 1.x #23 lifts in 2.0: a scale of 0 is ignored, ROUND_FLOOR and ROUND_CEIL round to whole numbers only, unsupported modes round half up, and mod() uses the scale of the left operand.

Other changes

  • Root README shortened to a summary with links into the site. The contributing notes moved there from docs/README.md.
  • Alternatives and the php-decimal comparison moved over from the wiki. The wiki link is gone from the README; the wiki page itself can be removed or pointed at the site after the merge.
  • docs/ is export-ignored so it stays out of Composer installs.

Before merging

GitHub Pages is not enabled on this repository yet. It needs Settings > Pages > Source set to "GitHub Actions", otherwise the deploy job fails.

docs/reference/upgrading.md is headed "From 1.3" and does not name the next version. It ends with a "Coming in 2.0" table for the changes in #23.

@dereuromark dereuromark added the documentation Improvements or additions to documentation label Oct 11, 2026
@codecov

codecov Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.65%. Comparing base (5fd1e0a) to head (5d2d496).

Additional details and impacted files
@@            Coverage Diff            @@
##             master      #22   +/-   ##
=========================================
  Coverage     95.65%   95.65%           
  Complexity      114      114           
=========================================
  Files             1        1           
  Lines           230      230           
=========================================
  Hits            220      220           
  Misses           10       10           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Base automatically changed from bugfix/edge-cases to master October 11, 2026 14:44
The docs were a single README listing method names. This adds a
VitePress site under docs/, deployed to GitHub Pages by a workflow on
pushes to master, with the same setup dereuromark/cakephp-decimal uses.

Guide pages cover installation, creating decimals, arithmetic, scale,
rounding, comparison and conversion. Reference pages hold the full API
table, integrations, alternatives (moved over from the wiki) and
upgrade notes for the behavior changes since 1.3.

The root README now points at the site and keeps a short summary. The
contributing notes moved there from docs/README.md. docs/ is excluded
from the Composer dist archive.
Copilot AI balanced review requested due to automatic review settings October 11, 2026 14:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dereuromark
dereuromark enabled auto-merge (squash) October 11, 2026 14:47
@dereuromark
dereuromark disabled auto-merge October 11, 2026 14:51
@dereuromark
dereuromark merged commit a43e913 into master Oct 11, 2026
7 checks passed
@dereuromark
dereuromark deleted the docs-site branch October 11, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants