Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update library autoloading to psr-4 #102

Merged
merged 9 commits into from
Jan 18, 2023

Conversation

adevade
Copy link
Contributor

@adevade adevade commented Dec 1, 2022

Description

Move from PSR-0 to PSR-4 autoloading

This PR changes autoloading from using PSR-0 to PSR-4. PSR-4 is used by basically all modern PHP projects. Main difference is project file/directory structure.
All source and test files have been moved. Namespace has been added to the tests as well.

PSR-0 has been deprecated since 2014, and PSR-4 is recommended as replacement.

Read more on Stack Overflow

I've also removed the custom autoloader found in src/, since Composer always includes one. If not using Composer you can always manually include/require the files since they're so few.

Add config file for PHPUnit

Added phpunit.xml config file to repo root, so vendor/bin/phpunit can be called without duplicating arguments everywhere.

Checklist

@adevade adevade requested a review from a team as a code owner December 1, 2022 13:35
@commit-lint
Copy link

commit-lint bot commented Dec 1, 2022

Config

  • switch to psr-4 autoloading (f51b1d8)
  • remove custom legacy autoloader (35fa2ef)
  • add config file for phpunit (c0d7932)
  • gitignore phpunit cache file (79de5de)
  • remove custom legacy autoloader (0c9b3d6)

Code Refactoring

  • move src files for psr-4 (5cd223b)
  • move test files and add namespace (fde5924)

Documentation

  • remove reference to old autoloader (de16dd8)

Styles

  • remove trailing whitespace (3271b33)

Contributors

adevade

Commit-Lint commands

You can trigger Commit-Lint actions by commenting on this PR:

  • @Commit-Lint merge patch will merge dependabot PR on "patch" versions (X.X.Y - Y change)
  • @Commit-Lint merge minor will merge dependabot PR on "minor" versions (X.Y.Y - Y change)
  • @Commit-Lint merge major will merge dependabot PR on "major" versions (Y.Y.Y - Y change)
  • @Commit-Lint merge disable will desactivate merge dependabot PR
  • @Commit-Lint review will approve dependabot PR
  • @Commit-Lint stop review will stop approve dependabot PR

Copy link
Contributor

@sherwinski sherwinski left a comment

Choose a reason for hiding this comment

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

LGTM
Only comment I have is that a lot of the spacing clean up here seems duplicated from #96.
I'm going to rebase next onto main (now that the aforementioned PR is merged) so that should hopefully reduce any replications in this PR.

@luqven
Copy link
Contributor

luqven commented Jan 18, 2023

Resolved merge conflicts, waiting on CI to do its thing.

@luqven luqven merged commit c2f0166 into imgix:next Jan 18, 2023
@adevade adevade deleted the update-autoloading branch January 20, 2023 12:54
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.

3 participants