uuid icon indicating copy to clipboard operation
uuid copied to clipboard

Allow static guid calls

Open prolic opened this issue 4 years ago • 3 comments

Allow static calls to Guid::uuid4() and others

see https://github.com/ramsey/uuid/issues/306

Maybe that's not the very best approach, but it should do the trick.

prolic avatar Apr 07 '20 02:04 prolic

If you don't like this and want to block static calls on Guid instead, maybe you should also consider removing (or deprecating for now) those static methods from Uuid class as well. To me this would be kind of weird to have Uuid::uuid4() allowed but Guid::uuid4() not. If you have to go through the UuidFactory to create those, this should be the case for all then.

prolic avatar Apr 07 '20 02:04 prolic

I'm giving more thought to this. At first, I wanted to restrict calls to these static methods on the inheriting classes, but I'm giving this a second thought and will let you know soon. Thanks!

ramsey avatar Apr 08 '20 15:04 ramsey

Codecov Report

Merging #307 (bd43e91) into 4.x (01433b5) will decrease coverage by 0.11%. The diff coverage is 88.23%.

Impacted file tree graph

@@             Coverage Diff              @@
##                4.x     #307      +/-   ##
============================================
- Coverage     95.53%   95.42%   -0.12%     
- Complexity      554      557       +3     
============================================
  Files            64       64              
  Lines          1479     1485       +6     
============================================
+ Hits           1413     1417       +4     
- Misses           66       68       +2     
Impacted Files Coverage Δ
src/Guid/Guid.php 75.00% <66.66%> (-25.00%) :arrow_down:
src/Uuid.php 96.51% <100.00%> (ø)

codecov[bot] avatar Oct 29 '20 23:10 codecov[bot]