Skip to content

Hexadecimal is never an empty string#593

Merged
ramsey merged 3 commits intoramsey:4.xfrom
axlon:hexadecimal-to-string
May 26, 2025
Merged

Hexadecimal is never an empty string#593
ramsey merged 3 commits intoramsey:4.xfrom
axlon:hexadecimal-to-string

Conversation

@axlon
Copy link
Copy Markdown
Contributor

@axlon axlon commented Apr 2, 2025

Description

Similarly to UUIDs, a hexadecimal can never be empty, this PR documents it as such.

Motivation and context

More and more libraries are starting to enforce stricter typing, I was dealing with a library that required a non-empty-string which hexadecimal isn't (is, but isn't documented that it is) which requires either baselining false positives are adding redundant assertions.

How has this been tested?

This PR contains no functional changes, I've tested the changes through PHPStan.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

PR checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING.md document.
  • I have added tests to cover my changes.

@axlon axlon requested a review from ramsey as a code owner April 2, 2025 08:56
@codecov
Copy link
Copy Markdown

codecov bot commented May 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.16%. Comparing base (fd7c1c9) to head (d37b41c).
⚠️ Report is 46 commits behind head on 4.x.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##                4.x     #593   +/-   ##
=========================================
  Coverage     95.16%   95.16%           
  Complexity      584      584           
=========================================
  Files            70       70           
  Lines          1840     1840           
=========================================
  Hits           1751     1751           
  Misses           89       89           
Files with missing lines Coverage Δ
src/Type/Hexadecimal.php 92.00% <ø> (ø)

@ramsey ramsey merged commit c72360e into ramsey:4.x May 26, 2025
31 checks passed
@ramsey
Copy link
Copy Markdown
Owner

ramsey commented May 26, 2025

Thank you for contributing! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants