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

New: implements PSR-4 Autoloading Standard for Improved Code Structure and Maintainability #840

Merged
merged 50 commits into from
Oct 9, 2024

Conversation

alexmigf
Copy link
Member

@alexmigf alexmigf commented Jul 25, 2024

closes #563

  • Refactored files to follow PSR-4 autoloading standards
  • Updated namespaces to better match directory structure
  • Modified composer.json for PSR-4 autoloading
  • Ensured backward compatibility for legacy classes and namespaces
  • Renamed functions file and moved to plugin root directory
  • Configured Strauss to prefix vendor namespaces

Note:

Strauss doesn't correctly apply the new namespace to the FontLib class variables, so a manual fix is needed to ensure proper font subsetting functionality. Fix applied here: 4643b01

Copy link
Contributor

@dwalkerpriv dwalkerpriv left a comment

Choose a reason for hiding this comment

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

Normal functions seem to work fine 👍 . I tested:

  • All document generation
  • Document uploads
  • Auto and manual creation
  • Document attachments

Didn't notice any slow downs, nor any errors in the logs

includes/Makers/PdfMaker.php Outdated Show resolved Hide resolved
includes/FontSynchronizer.php Outdated Show resolved Hide resolved
includes/Settings.php Outdated Show resolved Hide resolved
ubl/Handlers/Ubl/AdditionalDocumentReferenceHandler.php Outdated Show resolved Hide resolved
ubl/Handlers/Ubl/AdditionalDocumentReferenceHandler.php Outdated Show resolved Hide resolved
ubl/Handlers/Ubl/OrderReferenceHandler.php Outdated Show resolved Hide resolved
ubl/Handlers/Handler.php Outdated Show resolved Hide resolved
ubl/Handlers/UblHandler.php Outdated Show resolved Hide resolved
ubl/Transformers/OrderTransformer.php Outdated Show resolved Hide resolved
composer.json Outdated Show resolved Hide resolved
Copy link
Contributor

@dpeyou dpeyou left a comment

Choose a reason for hiding this comment

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

LGTM now, I cannot find any errors 🚀

@dwalkerpriv
Copy link
Contributor

I've been using this since Monday I believe. Havent had any issues with the normal functions of plugin nor with the compatibility of the PT or Pro

Copy link
Contributor

@BrunoPavlinic98 BrunoPavlinic98 left a comment

Choose a reason for hiding this comment

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

LGTM!
The code looks OK.
I have tested various different IPS functionalities without any issues. I will keep my free plugin branch on this one for some time just to test this while working on another tasks.

Copy link
Contributor

@YordanSoares YordanSoares left a comment

Choose a reason for hiding this comment

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

I've been testing this PR since last Wednesday, after the weekly meeting, and haven't gotten any issues so far. I have tested this with Professional, Premium Templates and, mPDF, and everything seems to be working correctly.

Within the testing, I took advantage to check a reported conflict with dompdf caused by “TI WooCommerce Wishlist Premium” (see the issue reports here), and I can confirm that this is solved in this PR.

Copy link
Contributor

@MohamadNateqi MohamadNateqi left a comment

Choose a reason for hiding this comment

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

Works great!

@alexmigf alexmigf mentioned this pull request Sep 3, 2024
Copy link
Contributor

@Terminator-Barbapapa Terminator-Barbapapa left a comment

Choose a reason for hiding this comment

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

🚀

@alexmigf alexmigf merged commit 4fef7b6 into main Oct 9, 2024
7 checks passed
@alexmigf alexmigf deleted the psr4-strauss-v2 branch October 9, 2024 14:21
@szepeviktor
Copy link
Contributor

szepeviktor commented Oct 9, 2024

Well done.
Here is how to check FQCN~filesystem matching.

$ composer dump-autoload --optimize --strict-psr
Generating optimized autoload files
Generated optimized autoload files containing 295 classes

@alexmigf
Copy link
Member Author

alexmigf commented Oct 9, 2024

@szepeviktor we are running Strauss; Composer is handled by it.

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.

Migrate to PSR-4 autoload and ditch classmap
8 participants