halaxa / json-machine

Efficient, easy-to-use, and fast PHP JSON stream parser
Apache License 2.0
1.08k stars 65 forks source link

add a stand alone PSR-4 spec loader #74

Closed a-sync closed 2 years ago

halaxa commented 2 years ago

Thanks. The build is failing at code style check. Can you run make cs-fix or composer cs-fix to fix that, please?

Also I would like to have this covered with tests. A test can prepend this autoloader, test it and then remove it. To make it testable - autoloader file would return autoload callable and usage in the user land would then be:

spl_autoload_register(require '/path/to/autoload.php');
a-sync commented 2 years ago

Sorry, but my only intent was to contribute a snippet to solve a specific problem. I only opened the PR as a curtesy, but i'm not planning to work on this.

halaxa commented 2 years ago

Ok, thank you for your contribution anyway ;)

halaxa commented 2 years ago

Will you please keep this PR here so I can finish it?

a-sync commented 2 years ago

Sure :+1:

On Sat, Feb 12, 2022 at 1:26 PM Filip Halaxa @.***> wrote:

Will you please keep this PR here so I can finish it?

— Reply to this email directly, view it on GitHub https://github.com/halaxa/json-machine/pull/74#issuecomment-1037200615, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADMGZPVQI7J2NKSTUURVI5TU2ZGZDANCNFSM5OE4NW5Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

codecov-commenter commented 2 years ago

Codecov Report

Merging #74 (75bb4b9) into master (3d8f0ee) will decrease coverage by 0.38%. The diff coverage is 83.33%.

Impacted file tree graph

@@              Coverage Diff              @@
##              master      #74      +/-   ##
=============================================
- Coverage     100.00%   99.61%   -0.39%     
- Complexity       177      180       +3     
=============================================
  Files             16       17       +1     
  Lines            513      525      +12     
=============================================
+ Hits             513      523      +10     
- Misses             0        2       +2     
Impacted Files Coverage Δ
src/autoloader.php 83.33% <83.33%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3d8f0ee...75bb4b9. Read the comment docs.

devfrey commented 2 years ago

These changes generate a warning when running composer install (I'm using Composer 2.2.7):

Class JsonMachine\Autoloading located in ./vendor/halaxa/json-machine/src/autoloader.php does not comply with psr-4 autoloading standard. Skipping.
halaxa commented 2 years ago

Thanks, @devfrey. 7adbfef should fix this on master. Can you please verify it by requiring dev-master? Works for me.

devfrey commented 2 years ago

Works perfectly @halaxa, thanks!

halaxa commented 2 years ago

Released in 1.1.1