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
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
caa743f
Wip
alexmigf Jul 15, 2024
35def36
Delete abstract-wcpdf-order-document-methods.php
alexmigf Jul 15, 2024
98e3852
Revert "Delete abstract-wcpdf-order-document-methods.php"
alexmigf Jul 15, 2024
bf6a1c6
Wip
alexmigf Jul 15, 2024
6f80cfc
Fix
alexmigf Jul 15, 2024
917839b
Update woocommerce-pdf-invoices-packingslips.php
alexmigf Jul 15, 2024
75e9772
Improvement
alexmigf Jul 15, 2024
23bfcc8
Update legacy-abstract-order-document-methods.php
alexmigf Jul 16, 2024
9b6ab60
Tweaks
alexmigf Jul 16, 2024
1758b81
Merge branch 'main' into psr4-strauss-v2
alexmigf Jul 17, 2024
127f7fe
Merge branch 'main' into psr4-strauss-v2
alexmigf Jul 19, 2024
a3f5c61
Merge branch 'main' into psr4-strauss-v2
alexmigf Jul 25, 2024
1409bd0
New abstract legacy
alexmigf Jul 25, 2024
9413482
Implements new file for legacy class alias
alexmigf Jul 25, 2024
8362de2
Update wpo-ips-legacy-class-alias-mapping.php
alexmigf Jul 25, 2024
e93a7cc
Update wpo-ips-legacy-class-alias-mapping.php
alexmigf Jul 25, 2024
5b5cd47
Update wpo-ips-legacy-class-alias-mapping.php
alexmigf Jul 25, 2024
cd96c71
Rename maker classes
alexmigf Jul 29, 2024
6adc64e
Tweaks
alexmigf Jul 29, 2024
3ce1357
Update Settings.php
alexmigf Jul 29, 2024
3cf8bf5
Update DeliveryHandler.php
alexmigf Jul 29, 2024
4536679
Tweaks
alexmigf Jul 30, 2024
ed2f637
Strauss instructions file
alexmigf Jul 30, 2024
2025009
Update IdHandler.php
alexmigf Jul 30, 2024
4943b31
Tweak
alexmigf Jul 30, 2024
6c26b26
Update lint.yml
alexmigf Jul 30, 2024
e3de861
Update .distignore
alexmigf Jul 30, 2024
86ac078
Merge branch 'main' into psr4-strauss-v2
alexmigf Jul 31, 2024
db79297
Merge branch 'main' into psr4-strauss-v2
alexmigf Aug 2, 2024
924a606
Update Font.php
alexmigf Aug 12, 2024
4643b01
Tweaks to Dompdf font subsetting
alexmigf Aug 12, 2024
d9d66eb
v3.9.0-beta-1
alexmigf Aug 15, 2024
2e5fbd3
Merge branch 'main' into psr4-strauss-v2
alexmigf Aug 16, 2024
80d904a
Merge branch 'main' into psr4-strauss-v2
alexmigf Sep 9, 2024
8b2a3d8
Merge branch 'main' into psr4-strauss-v2
alexmigf Sep 9, 2024
4509a1a
Revert "Merge branch 'main' into psr4-strauss-v2"
alexmigf Sep 9, 2024
45e9ab2
Revert "Merge branch 'main' into psr4-strauss-v2"
alexmigf Sep 9, 2024
2a9da83
Update wpo-ips-functions.php
alexmigf Sep 9, 2024
53e7438
Update wpo-ips-functions.php
alexmigf Sep 9, 2024
8b5c107
Fix issue with previous `main` merge
alexmigf Sep 9, 2024
86a3b29
v3.9.0-beta-2
alexmigf Sep 12, 2024
e0a3941
Update readme.txt
alexmigf Sep 12, 2024
5a63e30
Merge branch 'main' into psr4-strauss-v2
alexmigf Sep 13, 2024
584fad7
Merge branch 'main' into psr4-strauss-v2
alexmigf Sep 18, 2024
f91a482
Update woocommerce-pdf-invoices-packingslips.php
alexmigf Sep 18, 2024
daa9b2e
Merge branch 'main' into psr4-strauss-v2
alexmigf Oct 1, 2024
24f3912
Fix version
alexmigf Oct 1, 2024
0788e88
Merge branch 'main' into psr4-strauss-v2
alexmigf Oct 1, 2024
a3bff36
Merge branch 'main' into psr4-strauss-v2
alexmigf Oct 7, 2024
95d9a40
Merge branch 'main' into psr4-strauss-v2
alexmigf Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
*.gitmodules
*.distignore
*.gitattributes
*.editorconfig
*composer.json
*composer.lock
*strauss.phar
*strauss.md
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1']
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']

steps:
- name: Checkout Git repository
Expand Down
41 changes: 36 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,50 @@
{
"name": "wpovernight/woocommerce-pdf-invoices-packing-slips",
"description": "PDF Invoices & Packing Slips for WooCommerce",
"license": "GPL-3.0-or-later",
"autoload": {
"psr-4": {
"WPO\\WC\\UBL\\": "ubl/"
"WPO\\IPS\\": "includes/",
"WPO\\IPS\\UBL\\": "ubl/"
},
"classmap": [ "includes/" ]
"classmap": [
"vendor/"
]
},
"require": {
"dompdf/dompdf": "^3.0",
"symfony/polyfill-mbstring": "^1.2",
"symfony/polyfill-iconv": "^1.2",
"symfony/polyfill-mbstring": "^1.27",
"symfony/polyfill-iconv": "^1.27",
"sabre/xml": "^2.2.5"
},
"extra": {
"strauss": {
"target_directory": "vendor",
"namespace_prefix": "WPO\\IPS\\Vendor\\",
"classmap_prefix": "WPO_IPS_Vendor_",
"constant_prefix": "WPO_IPS_VENDOR_",
"packages": [],
"update_call_sites": false,
"override_autoload": {},
"exclude_from_copy": {
"packages": [],
"namespaces": [],
"file_patterns": [
"/^psr.*$/"
]
},
"exclude_from_prefix": {
"packages": [
"symfony/polyfill-mbstring",
"symfony/polyfill-iconv"
],
"namespaces": [],
"file_patterns": []
},
"namespace_replacement_patterns": {},
"delete_vendor_packages": false,
"delete_vendor_files": false
}
},
"config": {
"platform-check": false
}
Expand Down
50 changes: 25 additions & 25 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions includes/class-wcpdf-admin.php → includes/Admin.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace WPO\WC\PDF_Invoices;
namespace WPO\IPS;

use \Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController;

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

if ( ! class_exists( '\\WPO\\WC\\PDF_Invoices\\Admin' ) ) :
if ( ! class_exists( '\\WPO\\IPS\\Admin' ) ) :

class Admin {

Expand Down Expand Up @@ -184,7 +184,7 @@ public function setup_wizard() {
// Setup/welcome
if ( ! empty( $_GET['page'] ) && $_GET['page'] == 'wpo-wcpdf-setup' ) {
delete_transient( 'wpo_wcpdf_new_install' );
Setup_Wizard::instance();
SetupWizard::instance();
}
}

Expand Down
6 changes: 3 additions & 3 deletions includes/class-wcpdf-assets.php → includes/Assets.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
namespace WPO\WC\PDF_Invoices;
namespace WPO\IPS;

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

if ( ! class_exists( '\\WPO\\WC\\PDF_Invoices\\Assets' ) ) :
if ( ! class_exists( '\\WPO\\IPS\\Assets' ) ) :

class Assets {

Expand Down Expand Up @@ -93,7 +93,7 @@ public function backend_scripts_styles ( $hook ) {
}

// only load on our own settings page
// maybe find a way to refer directly to WPO\WC\PDF_Invoices\Settings::$options_page_hook ?
// maybe find a way to refer directly to WPO\IPS\Settings::$options_page_hook ?
if (
in_array( $hook, array( 'woocommerce_page_wpo_wcpdf_options_page', 'settings_page_wpo_wcpdf_options_page' ) ) ||
( isset( $_GET['page'] ) && 'wpo_wcpdf_options_page' === $_GET['page'] )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
* @since 3.5
*/

namespace WPO\WC\PDF_Invoices\Compatibility;
namespace WPO\IPS\Compatibility;

defined( 'ABSPATH' ) or exit;

if ( ! class_exists( '\\WPO\\WC\\PDF_Invoices\\Compatibility\\Order_Util' ) ) :
if ( ! class_exists( '\\WPO\\IPS\\Compatibility\\OrderUtil' ) ) :

class Order_Util {
class OrderUtil {

public $wc_order_util_class_object;
protected static $_instance = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php
namespace WPO\WC\PDF_Invoices\Compatibility;
namespace WPO\IPS\Compatibility;

defined( 'ABSPATH' ) or exit;

if ( ! class_exists( '\\WPO\\WC\\PDF_Invoices\\Compatibility\\Third_Party_Plugins' ) ) :
if ( ! class_exists( '\\WPO\\IPS\\Compatibility\\ThirdPartyPlugins' ) ) :

/**
* Third party plugin compatibility class.
*
* @since 2.0
*/
class Third_Party_Plugins {
class ThirdPartyPlugins {

protected static $_instance = null;

Expand Down
8 changes: 4 additions & 4 deletions includes/class-wcpdf-documents.php → includes/Documents.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
namespace WPO\WC\PDF_Invoices;
namespace WPO\IPS;

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

if ( ! class_exists( '\\WPO\\WC\\PDF_Invoices\\Documents' ) ) :
if ( ! class_exists( '\\WPO\\IPS\\Documents' ) ) :

class Documents {

Expand Down Expand Up @@ -44,8 +44,8 @@ public function __construct() {
*/
public function init() {
// Load Invoice & Packing Slip
$this->documents['\WPO\WC\PDF_Invoices\Documents\Invoice'] = new \WPO\WC\PDF_Invoices\Documents\Invoice();
$this->documents['\WPO\WC\PDF_Invoices\Documents\Packing_Slip'] = new \WPO\WC\PDF_Invoices\Documents\Packing_Slip();
$this->documents['\WPO\IPS\Documents\Invoice'] = new \WPO\IPS\Documents\Invoice();
$this->documents['\WPO\IPS\Documents\PackingSlip'] = new \WPO\IPS\Documents\PackingSlip();

// Allow plugins to add their own documents
$this->documents = apply_filters( 'wpo_wcpdf_document_classes', $this->documents );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php
namespace WPO\WC\PDF_Invoices\Documents;
namespace WPO\IPS\Documents;

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

if ( ! class_exists( '\\WPO\\WC\\PDF_Invoices\\Documents\\Bulk_Document' ) ) :
if ( ! class_exists( '\\WPO\\IPS\\Documents\\BulkDocument' ) ) :

/**
* Bulk Document
*
* Wraps single documents in a bulk document
*/

class Bulk_Document {
class BulkDocument {

/**
* Document slug
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
namespace WPO\WC\PDF_Invoices\Documents;
namespace WPO\IPS\Documents;

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

if ( ! class_exists( '\\WPO\\WC\\PDF_Invoices\\Documents\\Document_Number' ) ) :
if ( ! class_exists( '\\WPO\\IPS\\Documents\\DocumentNumber' ) ) :

class Document_Number {
class DocumentNumber {

/**
* The raw, unformatted number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
namespace WPO\WC\PDF_Invoices\Documents;
namespace WPO\IPS\Documents;

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

if ( ! class_exists( '\\WPO\\WC\\PDF_Invoices\\Documents\\Invoice' ) ) :
if ( ! class_exists( '\\WPO\\IPS\\Documents\\Invoice' ) ) :

/**
* Invoice Document
*/

class Invoice extends Order_Document_Methods {
class Invoice extends OrderDocumentMethods {

public $type;
public $title;
Expand Down
Loading
Loading