Plugin Directory

Changeset 3489939


Ignore:
Timestamp:
03/24/2026 12:04:50 PM (10 days ago)
Author:
makecommerce
Message:

Release 4.0.7

Location:
makecommerce/trunk
Files:
8 added
64 edited

Legend:

Unmodified
Added
Removed
  • makecommerce/trunk/README.txt

    r3447693 r3489939  
    44Requires at least: 6.8.1
    55Tested up to: 6.9
    6 Stable tag: 4.0.6
     6Stable tag: 4.0.7
    77Requires PHP: 8.1
    88License: GPLv2 or later
     
    6060
    6161== Changelog ==
     62
     63= 4.0.7 2026-03-24 =
     64* Feature - Added order locking to prevent race conditions during payment processing
     65* Feature - Improved shipping rate caching for faster responses from the MakeCommerce Shipping API
     66* Feature - Added webhook support for automated order status updates
     67* Feature - Added webhook support for fetching WooCommerce product categories
     68* Fix - Resolved static property issue with DefaultLocale in i18n
    6269
    6370= 4.0.6 2026-01-27 =
  • makecommerce/trunk/config.php

    r3447693 r3489939  
    1111 * Start at version 3.0.0 and use SemVer - https://semver.org
    1212 */
    13 define( 'MAKECOMMERCE_VERSION', '4.0.6' );
     13define( 'MAKECOMMERCE_VERSION', '4.0.7' );
    1414define( 'MAKECOMMERCE_PLUGIN_ID', 'makecommerce' );
    1515
  • makecommerce/trunk/includes/i18n.php

    r2622774 r3489939  
    3030
    3131    //set default locale when there is nothing specified
    32     public $defaultLocale = "et";
     32    public static string $defaultLocale = "et";
    3333
    3434    /**
  • makecommerce/trunk/makecommerce.php

    r3447693 r3489939  
    99 * Plugin URI:            https://makecommerce.net/
    1010 * Description:           Adds MakeCommerce payment gateway and shipping methods to WooCommerce checkout
    11  * Version:               4.0.6
     11 * Version:               4.0.7
    1212 * Author:                Maksekeskus AS
    1313 * Author URI:            https://makecommerce.net/
  • makecommerce/trunk/makecommerce/admin/dashboard.php

    r3447693 r3489939  
    204204
    205205                $token = $client->connectShop(
    206                     $_SERVER['HTTP_USER_AGENT'] ?? 'unknown',
    207                         get_site_url() ?? $_SERVER['REMOTE_ADDR'],
    208                         admin_url( 'post.php?post={id}&action=edit' )
     206                    userAgent: $_SERVER['HTTP_USER_AGENT'] ?? 'unknown',
     207                    remoteAddr: get_site_url() ?? $_SERVER['REMOTE_ADDR'],
     208                    orderUrl: admin_url( 'post.php?post={id}&action=edit' ),
     209                    webhookUrl: home_url('/')
    209210                );
    210211
     
    446447            $client = $this->get_client();
    447448            $client->connectShop(
    448                 $_SERVER['HTTP_USER_AGENT'] ?? 'unknown',
    449                 get_site_url() ?? $_SERVER['REMOTE_ADDR'],
    450                     admin_url( 'post.php?post={id}&action=edit' )
     449                userAgent: $_SERVER['HTTP_USER_AGENT'] ?? 'unknown',
     450                remoteAddr: get_site_url() ?? $_SERVER['REMOTE_ADDR'],
     451                orderUrl: admin_url( 'post.php?post={id}&action=edit' ),
     452                webhookUrl: home_url('/')
    451453            );
    452454            update_option('mc_credentials_error', '');
  • makecommerce/trunk/makecommerce/composer.json

    r3318735 r3489939  
    99  ],
    1010  "require": {
    11     "maksekeskus/php-shipping-sdk": "1.5.1",
     11    "maksekeskus/php-shipping-sdk": "1.5.5",
    1212    "twig/twig": "^3.11.0"
    1313  },
  • makecommerce/trunk/makecommerce/includes/i18n.php

    r3447693 r3489939  
    3030
    3131    //set default locale when there is nothing specified
    32     public $defaultLocale = "en";
     32    public static string $defaultLocale = "en";
    3333
    3434    /**
  • makecommerce/trunk/makecommerce/makecommerce.php

    r3447693 r3489939  
    1111 * Start at version 3.0.0 and use SemVer - https://semver.org
    1212 */
    13 define( 'MAKECOMMERCE_VERSION', '4.0.6' );
     13define( 'MAKECOMMERCE_VERSION', '4.0.7' );
    1414define( 'MAKECOMMERCE_PLUGIN_ID', 'makecommerce' );
    1515
  • makecommerce/trunk/makecommerce/payment/gateway/woocommerce/woocommerce.php

    r3447693 r3489939  
    1313    public $id = MAKECOMMERCE_PLUGIN_ID;
    1414
    15     public $version = '4.0.6';
     15    public $version = '4.0.7';
    1616   
    1717    public $payment_return_url;
  • makecommerce/trunk/makecommerce/payment/payment.php

    r3447693 r3489939  
    287287        }
    288288
    289         //check if we already processed this status in the past.
     289        // Lock processing for this order+status to avoid race conditions between callback and redirect
     290        $lock_key = '_makecommerce_payment_lock_status_' . $paymentStatus;
     291        $locked   = add_post_meta( $orderId, $lock_key, time(), true );
     292        if ( ! $locked ) {
     293            return $returnUrl;
     294        }
     295
    290296        if ( $check_status && $order->get_meta( '_makecommerce_payment_processed_status', true ) == $paymentStatus ) {
    291297            return $returnUrl;
  • makecommerce/trunk/makecommerce/shipping/method/method.php

    r3447693 r3489939  
    104104        }
    105105
    106         $totalWeight = $this->getCartTotalWeight($package['contents']);
    107         $dst = $package['destination']['country'];
    108         $address = $package['destination']['address'];
    109         $city = $package['destination']['city'];
    110         $postcode = $package['destination']['postcode'];
    111 
    112         $details = ['package' => $this->filter_package_details($package)];
    113         $details = $this->add_woo_conf($details);
     106        $request_payload = $this->build_rates_request_payload($package);
    114107
    115108        $location = [];
     109
     110        // Build a hash of the full request payload
     111        $cache_hash = $this->build_rates_cache_hash($request_payload);
     112        $session = null;
     113
     114        if (function_exists('WC') && WC()->session) {
     115            $session = WC()->session;
     116            $cached_hash = $session->get('mc_last_rates_hash');
     117            $cached_rates = $session->get('mc_last_rates');
     118            $cached_ts = (int) $session->get('mc_last_rates_timestamp');
     119
     120            // Allow sites to change TTL via filter if needed.
     121            $cache_ttl = (int) apply_filters('mc_shipping_rates_cache_ttl', 30);
     122
     123            if (
     124                !empty($cached_hash) &&
     125                $cached_hash === $cache_hash &&
     126                !empty($cached_rates) &&
     127                !empty($cached_ts) &&
     128                (time() - $cached_ts) < $cache_ttl
     129            ) {
     130                // Re-use cached rates
     131                $this->register_mc_rates($cached_rates, $package);
     132                return;
     133            }
     134        }
     135
    116136        try {
    117137            $client = Shipping::init_client();
    118             $rates = $client->getRates([
    119                 'details' => $details,
    120                 'weight' => $totalWeight,
    121                 'destination' => $dst,
    122                 'location' => [
    123                     'address' => $address,
    124                     'city' => $city,
    125                     'zip' => $postcode,
    126                 ]
    127             ], $location);
     138            $rates = $client->getRates($request_payload, $location);
     139            if (is_object($rates)) {
     140                $rates = (array) $rates;
     141            }
    128142
    129143            $decoded_location = is_string($location) ? json_decode($location) : $location;
     
    131145                is_array($decoded_location) &&
    132146                isset($decoded_location[0]->latitude, $decoded_location[0]->longitude) &&
    133                 WC()->session
     147                $session
    134148            ) {
    135                 WC()->session->set('mc_coordinates', [
     149                $session->set('mc_coordinates', [
    136150                    'lat' => (float) $decoded_location[0]->latitude,
    137151                    'lng' => (float) $decoded_location[0]->longitude,
     
    139153            }
    140154
    141             foreach ($rates as $method => $carriers) {
    142                 // If does not fit and is pickuppoint, then do not add shipping rate
    143                 if ($method === 'pickuppoint' && !$this->fits_parcel_machine($package)) {
    144                     continue;
     155            if ($session) {
     156                $session->set('mc_last_rates_hash', $cache_hash);
     157                $session->set('mc_last_rates', $rates);
     158                $session->set('mc_last_rates_timestamp', time());
     159
     160                $session_rates = $session->get('mc_last_rates');
     161                if (!empty($session_rates)) {
     162                    $this->register_mc_rates($session_rates, $package);
     163                } else {
     164                    $this->register_mc_rates($rates, $package); // fallback
    145165                }
    146 
    147                 foreach ($carriers as $carrier) {
    148                     $this->add_rate([
    149                         'id'        => 'mc_' . $method . '_' . $carrier->carrier,
    150                         'label'     => $carrier->title,
    151                         'cost'      => $carrier->price / 100,
    152                         'taxes'     => '',
    153                         'calc_tax'  => 'per_order',
    154                     ]);
    155                 }
    156 
     166            } else {
     167                $this->register_mc_rates($rates, $package);
    157168            }
    158169
     
    220231    }
    221232
     233    /**
     234     * Build MakeCommerce rates request payload from WooCommerce package.
     235     *
     236     * @param array $package
     237     * @return array
     238     */
     239    private function build_rates_request_payload(array $package): array
     240    {
     241        $totalWeight = $this->getCartTotalWeight($package['contents']);
     242        $destination = $package['destination'] ?? [];
     243
     244        $details = ['package' => $this->filter_package_details($package)];
     245        $details = $this->add_woo_conf($details);
     246
     247        return [
     248            'details'     => $details,
     249            'weight'      => $totalWeight,
     250            'destination' => $destination['country'] ?? '',
     251            'location'    => [
     252                'address' => $destination['address'] ?? '',
     253                'city'    => $destination['city'] ?? '',
     254                'zip'     => $destination['postcode'] ?? '',
     255            ],
     256        ];
     257    }
     258
     259    /**
     260     * Build a stable hash for the current request payload
     261     * to decide when to reuse cached shipping rates.
     262     *
     263     * @param array $request_payload
     264     * @return string
     265     */
     266    private function build_rates_cache_hash(array $request_payload): string
     267    {
     268        return hash('sha256', wp_json_encode($request_payload));
     269    }
     270
     271    /**
     272     * Register MakeCommerce shipping rates with WooCommerce.
     273     *
     274     * @param $rates
     275     * @param array $package
     276     * @return void
     277     */
     278    private function register_mc_rates($rates, array $package): void
     279    {
     280        foreach ($rates as $method => $carriers) {
     281            // If does not fit and is pickuppoint, then do not add shipping rate
     282            if ($method === 'pickuppoint' && !$this->fits_parcel_machine($package)) {
     283                continue;
     284            }
     285
     286            foreach ($carriers as $carrier) {
     287                $this->add_rate([
     288                    'id'        => 'mc_' . $method . '_' . $carrier->carrier,
     289                    'label'     => $carrier->title,
     290                    'cost'      => $carrier->price / 100,
     291                    'taxes'     => '',
     292                    'calc_tax'  => 'per_order',
     293                ]);
     294            }
     295        }
     296    }
    222297
    223298    /**
  • makecommerce/trunk/makecommerce/shipping/shipping.php

    r3447693 r3489939  
    8282        // Add blocks support
    8383        add_action( 'woocommerce_blocks_loaded', [$this, 'woocommerce_blocks_support'] );
     84
     85        // Shipping Webhook endpoint
     86        add_filter( 'query_vars', array( $this, 'register_webhook_query_var') );
     87        add_action( 'template_redirect', array( $this, 'handle_webhooks') );
    8488    }
    8589
     
    155159
    156160        $this->loader->add_action( 'woocommerce_review_order_after_shipping', $this, 'mc_pickuppoint_after_shipping_details');
     161    }
     162
     163    /**
     164     * Register shared webhook query variable.
     165     *
     166     * @since 4.0.7
     167     */
     168    public function register_webhook_query_var( $vars ) {
     169        $vars[] = 'makecommerce_shipping_webhook';
     170
     171        return $vars;
     172    }
     173
     174    /**
     175     * Unified webhook dispatcher. Routes to specific handlers based on query var.
     176     *
     177     * Usage examples:
     178     *  - ?makecommerce_shipping_webhook=status_automation
     179     *  - ?makecommerce_shipping_webhook=categories
     180     *
     181     * @since 4.0.7
     182     */
     183    public function handle_webhooks() {
     184        $type = get_query_var( 'makecommerce_shipping_webhook' );
     185
     186        if ( empty( $type ) ) {
     187            return;
     188        }
     189
     190        if ( $type === 'status_automation' ) {
     191            $this->handle_shipping_status_automation_webhook();
     192            return;
     193        }
     194
     195        if ( $type === 'categories' ) {
     196            $this->handle_categories_webhook();
     197            return;
     198        }
     199    }
     200
     201    /**
     202     * Handles shipping webhook callback
     203     *
     204     * @since 4.0.7
     205     */
     206    public function handle_shipping_status_automation_webhook() {
     207        try{
     208
     209            $data = stripslashes_deep( $_POST );
     210
     211            $api = \MakeCommerce::get_api();
     212
     213            $this->validate_auth($api->getShopId(), $api->getSecretKey());
     214
     215            if (!$api->verifyMac( $data )){
     216                wp_send_json( [
     217                    'code' => 'MAC_VALIDATION_ERROR',
     218                    'status' => 'error',
     219                    'message' => 'Mac validation failed'
     220                ], 422 );
     221            }
     222
     223            $json = json_decode($data['json'], true);
     224
     225            $orderId = $json['order_id'];
     226            $trackingId = $json['tracking_id'];
     227            $shipment_status = (int) $json['shipment_status'];
     228
     229            $order = wc_get_order( $orderId );
     230
     231            if ( !$order || !$order->get_id() ) {
     232                wp_send_json([
     233                    'code' => 'ORDER_NOT_FOUND',
     234                    'status' => 'error',
     235                    'message' => 'Order with id: ' . $orderId . ' not found'
     236                ], 422 );
     237            }
     238
     239            if ($shipment_status < 200){
     240                wp_send_json([
     241                    'code' => 'SHIPMENT_STATUS_BELOW_THRESHOLD',
     242                    'status' => 'success',
     243                    'message' => 'Order with id: ' . $orderId . ' got shipment_status: ' . $shipment_status
     244                ], 200 );
     245            }
     246
     247            // Check if our plugin has already moved this order to completed before
     248            if ( $order->get_meta( '_mc_has_set_to_completed' ) === 'yes' ) {
     249                wp_send_json([
     250                    'code' => 'ORDER_ALREADY_COMPLETED_BY_MC',
     251                    'status' => 'success',
     252                    'message' => 'Order with id: ' . $orderId . ' has already been moved to completed status by MakeCommerce.'
     253                ], 200 );
     254            }
     255
     256            // Only move status to completed if order in processing
     257            if ($order->get_status() !== 'processing') {
     258                wp_send_json([
     259                    'code' => 'ORDER_NOT_IN_PROCESSING_STATE',
     260                    'status' => 'success',
     261                    'message' => 'Order with id: ' . $orderId . ' is not in processing status: ' . $order->get_status()
     262                ], 200 );
     263            }
     264
     265
     266            // Mark that our plugin was the one who set this order to completed status
     267            $order->update_meta_data( '_mc_has_set_to_completed', 'yes' );
     268            $order->add_order_note(
     269                sprintf(
     270                    __( 'Received status %s for shipment %s, marking order as completed', 'wc_makecommerce_domain' ),
     271                    $shipment_status,
     272                    $trackingId
     273                ));
     274            $order->update_status( 'completed' );
     275
     276            $order->save();
     277
     278            wp_send_json( [
     279                'status' => 'success',
     280                'message' => 'Order with id: ' . $orderId . ' status set to completed'
     281            ], 200 );
     282
     283        } catch (\Exception $e) {
     284            wp_send_json( [
     285                'code' => 'WOOCOMMERCE_UNEXPECTED_ERROR',
     286                'status' => 'error',
     287                'message' => substr($e->getMessage(), 0, 500)
     288            ], 500 );
     289        }
     290    }
     291
     292    /**
     293     * Handles categories webhook callback
     294     *
     295     * Allows external MakeCommerce service to fetch WooCommerce product categories.
     296     *
     297     * @since 4.0.7
     298     */
     299    public function handle_categories_webhook() {
     300
     301        $api = \MakeCommerce::get_api();
     302
     303        $this->validate_auth($api->getShopId(), $api->getSecretKey());
     304
     305        $terms = get_terms(
     306            [
     307                'taxonomy'   => 'product_cat',
     308                'hide_empty' => false,
     309            ]
     310        );
     311
     312        if ( is_wp_error( $terms ) ) {
     313            wp_send_json(
     314                [
     315                    'code'    => 'TERM_FETCH_ERROR',
     316                    'status'  => 'error',
     317                    'message' => $terms->get_error_message(),
     318                ],
     319                500
     320            );
     321        }
     322
     323        $categories = array_map(
     324            function ( $term ) {
     325                return [
     326                    'id'          => (string) $term->term_id,
     327                    'name'        => $term->name,
     328                    'parent_id'   => (string) $term->parent,
     329                    'description' => $term->description,
     330                ];
     331            },
     332            $terms
     333        );
     334
     335        wp_send_json(
     336            [
     337                'status'     => 'success',
     338                'categories' => $categories,
     339            ],
     340            200
     341        );
     342    }
     343
     344    /**
     345     * Validate HTTP Basic Auth header for webhook requests.
     346     *
     347     * Username must match shop ID and password must match secret key.
     348     * Responds with 401 JSON error and terminates execution on failure.
     349     *
     350     * @param string $shop_id
     351     * @param string $secret_key
     352     *
     353     * @since 4.0.7
     354     */
     355    private function validate_auth(string $shop_id, string $secret_key ) {
     356        $authorization = '';
     357
     358        if ( function_exists( 'getallheaders' ) ) {
     359            $headers = getallheaders();
     360
     361            $authorization = isset( $headers['Authorization'] ) ? $headers['Authorization'] : '';
     362        }
     363
     364        if ( empty( $authorization ) || stripos( $authorization, 'Basic ' ) !== 0 ) {
     365            wp_send_json(
     366                [
     367                    'code'    => 'UNAUTHORIZED',
     368                    'status'  => 'error',
     369                    'message' => 'Missing or invalid Authorization header',
     370                ],
     371                401
     372            );
     373        }
     374
     375        $encoded_credentials = trim( substr( $authorization, 6 ) ); // Remove 'Basic '
     376        $decoded_credentials = base64_decode( $encoded_credentials, true );
     377
     378        if ( $decoded_credentials === false || strpos( $decoded_credentials, ':' ) === false ) {
     379            wp_send_json(
     380                [
     381                    'code'    => 'UNAUTHORIZED',
     382                    'status'  => 'error',
     383                    'message' => 'Malformed Authorization header',
     384                ],
     385                401
     386            );
     387        }
     388
     389        list( $username, $password ) = explode( ':', $decoded_credentials, 2 );
     390
     391        $username_valid = $shop_id === $username;
     392        $password_valid = $secret_key === $password;
     393
     394        if ( ! $username_valid || ! $password_valid ) {
     395            wp_send_json(
     396                [
     397                    'code'    => 'UNAUTHORIZED',
     398                    'status'  => 'error',
     399                    'message' => 'Invalid Basic Auth credentials',
     400                ],
     401                401
     402            );
     403        }
    157404    }
    158405
  • makecommerce/trunk/makecommerce/vendor-prefixed/composer/autoload_classmap.php

    r3318735 r3489939  
    147147    'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\ArgumentsTrait' => $vendorDir . '/twig/twig/src/ExpressionParser/Infix/ArgumentsTrait.php',
    148148    'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\ArrowExpressionParser' => $vendorDir . '/twig/twig/src/ExpressionParser/Infix/ArrowExpressionParser.php',
     149    'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\AssignmentExpressionParser' => $vendorDir . '/twig/twig/src/ExpressionParser/Infix/AssignmentExpressionParser.php',
    149150    'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\BinaryOperatorExpressionParser' => $vendorDir . '/twig/twig/src/ExpressionParser/Infix/BinaryOperatorExpressionParser.php',
    150151    'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\ConditionalTernaryExpressionParser' => $vendorDir . '/twig/twig/src/ExpressionParser/Infix/ConditionalTernaryExpressionParser.php',
     
    232233    'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\NotEqualBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php',
    233234    'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\NotInBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/NotInBinary.php',
     235    'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\NotSameAsBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/NotSameAsBinary.php',
    234236    'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\NullCoalesceBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/NullCoalesceBinary.php',
     237    'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\ObjectDestructuringSetBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/ObjectDestructuringSetBinary.php',
    235238    'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\OrBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/OrBinary.php',
    236239    'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\PowerBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/PowerBinary.php',
    237240    'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\RangeBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/RangeBinary.php',
     241    'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\SameAsBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/SameAsBinary.php',
     242    'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\SequenceDestructuringSetBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/SequenceDestructuringSetBinary.php',
     243    'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\SetBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/SetBinary.php',
    238244    'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\SpaceshipBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/SpaceshipBinary.php',
    239245    'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\StartsWithBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php',
     
    244250    'MakeCommercePrefix\\Twig\\Node\\Expression\\ConditionalExpression' => $vendorDir . '/twig/twig/src/Node/Expression/ConditionalExpression.php',
    245251    'MakeCommercePrefix\\Twig\\Node\\Expression\\ConstantExpression' => $vendorDir . '/twig/twig/src/Node/Expression/ConstantExpression.php',
     252    'MakeCommercePrefix\\Twig\\Node\\Expression\\EmptyExpression' => $vendorDir . '/twig/twig/src/Node/Expression/EmptyExpression.php',
    246253    'MakeCommercePrefix\\Twig\\Node\\Expression\\FilterExpression' => $vendorDir . '/twig/twig/src/Node/Expression/FilterExpression.php',
    247254    'MakeCommercePrefix\\Twig\\Node\\Expression\\Filter\\DefaultFilter' => $vendorDir . '/twig/twig/src/Node/Expression/Filter/DefaultFilter.php',
  • makecommerce/trunk/makecommerce/vendor-prefixed/composer/autoload_static.php

    r3318735 r3489939  
    2020
    2121    public static $prefixLengthsPsr4 = array (
    22         'M' => 
     22        'M' =>
    2323        array (
    2424            'MakeCommercePrefix\\Twig\\' => 24,
     
    3535
    3636    public static $prefixDirsPsr4 = array (
    37         'MakeCommercePrefix\\Twig\\' => 
     37        'MakeCommercePrefix\\Twig\\' =>
    3838        array (
    3939            0 => __DIR__ . '/..' . '/twig/twig/src',
    4040        ),
    41         'MakeCommercePrefix\\Symfony\\Polyfill\\Mbstring\\' => 
     41        'MakeCommercePrefix\\Symfony\\Polyfill\\Mbstring\\' =>
    4242        array (
    4343            0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
    4444        ),
    45         'MakeCommercePrefix\\Symfony\\Polyfill\\Ctype\\' => 
     45        'MakeCommercePrefix\\Symfony\\Polyfill\\Ctype\\' =>
    4646        array (
    4747            0 => __DIR__ . '/..' . '/symfony/polyfill-ctype',
    4848        ),
    49         'MakeCommercePrefix\\Psr\\Http\\Message\\' => 
     49        'MakeCommercePrefix\\Psr\\Http\\Message\\' =>
    5050        array (
    5151            0 => __DIR__ . '/..' . '/psr/http-factory/src',
    5252            1 => __DIR__ . '/..' . '/psr/http-message/src',
    5353        ),
    54         'MakeCommercePrefix\\Psr\\Http\\Client\\' => 
     54        'MakeCommercePrefix\\Psr\\Http\\Client\\' =>
    5555        array (
    5656            0 => __DIR__ . '/..' . '/psr/http-client/src',
    5757        ),
    58         'MakeCommercePrefix\\MakeCommerceShipping\\SDK\\' => 
     58        'MakeCommercePrefix\\MakeCommerceShipping\\SDK\\' =>
    5959        array (
    6060            0 => __DIR__ . '/..' . '/maksekeskus/php-shipping-sdk/src/MakeCommerce',
    6161        ),
    62         'MakeCommercePrefix\\GuzzleHttp\\Psr7\\' => 
     62        'MakeCommercePrefix\\GuzzleHttp\\Psr7\\' =>
    6363        array (
    6464            0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
    6565        ),
    66         'MakeCommercePrefix\\GuzzleHttp\\Promise\\' => 
     66        'MakeCommercePrefix\\GuzzleHttp\\Promise\\' =>
    6767        array (
    6868            0 => __DIR__ . '/..' . '/guzzlehttp/promises/src',
    6969        ),
    70         'MakeCommercePrefix\\GuzzleHttp\\' => 
     70        'MakeCommercePrefix\\GuzzleHttp\\' =>
    7171        array (
    7272            0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
     
    215215        'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\ArgumentsTrait' => __DIR__ . '/..' . '/twig/twig/src/ExpressionParser/Infix/ArgumentsTrait.php',
    216216        'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\ArrowExpressionParser' => __DIR__ . '/..' . '/twig/twig/src/ExpressionParser/Infix/ArrowExpressionParser.php',
     217        'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\AssignmentExpressionParser' => __DIR__ . '/..' . '/twig/twig/src/ExpressionParser/Infix/AssignmentExpressionParser.php',
    217218        'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\BinaryOperatorExpressionParser' => __DIR__ . '/..' . '/twig/twig/src/ExpressionParser/Infix/BinaryOperatorExpressionParser.php',
    218219        'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\ConditionalTernaryExpressionParser' => __DIR__ . '/..' . '/twig/twig/src/ExpressionParser/Infix/ConditionalTernaryExpressionParser.php',
     
    300301        'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\NotEqualBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php',
    301302        'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\NotInBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/NotInBinary.php',
     303        'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\NotSameAsBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/NotSameAsBinary.php',
    302304        'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\NullCoalesceBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/NullCoalesceBinary.php',
     305        'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\ObjectDestructuringSetBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/ObjectDestructuringSetBinary.php',
    303306        'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\OrBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/OrBinary.php',
    304307        'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\PowerBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/PowerBinary.php',
    305308        'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\RangeBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/RangeBinary.php',
     309        'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\SameAsBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/SameAsBinary.php',
     310        'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\SequenceDestructuringSetBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/SequenceDestructuringSetBinary.php',
     311        'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\SetBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/SetBinary.php',
    306312        'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\SpaceshipBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/SpaceshipBinary.php',
    307313        'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\StartsWithBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php',
     
    312318        'MakeCommercePrefix\\Twig\\Node\\Expression\\ConditionalExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/ConditionalExpression.php',
    313319        'MakeCommercePrefix\\Twig\\Node\\Expression\\ConstantExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/ConstantExpression.php',
     320        'MakeCommercePrefix\\Twig\\Node\\Expression\\EmptyExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/EmptyExpression.php',
    314321        'MakeCommercePrefix\\Twig\\Node\\Expression\\FilterExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/FilterExpression.php',
    315322        'MakeCommercePrefix\\Twig\\Node\\Expression\\Filter\\DefaultFilter' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Filter/DefaultFilter.php',
  • makecommerce/trunk/makecommerce/vendor-prefixed/composer/installed.json

    r3318735 r3489939  
    33        "12": {
    44            "name": "guzzlehttp/guzzle",
    5             "version": "7.9.3",
    6             "version_normalized": "7.9.3.0",
     5            "version": "7.10.0",
     6            "version_normalized": "7.10.0.0",
    77            "source": {
    88                "type": "git",
    99                "url": "https://github.com/guzzle/guzzle.git",
    10                 "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77"
    11             },
    12             "dist": {
    13                 "type": "zip",
    14                 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",
    15                 "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",
     10                "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4"
     11            },
     12            "dist": {
     13                "type": "zip",
     14                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4",
     15                "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4",
    1616                "shasum": ""
    1717            },
    1818            "require": {
    1919                "ext-json": "*",
    20                 "guzzlehttp/promises": "^1.5.3 || ^2.0.3",
    21                 "guzzlehttp/psr7": "^2.7.0",
     20                "guzzlehttp/promises": "^2.3",
     21                "guzzlehttp/psr7": "^2.8",
    2222                "php": "^7.2.5 || ^8.0",
    2323                "psr/http-client": "^1.0",
     
    4040                "psr/log": "Required for using the Log middleware"
    4141            },
    42             "time": "2025-03-27T13:37:11+00:00",
     42            "time": "2025-08-23T22:36:01+00:00",
    4343            "type": "library",
    4444            "extra": {
     
    112112            "support": {
    113113                "issues": "https://github.com/guzzle/guzzle/issues",
    114                 "source": "https://github.com/guzzle/guzzle/tree/7.9.3"
     114                "source": "https://github.com/guzzle/guzzle/tree/7.10.0"
    115115            },
    116116            "funding": [
     
    132132        "13": {
    133133            "name": "guzzlehttp/promises",
    134             "version": "2.2.0",
    135             "version_normalized": "2.2.0.0",
     134            "version": "2.3.0",
     135            "version_normalized": "2.3.0.0",
    136136            "source": {
    137137                "type": "git",
    138138                "url": "https://github.com/guzzle/promises.git",
    139                 "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c"
    140             },
    141             "dist": {
    142                 "type": "zip",
    143                 "url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c",
    144                 "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c",
     139                "reference": "481557b130ef3790cf82b713667b43030dc9c957"
     140            },
     141            "dist": {
     142                "type": "zip",
     143                "url": "https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957",
     144                "reference": "481557b130ef3790cf82b713667b43030dc9c957",
    145145                "shasum": ""
    146146            },
     
    150150            "require-dev": {
    151151                "bamarni/composer-bin-plugin": "^1.8.2",
    152                 "phpunit/phpunit": "^8.5.39 || ^9.6.20"
    153             },
    154             "time": "2025-03-27T13:27:01+00:00",
     152                "phpunit/phpunit": "^8.5.44 || ^9.6.25"
     153            },
     154            "time": "2025-08-22T14:34:08+00:00",
    155155            "type": "library",
    156156            "extra": {
     
    198198            "support": {
    199199                "issues": "https://github.com/guzzle/promises/issues",
    200                 "source": "https://github.com/guzzle/promises/tree/2.2.0"
     200                "source": "https://github.com/guzzle/promises/tree/2.3.0"
    201201            },
    202202            "funding": [
     
    218218        "14": {
    219219            "name": "guzzlehttp/psr7",
    220             "version": "2.7.1",
    221             "version_normalized": "2.7.1.0",
     220            "version": "2.9.0",
     221            "version_normalized": "2.9.0.0",
    222222            "source": {
    223223                "type": "git",
    224224                "url": "https://github.com/guzzle/psr7.git",
    225                 "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16"
    226             },
    227             "dist": {
    228                 "type": "zip",
    229                 "url": "https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16",
    230                 "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16",
     225                "reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884"
     226            },
     227            "dist": {
     228                "type": "zip",
     229                "url": "https://api.github.com/repos/guzzle/psr7/zipball/7d0ed42f28e42d61352a7a79de682e5e67fec884",
     230                "reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884",
    231231                "shasum": ""
    232232            },
     
    244244                "bamarni/composer-bin-plugin": "^1.8.2",
    245245                "http-interop/http-factory-tests": "0.9.0",
    246                 "phpunit/phpunit": "^8.5.39 || ^9.6.20"
     246                "jshttp/mime-db": "1.54.0.1",
     247                "phpunit/phpunit": "^8.5.44 || ^9.6.25"
    247248            },
    248249            "suggest": {
    249250                "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
    250251            },
    251             "time": "2025-03-27T12:30:47+00:00",
     252            "time": "2026-03-10T16:41:02+00:00",
    252253            "type": "library",
    253254            "extra": {
     
    317318            "support": {
    318319                "issues": "https://github.com/guzzle/psr7/issues",
    319                 "source": "https://github.com/guzzle/psr7/tree/2.7.1"
     320                "source": "https://github.com/guzzle/psr7/tree/2.9.0"
    320321            },
    321322            "funding": [
     
    337338        "21": {
    338339            "name": "maksekeskus/php-shipping-sdk",
    339             "version": "1.5.1",
    340             "version_normalized": "1.5.1.0",
     340            "version": "1.5.5",
     341            "version_normalized": "1.5.5.0",
    341342            "source": {
    342343                "type": "git",
    343344                "url": "https://github.com/maksekeskus/php-shipping-sdk.git",
    344                 "reference": "119c45a091f4c47ece0f5434b1f12b1a74217aff"
    345             },
    346             "dist": {
    347                 "type": "zip",
    348                 "url": "https://api.github.com/repos/maksekeskus/php-shipping-sdk/zipball/119c45a091f4c47ece0f5434b1f12b1a74217aff",
    349                 "reference": "119c45a091f4c47ece0f5434b1f12b1a74217aff",
     345                "reference": "ced07b21189c5736a91bd5116c4607b0b28a4b13"
     346            },
     347            "dist": {
     348                "type": "zip",
     349                "url": "https://api.github.com/repos/maksekeskus/php-shipping-sdk/zipball/ced07b21189c5736a91bd5116c4607b0b28a4b13",
     350                "reference": "ced07b21189c5736a91bd5116c4607b0b28a4b13",
    350351                "shasum": ""
    351352            },
     
    361362                "symfony/var-dumper": "5.4.39"
    362363            },
    363             "time": "2025-06-03T06:28:14+00:00",
     364            "time": "2026-03-13T14:50:10+00:00",
    364365            "type": "library",
    365366            "installation-source": "dist",
     
    395396            ],
    396397            "support": {
    397                 "source": "https://github.com/maksekeskus/php-shipping-sdk/tree/1.5.1",
     398                "source": "https://github.com/maksekeskus/php-shipping-sdk/tree/1.5.5",
    398399                "issues": "https://github.com/maksekeskus/php-shipping-sdk/issues"
    399400            },
    400401            "install-path": "../maksekeskus/php-shipping-sdk"
    401402        },
    402         "31": {
     403        "32": {
    403404            "name": "psr/http-client",
    404405            "version": "1.0.3",
     
    455456            "install-path": "../psr/http-client"
    456457        },
    457         "32": {
     458        "33": {
    458459            "name": "psr/http-factory",
    459460            "version": "1.1.0",
     
    513514            "install-path": "../psr/http-factory"
    514515        },
    515         "33": {
     516        "34": {
    516517            "name": "psr/http-message",
    517518            "version": "2.0",
     
    569570            "install-path": "../psr/http-message"
    570571        },
    571         "36": {
     572        "37": {
    572573            "name": "ralouphie/getallheaders",
    573574            "version": "3.0.3",
     
    616617            "install-path": "../ralouphie/getallheaders"
    617618        },
    618         "44": {
     619        "45": {
    619620            "name": "symfony/deprecation-contracts",
    620621            "version": "v3.6.0",
     
    686687            "install-path": "../symfony/deprecation-contracts"
    687688        },
    688         "47": {
     689        "48": {
    689690            "name": "symfony/polyfill-ctype",
    690             "version": "v1.32.0",
    691             "version_normalized": "1.32.0.0",
     691            "version": "v1.33.0",
     692            "version_normalized": "1.33.0.0",
    692693            "source": {
    693694                "type": "git",
     
    750751            ],
    751752            "support": {
    752                 "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0"
     753                "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0"
    753754            },
    754755            "funding": [
     
    762763                },
    763764                {
     765                    "url": "https://github.com/nicolas-grekas",
     766                    "type": "github"
     767                },
     768                {
    764769                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
    765770                    "type": "tidelift"
     
    768773            "install-path": "../symfony/polyfill-ctype"
    769774        },
    770         "50": {
     775        "51": {
    771776            "name": "symfony/polyfill-mbstring",
    772             "version": "v1.32.0",
    773             "version_normalized": "1.32.0.0",
     777            "version": "v1.33.0",
     778            "version_normalized": "1.33.0.0",
    774779            "source": {
    775780                "type": "git",
     
    834839            ],
    835840            "support": {
    836                 "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0"
     841                "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0"
    837842            },
    838843            "funding": [
     
    846851                },
    847852                {
     853                    "url": "https://github.com/nicolas-grekas",
     854                    "type": "github"
     855                },
     856                {
    848857                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
    849858                    "type": "tidelift"
     
    852861            "install-path": "../symfony/polyfill-mbstring"
    853862        },
    854         "58": {
     863        "60": {
    855864            "name": "twig/twig",
    856             "version": "v3.21.1",
    857             "version_normalized": "3.21.1.0",
     865            "version": "v3.23.0",
     866            "version_normalized": "3.23.0.0",
    858867            "source": {
    859868                "type": "git",
    860869                "url": "https://github.com/twigphp/Twig.git",
    861                 "reference": "285123877d4dd97dd7c11842ac5fb7e86e60d81d"
    862             },
    863             "dist": {
    864                 "type": "zip",
    865                 "url": "https://api.github.com/repos/twigphp/Twig/zipball/285123877d4dd97dd7c11842ac5fb7e86e60d81d",
    866                 "reference": "285123877d4dd97dd7c11842ac5fb7e86e60d81d",
     870                "reference": "a64dc5d2cc7d6cafb9347f6cd802d0d06d0351c9"
     871            },
     872            "dist": {
     873                "type": "zip",
     874                "url": "https://api.github.com/repos/twigphp/Twig/zipball/a64dc5d2cc7d6cafb9347f6cd802d0d06d0351c9",
     875                "reference": "a64dc5d2cc7d6cafb9347f6cd802d0d06d0351c9",
    867876                "shasum": ""
    868877            },
     
    878887                "symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0"
    879888            },
    880             "time": "2025-05-03T07:21:55+00:00",
     889            "time": "2026-01-23T21:00:41+00:00",
    881890            "type": "library",
    882891            "installation-source": "dist",
     
    920929            "support": {
    921930                "issues": "https://github.com/twigphp/Twig/issues",
    922                 "source": "https://github.com/twigphp/Twig/tree/v3.21.1"
     931                "source": "https://github.com/twigphp/Twig/tree/v3.23.0"
    923932            },
    924933            "funding": [
  • makecommerce/trunk/makecommerce/vendor-prefixed/composer/installed.php

    r3318735 r3489939  
    55    'pretty_version' => 'dev-master',
    66    'version' => 'dev-master',
    7     'reference' => '8b4cb8bcd3e5c2eac26f2f7bbfabee8818520d8c',
     7    'reference' => 'b619b6efbbd00a4e883143e6f266623ebb43b47a',
    88    'type' => 'library',
    99    'install_path' => __DIR__ . '/../',
     
    1717    'guzzlehttp/guzzle' =>
    1818    array (
    19       'pretty_version' => '7.9.3',
    20       'version' => '7.9.3.0',
    21       'reference' => '7b2f29fe81dc4da0ca0ea7d42107a0845946ea77',
     19      'pretty_version' => '7.10.0',
     20      'version' => '7.10.0.0',
     21      'reference' => 'b51ac707cfa420b7bfd4e4d5e510ba8008e822b4',
    2222      'type' => 'library',
    2323      'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
     
    2929    'guzzlehttp/promises' =>
    3030    array (
    31       'pretty_version' => '2.2.0',
    32       'version' => '2.2.0.0',
    33       'reference' => '7c69f28996b0a6920945dd20b3857e499d9ca96c',
     31      'pretty_version' => '2.3.0',
     32      'version' => '2.3.0.0',
     33      'reference' => '481557b130ef3790cf82b713667b43030dc9c957',
    3434      'type' => 'library',
    3535      'install_path' => __DIR__ . '/../guzzlehttp/promises',
     
    4141    'guzzlehttp/psr7' =>
    4242    array (
    43       'pretty_version' => '2.7.1',
    44       'version' => '2.7.1.0',
    45       'reference' => 'c2270caaabe631b3b44c85f99e5a04bbb8060d16',
     43      'pretty_version' => '2.9.0',
     44      'version' => '2.9.0.0',
     45      'reference' => '7d0ed42f28e42d61352a7a79de682e5e67fec884',
    4646      'type' => 'library',
    4747      'install_path' => __DIR__ . '/../guzzlehttp/psr7',
     
    5353    'maksekeskus/php-shipping-sdk' =>
    5454    array (
    55       'pretty_version' => '1.5.1',
    56       'version' => '1.5.1.0',
    57       'reference' => '119c45a091f4c47ece0f5434b1f12b1a74217aff',
     55      'pretty_version' => '1.5.5',
     56      'version' => '1.5.5.0',
     57      'reference' => 'ced07b21189c5736a91bd5116c4607b0b28a4b13',
    5858      'type' => 'library',
    5959      'install_path' => __DIR__ . '/../maksekeskus/php-shipping-sdk',
     
    125125    'symfony/polyfill-ctype' =>
    126126    array (
    127       'pretty_version' => 'v1.32.0',
    128       'version' => '1.32.0.0',
     127      'pretty_version' => 'v1.33.0',
     128      'version' => '1.33.0.0',
    129129      'reference' => 'a3cc8b044a6ea513310cbd48ef7333b384945638',
    130130      'type' => 'library',
     
    137137    'symfony/polyfill-mbstring' =>
    138138    array (
    139       'pretty_version' => 'v1.32.0',
    140       'version' => '1.32.0.0',
     139      'pretty_version' => 'v1.33.0',
     140      'version' => '1.33.0.0',
    141141      'reference' => '6d857f4d76bd4b343eac26d6b539585d2bc56493',
    142142      'type' => 'library',
     
    149149    'twig/twig' =>
    150150    array (
    151       'pretty_version' => 'v3.21.1',
    152       'version' => '3.21.1.0',
    153       'reference' => '285123877d4dd97dd7c11842ac5fb7e86e60d81d',
     151      'pretty_version' => 'v3.23.0',
     152      'version' => '3.23.0.0',
     153      'reference' => 'a64dc5d2cc7d6cafb9347f6cd802d0d06d0351c9',
    154154      'type' => 'library',
    155155      'install_path' => __DIR__ . '/../twig/twig',
  • makecommerce/trunk/makecommerce/vendor-prefixed/composer/platform_check.php

    r3318735 r3489939  
    2020        }
    2121    }
    22     trigger_error(
    23         'Composer detected issues in your platform: ' . implode(' ', $issues),
    24         E_USER_ERROR
     22    throw new \RuntimeException(
     23        'Composer detected issues in your platform: ' . implode(' ', $issues)
    2524    );
    2625}
  • makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/guzzle/src/Handler/CurlFactory.php

    r3318735 r3489939  
    126126
    127127        if (\count($this->handles) >= $this->maxHandles) {
    128             \curl_close($resource);
     128            if (PHP_VERSION_ID < 80000) {
     129                \curl_close($resource);
     130            }
    129131        } else {
    130132            // Remove all callback functions as they can hold onto references
     
    730732    {
    731733        foreach ($this->handles as $id => $handle) {
    732             \curl_close($handle);
     734            if (PHP_VERSION_ID < 80000) {
     735                \curl_close($handle);
     736            }
     737
    733738            unset($this->handles[$id]);
    734739        }
  • makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php

    r3318735 r3489939  
    241241        unset($this->delays[$id], $this->handles[$id]);
    242242        \curl_multi_remove_handle($this->_mh, $handle);
    243         \curl_close($handle);
     243
     244        if (PHP_VERSION_ID < 80000) {
     245            \curl_close($handle);
     246        }
    244247
    245248        return true;
  • makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/guzzle/src/Handler/StreamHandler.php

    r3318735 r3489939  
    334334
    335335        return $this->createResource(
    336             function () use ($uri, &$http_response_header, $contextResource, $context, $options, $request) {
     336            function () use ($uri, $contextResource, $context, $options, $request) {
    337337                $resource = @\fopen((string) $uri, 'r', false, $contextResource);
     338
     339                // See https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_http_response_header_predefined_variable
     340                if (function_exists('http_get_last_response_headers')) {
     341                    /** @var array|null */
     342                    $http_response_header = \http_get_last_response_headers();
     343                }
     344
    338345                $this->lastHeaders = $http_response_header ?? [];
    339346
  • makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/guzzle/src/Middleware.php

    r3318735 r3489939  
    188188     * formatter.
    189189     *
    190      * @phpstan-param \Psr\Log\LogLevel::* $logLevel  Level at which to log requests.
    191      *
    192190     * @param LoggerInterface                            $logger    Logs messages.
    193191     * @param MessageFormatterInterface|MessageFormatter $formatter Formatter used to create message strings.
    194192     * @param string                                     $logLevel  Level at which to log requests.
     193     *
     194     * @phpstan-param \Psr\Log\LogLevel::* $logLevel Level at which to log requests.
    195195     *
    196196     * @return callable Returns a function that accepts the next handler.
  • makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/psr7/src/LimitStream.php

    r3318735 r3489939  
    6464        } elseif ($this->limit === -1) {
    6565            return $length - $this->offset;
    66         } else {
    67             return min($this->limit, $length - $this->offset);
    6866        }
     67
     68        return min($this->limit, $length - $this->offset);
    6969    }
    7070
  • makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/psr7/src/MessageTrait.php

    r3318735 r3489939  
    3030    }
    3131
     32    /**
     33     * @return static
     34     */
    3235    public function withProtocolVersion($version): MessageInterface
    3336    {
     
    7073    }
    7174
     75    /**
     76     * @return static
     77     */
    7278    public function withHeader($header, $value): MessageInterface
    7379    {
     
    8692    }
    8793
     94    /**
     95     * @return static
     96     */
    8897    public function withAddedHeader($header, $value): MessageInterface
    8998    {
     
    104113    }
    105114
     115    /**
     116     * @return static
     117     */
    106118    public function withoutHeader($header): MessageInterface
    107119    {
     
    129141    }
    130142
     143    /**
     144     * @return static
     145     */
    131146    public function withBody(StreamInterface $body): MessageInterface
    132147    {
     
    173188        if (!is_array($value)) {
    174189            return $this->trimAndValidateHeaderValues([$value]);
    175         }
    176 
    177         if (count($value) === 0) {
    178             throw new \InvalidArgumentException('Header value can not be an empty array.');
    179190        }
    180191
  • makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/psr7/src/MimeType.php

    r3318735 r3489939  
    88{
    99    private const MIME_TYPES = [
     10        '123' => 'application/vnd.lotus-1-2-3',
    1011        '1km' => 'application/vnd.1000minds.decision-model+xml',
     12        '210' => 'model/step',
    1113        '3dml' => 'text/vnd.in3d.3dml',
    1214        '3ds' => 'image/x-3ds',
    1315        '3g2' => 'video/3gpp2',
    14         '3gp' => 'video/3gp',
     16        '3gp' => 'video/3gpp',
    1517        '3gpp' => 'video/3gpp',
    1618        '3mf' => 'model/3mf',
    1719        '7z' => 'application/x-7z-compressed',
    1820        '7zip' => 'application/x-7z-compressed',
    19         '123' => 'application/vnd.lotus-1-2-3',
    2021        'aab' => 'application/x-authorware-bin',
    2122        'aac' => 'audio/aac',
     
    2324        'aas' => 'application/x-authorware-seg',
    2425        'abw' => 'application/x-abiword',
    25         'ac' => 'application/vnd.nokia.n-gage.ac+xml',
     26        'ac' => 'application/pkix-attr-cert',
    2627        'ac3' => 'audio/ac3',
    2728        'acc' => 'application/vnd.americandynamics.acc',
     
    3637        'age' => 'application/vnd.age',
    3738        'ahead' => 'application/vnd.ahead.space',
    38         'ai' => 'application/pdf',
     39        'ai' => 'application/postscript',
    3940        'aif' => 'audio/x-aiff',
    4041        'aifc' => 'audio/x-aiff',
     
    5657        'arc' => 'application/x-freearc',
    5758        'arj' => 'application/x-arj',
    58         'asc' => 'application/pgp-signature',
     59        'asc' => 'application/pgp-keys',
    5960        'asf' => 'video/x-ms-asf',
    6061        'asm' => 'text/x-asm',
     
    6768        'atomsvc' => 'application/atomsvc+xml',
    6869        'atx' => 'application/vnd.antix.game-component',
    69         'au' => 'audio/x-au',
     70        'au' => 'audio/basic',
    7071        'avci' => 'image/avci',
    7172        'avcs' => 'image/avcs',
     
    7879        'azw' => 'application/vnd.amazon.ebook',
    7980        'b16' => 'image/vnd.pco.b16',
     81        'bary' => 'model/vnd.bary',
    8082        'bat' => 'application/x-msdownload',
    8183        'bcpio' => 'application/x-bcpio',
    8284        'bdf' => 'application/x-font-bdf',
    8385        'bdm' => 'application/vnd.syncml.dm+wbxml',
    84         'bdoc' => 'application/x-bdoc',
     86        'bdo' => 'application/vnd.nato.bindingdataobject+xml',
     87        'bdoc' => 'application/bdoc',
    8588        'bed' => 'application/vnd.realvnc.bed',
    8689        'bh2' => 'application/vnd.fujitsu.oasysprs',
    8790        'bin' => 'application/octet-stream',
    8891        'blb' => 'application/x-blorb',
     92        'blend' => 'application/x-blender',
    8993        'blorb' => 'application/x-blorb',
    9094        'bmi' => 'application/vnd.bmi',
     
    96100        'bpk' => 'application/octet-stream',
    97101        'bpmn' => 'application/octet-stream',
     102        'brush' => 'application/vnd.procreate.brush',
     103        'brushset' => 'application/vnd.procreate.brushset',
    98104        'bsp' => 'model/vnd.valve.source.compiled-map',
    99105        'btf' => 'image/prs.btif',
     
    103109        'bz2' => 'application/x-bzip2',
    104110        'c' => 'text/x-c',
     111        'c11amc' => 'application/vnd.cluetrust.cartomobile-config',
     112        'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg',
    105113        'c4d' => 'application/vnd.clonk.c4group',
    106114        'c4f' => 'application/vnd.clonk.c4group',
     
    108116        'c4p' => 'application/vnd.clonk.c4group',
    109117        'c4u' => 'application/vnd.clonk.c4group',
    110         'c11amc' => 'application/vnd.cluetrust.cartomobile-config',
    111         'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg',
    112118        'cab' => 'application/vnd.ms-cab-compressed',
    113119        'caf' => 'audio/x-caf',
     
    133139        'cdmio' => 'application/cdmi-object',
    134140        'cdmiq' => 'application/cdmi-queue',
    135         'cdr' => 'application/cdr',
    136141        'cdx' => 'chemical/x-cdx',
    137142        'cdxml' => 'application/vnd.chemdraw+xml',
     
    148153        'cjs' => 'application/node',
    149154        'cla' => 'application/vnd.claymore',
    150         'class' => 'application/octet-stream',
     155        'class' => 'application/java-vm',
    151156        'cld' => 'model/vnd.cld',
    152157        'clkk' => 'application/vnd.crick.clicker.keyboard',
     
    195200        'dbf' => 'application/vnd.dbf',
    196201        'dbk' => 'application/docbook+xml',
     202        'dcm' => 'application/dicom',
     203        'dcmp' => 'application/vnd.dcmp+xml',
    197204        'dcr' => 'application/x-director',
    198205        'dcurl' => 'text/vnd.curl.dcurl',
     
    222229        'dms' => 'application/octet-stream',
    223230        'dna' => 'application/vnd.dna',
     231        'dng' => 'image/x-adobe-dng',
    224232        'doc' => 'application/msword',
    225         'docm' => 'application/vnd.ms-word.template.macroEnabled.12',
     233        'docm' => 'application/vnd.ms-word.document.macroenabled.12',
    226234        'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
    227235        'dot' => 'application/msword',
    228         'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
     236        'dotm' => 'application/vnd.ms-word.template.macroenabled.12',
    229237        'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
    230238        'dp' => 'application/vnd.osgi.dp',
     
    233241        'dra' => 'audio/vnd.dra',
    234242        'drle' => 'image/dicom-rle',
     243        'drm' => 'application/vnd.procreate.dream',
    235244        'dsc' => 'text/prs.lines.tag',
    236245        'dssc' => 'application/dssc+der',
     246        'dst' => 'application/octet-stream',
    237247        'dtb' => 'application/x-dtbook+xml',
    238248        'dtd' => 'application/xml-dtd',
     
    286296        'f77' => 'text/x-fortran',
    287297        'f90' => 'text/x-fortran',
     298        'facti' => 'image/vnd.blockfact.facti',
    288299        'fbs' => 'image/vnd.fastbidsheet',
     300        'fbx' => 'application/vnd.autodesk.fbx',
    289301        'fcdt' => 'application/vnd.adobe.formscentral.fcdt',
    290302        'fcs' => 'application/vnd.isac.fcs',
    291         'fdf' => 'application/vnd.fdf',
     303        'fdf' => 'application/fdf',
    292304        'fdt' => 'application/fdt+xml',
    293305        'fe_launch' => 'application/vnd.denovo.fcselayout-link',
     
    331343        'gdl' => 'model/vnd.gdl',
    332344        'gdoc' => 'application/vnd.google-apps.document',
     345        'gdraw' => 'application/vnd.google-apps.drawing',
    333346        'ged' => 'text/vnd.familysearch.gedcom',
    334347        'geo' => 'application/vnd.dynageo',
    335348        'geojson' => 'application/geo+json',
    336349        'gex' => 'application/vnd.geometry-explorer',
     350        'gform' => 'application/vnd.google-apps.form',
    337351        'ggb' => 'application/vnd.geogebra.file',
     352        'ggs' => 'application/vnd.geogebra.slides',
    338353        'ggt' => 'application/vnd.geogebra.tool',
    339354        'ghf' => 'application/vnd.groove-help',
    340355        'gif' => 'image/gif',
    341356        'gim' => 'application/vnd.groove-identity-message',
     357        'gjam' => 'application/vnd.google-apps.jam',
    342358        'glb' => 'model/gltf-binary',
    343359        'gltf' => 'model/gltf+json',
     360        'gmap' => 'application/vnd.google-apps.map',
    344361        'gml' => 'application/gml+xml',
    345362        'gmx' => 'application/vnd.gmx',
    346363        'gnumeric' => 'application/x-gnumeric',
    347         'gpg' => 'application/gpg-keys',
    348364        'gph' => 'application/vnd.flographit',
    349365        'gpx' => 'application/gpx+xml',
     
    355371        'grv' => 'application/vnd.groove-injector',
    356372        'grxml' => 'application/srgs+xml',
     373        'gscript' => 'application/vnd.google-apps.script',
    357374        'gsf' => 'application/x-font-ghostscript',
    358375        'gsheet' => 'application/vnd.google-apps.spreadsheet',
     376        'gsite' => 'application/vnd.google-apps.site',
    359377        'gslides' => 'application/vnd.google-apps.presentation',
    360378        'gtar' => 'application/x-gtar',
     
    388406        'hps' => 'application/vnd.hp-hps',
    389407        'hqx' => 'application/mac-binhex40',
    390         'hsj2' => 'image/hsj2',
    391408        'htc' => 'text/x-component',
    392409        'htke' => 'application/vnd.kenameaapp',
     
    400417        'ice' => 'x-conference/x-cooltalk',
    401418        'icm' => 'application/vnd.iccprofile',
    402         'ico' => 'image/x-icon',
     419        'ico' => 'image/vnd.microsoft.icon',
    403420        'ics' => 'text/calendar',
    404421        'ief' => 'image/ief',
     
    415432        'ims' => 'application/vnd.ms-ims',
    416433        'in' => 'text/plain',
     434        'indd' => 'application/x-indesign',
    417435        'ini' => 'text/plain',
    418436        'ink' => 'application/inkml+xml',
     
    422440        'ipfix' => 'application/ipfix',
    423441        'ipk' => 'application/vnd.shana.informed.package',
     442        'ipynb' => 'application/x-ipynb+json',
    424443        'irm' => 'application/vnd.ibm.rights-management',
    425444        'irp' => 'application/vnd.irepository.package+xml',
     
    431450        'jad' => 'text/vnd.sun.j2me.app-descriptor',
    432451        'jade' => 'text/jade',
     452        'jaii' => 'image/jaii',
     453        'jais' => 'image/jais',
    433454        'jam' => 'application/vnd.jam',
    434455        'jar' => 'application/java-archive',
    435456        'jardiff' => 'application/x-java-archive-diff',
    436457        'java' => 'text/x-java-source',
     458        'jfif' => 'image/jpeg',
    437459        'jhc' => 'image/jphc',
    438460        'jisp' => 'application/vnd.jisp',
     
    448470        'jpg' => 'image/jpeg',
    449471        'jpg2' => 'image/jp2',
    450         'jpgm' => 'video/jpm',
     472        'jpgm' => 'image/jpm',
    451473        'jpgv' => 'video/jpeg',
    452474        'jph' => 'image/jph',
    453         'jpm' => 'video/jpm',
     475        'jpm' => 'image/jpm',
    454476        'jpx' => 'image/jpx',
    455         'js' => 'application/javascript',
     477        'js' => 'text/javascript',
    456478        'json' => 'application/json',
    457479        'json5' => 'application/json5',
     
    460482        'jsx' => 'text/jsx',
    461483        'jt' => 'model/jt',
     484        'jxl' => 'image/jxl',
    462485        'jxr' => 'image/jxr',
    463486        'jxra' => 'image/jxra',
     
    469492        'kar' => 'audio/midi',
    470493        'karbon' => 'application/vnd.kde.karbon',
     494        'kbl' => 'application/kbl+xml',
    471495        'kdb' => 'application/octet-stream',
    472496        'kdbx' => 'application/x-keepass2',
    473         'key' => 'application/x-iwork-keynote-sffkey',
     497        'key' => 'application/vnd.apple.keynote',
    474498        'kfo' => 'application/vnd.kde.kformula',
    475499        'kia' => 'application/vnd.kidspiration',
     
    496520        'less' => 'text/less',
    497521        'lgr' => 'application/lgr+xml',
    498         'lha' => 'application/octet-stream',
     522        'lha' => 'application/x-lzh-compressed',
    499523        'link66' => 'application/vnd.route66.link66+xml',
    500524        'list' => 'text/plain',
     
    505529        'log' => 'text/plain',
    506530        'lostxml' => 'application/lost+xml',
     531        'lottie' => 'application/zip+dotlottie',
    507532        'lrf' => 'application/octet-stream',
    508533        'lrm' => 'application/vnd.ms-lrm',
     
    512537        'lvp' => 'audio/vnd.lucent.voice',
    513538        'lwp' => 'application/vnd.lotus-wordpro',
    514         'lzh' => 'application/octet-stream',
     539        'lzh' => 'application/x-lzh-compressed',
     540        'm13' => 'application/x-msmediaview',
     541        'm14' => 'application/x-msmediaview',
    515542        'm1v' => 'video/mpeg',
     543        'm21' => 'application/mp21',
    516544        'm2a' => 'audio/mpeg',
     545        'm2t' => 'video/mp2t',
     546        'm2ts' => 'video/mp2t',
    517547        'm2v' => 'video/mpeg',
    518548        'm3a' => 'audio/mpeg',
    519         'm3u' => 'text/plain',
     549        'm3u' => 'audio/x-mpegurl',
    520550        'm3u8' => 'application/vnd.apple.mpegurl',
    521         'm4a' => 'audio/x-m4a',
     551        'm4a' => 'audio/mp4',
     552        'm4b' => 'audio/mp4',
    522553        'm4p' => 'application/mp4',
    523554        'm4s' => 'video/iso.segment',
    524         'm4u' => 'application/vnd.mpegurl',
     555        'm4u' => 'video/vnd.mpegurl',
    525556        'm4v' => 'video/x-m4v',
    526         'm13' => 'application/x-msmediaview',
    527         'm14' => 'application/x-msmediaview',
    528         'm21' => 'application/mp21',
    529557        'ma' => 'application/mathematica',
    530558        'mads' => 'application/mads+xml',
     
    557585        'mgp' => 'application/vnd.osgeo.mapguide.package',
    558586        'mgz' => 'application/vnd.proteus.magazine',
     587        'mht' => 'message/rfc822',
     588        'mhtml' => 'message/rfc822',
    559589        'mid' => 'audio/midi',
    560590        'midi' => 'audio/midi',
     
    565595        'mjp2' => 'video/mj2',
    566596        'mjs' => 'text/javascript',
    567         'mk3d' => 'video/x-matroska',
    568         'mka' => 'audio/x-matroska',
     597        'mk3d' => 'video/matroska-3d',
     598        'mka' => 'audio/matroska',
    569599        'mkd' => 'text/x-markdown',
    570600        'mks' => 'video/x-matroska',
    571         'mkv' => 'video/x-matroska',
     601        'mkv' => 'video/matroska',
    572602        'mlp' => 'application/vnd.dolby.mlp',
    573603        'mmd' => 'application/vnd.chipnuts.karaoke-mmd',
     
    582612        'movie' => 'video/x-sgi-movie',
    583613        'mp2' => 'audio/mpeg',
     614        'mp21' => 'application/mp21',
    584615        'mp2a' => 'audio/mpeg',
    585616        'mp3' => 'audio/mpeg',
     
    588619        'mp4s' => 'application/mp4',
    589620        'mp4v' => 'video/mp4',
    590         'mp21' => 'application/mp21',
    591621        'mpc' => 'application/vnd.mophun.certificate',
    592622        'mpd' => 'application/dash+xml',
     
    613643        'msg' => 'application/vnd.ms-outlook',
    614644        'msh' => 'model/mesh',
    615         'msi' => 'application/x-msdownload',
     645        'msi' => 'application/octet-stream',
    616646        'msix' => 'application/msix',
    617647        'msixbundle' => 'application/msixbundle',
     
    621651        'msty' => 'application/vnd.muvee.style',
    622652        'mtl' => 'model/mtl',
    623         'mts' => 'model/vnd.mts',
     653        'mts' => 'video/mp2t',
    624654        'mus' => 'application/vnd.musician',
    625655        'musd' => 'application/mmt-usd+xml',
     
    640670        'nc' => 'application/x-netcdf',
    641671        'ncx' => 'application/x-dtbncx+xml',
     672        'ndjson' => 'application/x-ndjson',
    642673        'nfo' => 'text/x-nfo',
    643674        'ngdat' => 'application/vnd.nokia.n-gage.data',
     
    654685        'nt' => 'application/n-triples',
    655686        'ntf' => 'application/vnd.nitf',
    656         'numbers' => 'application/x-iwork-numbers-sffnumbers',
     687        'numbers' => 'application/vnd.apple.numbers',
    657688        'nzb' => 'application/x-nzb',
    658689        'oa2' => 'application/vnd.fujitsu.oasys2',
     
    679710        'ogx' => 'application/ogg',
    680711        'omdoc' => 'application/omdoc+xml',
     712        'one' => 'application/onenote',
     713        'onea' => 'application/onenote',
    681714        'onepkg' => 'application/onenote',
    682715        'onetmp' => 'application/onenote',
     
    687720        'oprc' => 'application/vnd.palm',
    688721        'opus' => 'audio/ogg',
    689         'org' => 'text/x-org',
     722        'org' => 'application/vnd.lotus-organizer',
    690723        'osf' => 'application/vnd.yamaha.openscoreformat',
    691724        'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml',
     
    705738        'oxt' => 'application/vnd.openofficeorg.extension',
    706739        'p' => 'text/x-pascal',
     740        'p10' => 'application/pkcs10',
     741        'p12' => 'application/x-pkcs12',
     742        'p21' => 'model/step',
    707743        'p7a' => 'application/x-pkcs7-signature',
    708744        'p7b' => 'application/x-pkcs7-certificates',
    709745        'p7c' => 'application/pkcs7-mime',
     746        'p7e' => 'application/pkcs7-mime',
    710747        'p7m' => 'application/pkcs7-mime',
    711748        'p7r' => 'application/x-pkcs7-certreqresp',
    712749        'p7s' => 'application/pkcs7-signature',
    713750        'p8' => 'application/pkcs8',
    714         'p10' => 'application/x-pkcs10',
    715         'p12' => 'application/x-pkcs12',
    716751        'pac' => 'application/x-ns-proxy-autoconfig',
    717         'pages' => 'application/x-iwork-pages-sffpages',
     752        'pages' => 'application/vnd.apple.pages',
     753        'parquet' => 'application/vnd.apache.parquet',
    718754        'pas' => 'text/x-pascal',
    719755        'paw' => 'application/vnd.pawaafile',
     
    726762        'pct' => 'image/x-pict',
    727763        'pcurl' => 'application/vnd.curl.pcurl',
    728         'pcx' => 'image/x-pcx',
    729         'pdb' => 'application/x-pilot',
     764        'pcx' => 'image/vnd.zbrush.pcx',
     765        'pdb' => 'application/vnd.palm',
    730766        'pde' => 'text/x-processing',
    731767        'pdf' => 'application/pdf',
     
    738774        'pgm' => 'image/x-portable-graymap',
    739775        'pgn' => 'application/x-chess-pgn',
    740         'pgp' => 'application/pgp',
     776        'pgp' => 'application/pgp-encrypted',
    741777        'phar' => 'application/octet-stream',
    742778        'php' => 'application/x-httpd-php',
     
    761797        'portpkg' => 'application/vnd.macports.portpkg',
    762798        'pot' => 'application/vnd.ms-powerpoint',
    763         'potm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
     799        'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12',
    764800        'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
    765801        'ppa' => 'application/vnd.ms-powerpoint',
    766         'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
     802        'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12',
    767803        'ppd' => 'application/vnd.cups-ppd',
    768804        'ppm' => 'image/x-portable-pixmap',
    769805        'pps' => 'application/vnd.ms-powerpoint',
    770         'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
     806        'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12',
    771807        'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
    772         'ppt' => 'application/powerpoint',
    773         'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
     808        'ppt' => 'application/vnd.ms-powerpoint',
     809        'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12',
    774810        'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
    775811        'pqa' => 'application/vnd.palm',
     
    780816        'ps' => 'application/postscript',
    781817        'psb' => 'application/vnd.3gpp.pic-bw-small',
    782         'psd' => 'application/x-photoshop',
     818        'psd' => 'image/vnd.adobe.photoshop',
    783819        'psf' => 'application/x-font-linux-psf',
    784820        'pskcxml' => 'application/pskc+xml',
     
    786822        'ptid' => 'application/vnd.pvi.ptid1',
    787823        'pub' => 'application/x-mspublisher',
     824        'pv' => 'application/octet-stream',
    788825        'pvb' => 'application/vnd.3gpp.pic-bw-var',
    789826        'pwn' => 'application/vnd.3m.post-it-notes',
     827        'pxf' => 'application/octet-stream',
    790828        'pya' => 'audio/vnd.ms-playready.media.pya',
    791829        'pyo' => 'model/vnd.pytha.pyox',
     
    807845        'raml' => 'application/raml+yaml',
    808846        'rapd' => 'application/route-apd+xml',
    809         'rar' => 'application/x-rar',
     847        'rar' => 'application/vnd.rar',
    810848        'ras' => 'image/x-cmu-raster',
    811849        'rcprofile' => 'application/vnd.ipunplugged.rcprofile',
     
    822860        'rlc' => 'image/vnd.fujixerox.edmics-rlc',
    823861        'rld' => 'application/resource-lists-diff+xml',
    824         'rm' => 'audio/x-pn-realaudio',
     862        'rm' => 'application/vnd.rn-realmedia',
    825863        'rmi' => 'audio/midi',
    826864        'rmp' => 'audio/x-pn-realaudio-plugin',
     
    832870        'roff' => 'text/troff',
    833871        'rp9' => 'application/vnd.cloanto.rp9',
    834         'rpm' => 'audio/x-pn-realaudio-plugin',
     872        'rpm' => 'application/x-redhat-package-manager',
    835873        'rpss' => 'application/vnd.nokia.radio-presets',
    836874        'rpst' => 'application/vnd.nokia.radio-preset',
     
    866904        'sdp' => 'application/sdp',
    867905        'sdw' => 'application/vnd.stardivision.writer',
    868         'sea' => 'application/octet-stream',
     906        'sea' => 'application/x-sea',
    869907        'see' => 'application/vnd.seemail',
    870908        'seed' => 'application/vnd.fdsn.seed',
     
    911949        'sm' => 'application/vnd.stepmania.stepchart',
    912950        'smf' => 'application/vnd.stardivision.math',
    913         'smi' => 'application/smil',
    914         'smil' => 'application/smil',
     951        'smi' => 'application/smil+xml',
     952        'smil' => 'application/smil+xml',
    915953        'smv' => 'video/x-smv',
    916954        'smzip' => 'application/vnd.stepmania.package',
     
    926964        'spq' => 'application/scvp-vp-request',
    927965        'spx' => 'audio/ogg',
    928         'sql' => 'application/x-sql',
     966        'sql' => 'application/sql',
     967        'sqlite' => 'application/vnd.sqlite3',
     968        'sqlite3' => 'application/vnd.sqlite3',
    929969        'src' => 'application/x-wais-source',
    930970        'srt' => 'application/x-subrip',
     
    939979        'stc' => 'application/vnd.sun.xml.calc.template',
    940980        'std' => 'application/vnd.sun.xml.draw.template',
    941         'step' => 'application/STEP',
     981        'step' => 'model/step',
    942982        'stf' => 'application/vnd.wt.stf',
    943983        'sti' => 'application/vnd.sun.xml.impress.template',
    944984        'stk' => 'application/hyperstudio',
    945985        'stl' => 'model/stl',
    946         'stp' => 'application/STEP',
     986        'stp' => 'model/step',
     987        'stpnc' => 'model/step',
    947988        'stpx' => 'model/step+xml',
    948989        'stpxz' => 'model/step-xml+zip',
     
    952993        'styl' => 'text/stylus',
    953994        'stylus' => 'text/stylus',
    954         'sub' => 'text/vnd.dvb.subtitle',
     995        'sub' => 'image/vnd.dvb.subtitle',
    955996        'sus' => 'application/vnd.sus-calendar',
    956997        'susp' => 'application/vnd.sus-calendar',
     
    9711012        'sxm' => 'application/vnd.sun.xml.math',
    9721013        'sxw' => 'application/vnd.sun.xml.writer',
     1014        'systemverify' => 'application/vnd.pp.systemverify+xml',
    9731015        't' => 'text/troff',
    9741016        't3' => 'application/x-t3vm-image',
     
    9921034        'tfx' => 'image/tiff-fx',
    9931035        'tga' => 'image/x-tga',
    994         'tgz' => 'application/x-tar',
     1036        'tgz' => 'application/gzip',
    9951037        'thmx' => 'application/vnd.ms-officetheme',
    9961038        'tif' => 'image/tiff',
     
    10181060        'txf' => 'application/vnd.mobius.txf',
    10191061        'txt' => 'text/plain',
     1062        'u32' => 'application/x-authorware-bin',
    10201063        'u3d' => 'model/u3d',
    10211064        'u8dsn' => 'message/global-delivery-status',
     
    10231066        'u8mdn' => 'message/global-disposition-notification',
    10241067        'u8msg' => 'message/global',
    1025         'u32' => 'application/x-authorware-bin',
    10261068        'ubj' => 'application/ubjson',
    10271069        'udeb' => 'application/x-debian-package',
     
    10791121        'vdi' => 'application/x-virtualbox-vdi',
    10801122        'vds' => 'model/vnd.sap.vds',
     1123        'vdx' => 'application/vnd.ms-visio.viewer',
     1124        'vec' => 'application/vec+xml',
    10811125        'vhd' => 'application/x-virtualbox-vhd',
    10821126        'vis' => 'application/vnd.visionary',
    10831127        'viv' => 'video/vnd.vivo',
    1084         'vlc' => 'application/videolan',
    10851128        'vmdk' => 'application/x-virtualbox-vmdk',
    10861129        'vob' => 'video/x-ms-vob',
     
    10891132        'vrml' => 'model/vrml',
    10901133        'vsd' => 'application/vnd.visio',
     1134        'vsdx' => 'application/vnd.visio',
    10911135        'vsf' => 'application/vnd.vsf',
    10921136        'vss' => 'application/vnd.visio',
     
    10961140        'vtt' => 'text/vtt',
    10971141        'vtu' => 'model/vnd.vtu',
     1142        'vtx' => 'application/vnd.visio',
    10981143        'vxml' => 'application/voicexml+xml',
    10991144        'w3d' => 'application/x-director',
     
    11021147        'war' => 'application/java-archive',
    11031148        'wasm' => 'application/wasm',
    1104         'wav' => 'audio/x-wav',
     1149        'wav' => 'audio/wav',
    11051150        'wax' => 'audio/x-ms-wax',
    11061151        'wbmp' => 'image/vnd.wap.wbmp',
    11071152        'wbs' => 'application/vnd.criticaltools.wbs+xml',
    1108         'wbxml' => 'application/wbxml',
     1153        'wbxml' => 'application/vnd.wap.wbxml',
    11091154        'wcm' => 'application/vnd.ms-works',
    11101155        'wdb' => 'application/vnd.ms-works',
     
    11251170        'wmf' => 'image/wmf',
    11261171        'wml' => 'text/vnd.wap.wml',
    1127         'wmlc' => 'application/wmlc',
     1172        'wmlc' => 'application/vnd.wap.wmlc',
    11281173        'wmls' => 'text/vnd.wap.wmlscript',
    11291174        'wmlsc' => 'application/vnd.wap.wmlscriptc',
    11301175        'wmv' => 'video/x-ms-wmv',
    11311176        'wmx' => 'video/x-ms-wmx',
    1132         'wmz' => 'application/x-msmetafile',
     1177        'wmz' => 'application/x-ms-wmz',
    11331178        'woff' => 'font/woff',
    11341179        'woff2' => 'font/woff2',
     
    11451190        'wtb' => 'application/vnd.webturbo',
    11461191        'wvx' => 'video/x-ms-wvx',
     1192        'x32' => 'application/x-authorware-bin',
    11471193        'x3d' => 'model/x3d+xml',
    11481194        'x3db' => 'model/x3d+fastinfoset',
     
    11511197        'x3dvz' => 'model/x3d+vrml',
    11521198        'x3dz' => 'model/x3d+xml',
    1153         'x32' => 'application/x-authorware-bin',
    11541199        'x_b' => 'model/vnd.parasolid.transmit.binary',
    11551200        'x_t' => 'model/vnd.parasolid.transmit.text',
     
    11631208        'xca' => 'application/xcap-caps+xml',
    11641209        'xcs' => 'application/calendar+xml',
     1210        'xdcf' => 'application/vnd.gov.sk.xmldatacontainer+xml',
    11651211        'xdf' => 'application/xcap-diff+xml',
    11661212        'xdm' => 'application/vnd.syncml.dm+xml',
     
    11781224        'xhvml' => 'application/xv+xml',
    11791225        'xif' => 'image/vnd.xiff',
    1180         'xl' => 'application/excel',
     1226        'xl' => 'application/vnd.ms-excel',
    11811227        'xla' => 'application/vnd.ms-excel',
    1182         'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
     1228        'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12',
    11831229        'xlc' => 'application/vnd.ms-excel',
    11841230        'xlf' => 'application/xliff+xml',
    11851231        'xlm' => 'application/vnd.ms-excel',
    11861232        'xls' => 'application/vnd.ms-excel',
    1187         'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
    1188         'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
     1233        'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12',
     1234        'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12',
    11891235        'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
    11901236        'xlt' => 'application/vnd.ms-excel',
    1191         'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12',
     1237        'xltm' => 'application/vnd.ms-excel.template.macroenabled.12',
    11921238        'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
    11931239        'xlw' => 'application/vnd.ms-excel',
     
    12061252        'xsd' => 'application/xml',
    12071253        'xsf' => 'application/prs.xsf+xml',
    1208         'xsl' => 'application/xml',
     1254        'xsl' => 'application/xslt+xml',
    12091255        'xslt' => 'application/xslt+xml',
    12101256        'xsm' => 'application/vnd.syncml+xml',
  • makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/psr7/src/MultipartStream.php

    r3318735 r3489939  
    2424     * @param array  $elements Array of associative arrays, each containing a
    2525     *                         required "name" key mapping to the form field,
    26      *                         name, a required "contents" key mapping to a
    27      *                         StreamInterface/resource/string, an optional
    28      *                         "headers" associative array of custom headers,
    29      *                         and an optional "filename" key mapping to a
    30      *                         string to send as the filename in the part.
     26     *                         name, a required "contents" key mapping to any
     27     *                         value accepted by Utils::streamFor() (scalar,
     28     *                         null, resource, StreamInterface, Iterator, or
     29     *                         callable), or an array for nested expansion.
     30     *                         Optional keys include "headers" (associative
     31     *                         array of custom headers) and "filename" (string
     32     *                         to send as the filename in the part).
     33     *                         When "contents" is an array, it is recursively
     34     *                         expanded into multiple fields using bracket notation
     35     *                         (e.g., name[0][key]). Empty arrays produce no fields.
     36     *                         The "filename" and "headers" options cannot be used
     37     *                         with array contents.
    3138     * @param string $boundary You can optionally provide a specific boundary
    3239     *
     
    9097                throw new \InvalidArgumentException("A '{$key}' key is required");
    9198            }
     99        }
     100
     101        if (!is_string($element['name']) && !is_int($element['name'])) {
     102            throw new \InvalidArgumentException("The 'name' key must be a string or integer");
     103        }
     104
     105        if (is_array($element['contents'])) {
     106            if (array_key_exists('filename', $element) || array_key_exists('headers', $element)) {
     107                throw new \InvalidArgumentException(
     108                    "The 'filename' and 'headers' options cannot be used when 'contents' is an array"
     109                );
     110            }
     111
     112            $this->addNestedElements($stream, $element['contents'], (string) $element['name']);
     113
     114            return;
    92115        }
    93116
     
    102125
    103126        [$body, $headers] = $this->createElement(
    104             $element['name'],
     127            (string) $element['name'],
    105128            $element['contents'],
    106129            $element['filename'] ?? null,
     
    111134        $stream->addStream($body);
    112135        $stream->addStream(Utils::streamFor("\r\n"));
     136    }
     137
     138    /**
     139     * Recursively expand array contents into multiple form fields.
     140     *
     141     * @param array<array-key, mixed> $contents
     142     */
     143    private function addNestedElements(AppendStream $stream, array $contents, string $root): void
     144    {
     145        foreach ($contents as $key => $value) {
     146            $fieldName = $root === '' ? sprintf('[%s]', (string) $key) : sprintf('%s[%s]', $root, (string) $key);
     147
     148            if (is_array($value)) {
     149                $this->addNestedElements($stream, $value, $fieldName);
     150            } else {
     151                $this->addElement($stream, ['name' => $fieldName, 'contents' => $value]);
     152            }
     153        }
    113154    }
    114155
  • makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/psr7/src/Request.php

    r3318735 r3489939  
    4141    ) {
    4242        $this->assertMethod($method);
    43         if (!($uri instanceof UriInterface)) {
     43        if (!$uri instanceof UriInterface) {
    4444            $uri = new Uri($uri);
    4545        }
  • makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/psr7/src/Uri.php

    r3318735 r3489939  
    5252     */
    5353    private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;=';
    54     private const QUERY_SEPARATORS_REPLACEMENT = ['=' => '%3D', '&' => '%26'];
     54    private const QUERY_SEPARATORS_REPLACEMENT = ['=' => '%3D', '&' => '%26', '+' => '%2B'];
    5555
    5656    /** @var string Uri scheme. */
     
    662662    private static function generateQueryString(string $key, ?string $value): string
    663663    {
    664         // Query string separators ("=", "&") within the key or value need to be encoded
     664        // Query string separators ("=", "&") and literal plus signs ("+") within the
     665        // key or value need to be encoded
    665666        // (while preventing double-encoding) before setting the query string. All other
    666667        // chars that need percent-encoding will be encoded by withQuery().
  • makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/psr7/src/Utils.php

    r3318735 r3489939  
    398398
    399399        if ($ex) {
    400             /** @var $ex \RuntimeException */
     400            /** @var \RuntimeException $ex */
    401401            throw $ex;
    402402        }
     
    445445
    446446        if ($ex) {
    447             /** @var $ex \RuntimeException */
     447            /** @var \RuntimeException $ex */
    448448            throw $ex;
    449449        }
  • makecommerce/trunk/makecommerce/vendor-prefixed/maksekeskus/php-shipping-sdk/src/MakeCommerce/Http/HttpClientInterface.php

    r3318735 r3489939  
    88    public const POST = 'POST';
    99    public const PUT = 'PUT';
    10     public const DEV_BASE_URI = 'https://shipping.dev.makecommerce.net';
    11     public const TEST_BASE_URI = 'https://shipping.test.makecommerce.net';
    12     public const LIVE_BASE_URI = 'https://shipping.makecommerce.net';
     10    public const DEV_SHIPPING_URI = 'https://shipping.dev.makecommerce.net';
     11    public const TEST_SHIPPING_URI = 'https://shipping.test.makecommerce.net';
     12    public const LIVE_SHIPPING_URI = 'https://shipping.makecommerce.net';
    1313    public const DEV_MANAGER_URI = 'https://shipping-manager.dev.makecommerce.net';
    1414    public const TEST_MANAGER_URI = 'https://shipping-manager.test.makecommerce.net';
    1515    public const LIVE_MANAGER_URI = 'https://shipping-manager.makecommerce.net';
     16    public const DEV_API_URI = 'https://api.dev.maksekeskus.ee';
     17    public const TEST_API_URI = 'https://api.test.maksekeskus.ee';
     18    public const LIVE_API_URI = 'https://api.maksekeskus.ee';
     19    public const REQUEST_TYPE_MANAGER = 'manager';
     20    public const REQUEST_TYPE_SHIPPING = 'shipping';
     21    public const REQUEST_TYPE_API = 'api';
    1622
    1723    public const PICKUPPOINT_RESOURCES = [
    18         'listPickupPoints' => '/pickuppoint',
    1924        'listCarrierDestinations' => '/pickuppoint/{country}'
    20     ];
    21 
    22     public const COURIER_RESOURCES = [
    23         'listCouriers' => '/courier'
    2425    ];
    2526
     
    4344    ];
    4445
     46    public const CONFIGURATION_RESOURCES = [
     47        'subscription' => '/v1/subscription/activate',
     48        'deactivateSubscription' => '/v1/subscription/deactivate'
     49    ];
     50
    4551    public const TYPE_PICKUPPOINT = 'pickuppoint';
    4652
  • makecommerce/trunk/makecommerce/vendor-prefixed/maksekeskus/php-shipping-sdk/src/MakeCommerce/Http/MakeCommerceClient.php

    r3318735 r3489939  
    66use MakeCommercePrefix\GuzzleHttp\Client;
    77use MakeCommercePrefix\GuzzleHttp\Exception\GuzzleException;
     8use MakeCommercePrefix\GuzzleHttp\Exception\InvalidArgumentException;
    89use MakeCommercePrefix\MakeCommerceShipping\SDK\Environment;
    910use MakeCommercePrefix\MakeCommerceShipping\SDK\Exception\MCException;
     
    1617     * @var string
    1718     */
     19    private string $shippingUrl;
     20
     21    /**
     22     * @var string
     23     */
     24    private string $managerUrl;
     25
     26    /**
     27     * @var string
     28     */
    1829    private string $apiUrl;
    19 
    20     /**
    21      * @var string
    22      */
    23     private string $managerUrl;
    2430
    2531    /**
     
    6470        switch ($environment) {
    6571            case Environment::DEV:
    66                 $this->setApiUrl(self::DEV_BASE_URI);
     72                $this->setShippingUrl(self::DEV_SHIPPING_URI);
    6773                $this->setManagerUrl(self::DEV_MANAGER_URI);
     74                $this->setApiUrl(self::DEV_API_URI);
    6875                break;
    6976            case Environment::TEST:
    70                 $this->setApiUrl(self::TEST_BASE_URI);
     77                $this->setShippingUrl(self::TEST_SHIPPING_URI);
    7178                $this->setManagerUrl(self::TEST_MANAGER_URI);
     79                $this->setApiUrl(self::TEST_API_URI);
    7280                break;
    7381            case Environment::LIVE:
    74                 $this->setApiUrl(self::LIVE_BASE_URI);
     82                $this->setShippingUrl(self::LIVE_SHIPPING_URI);
    7583                $this->setManagerUrl(self::LIVE_MANAGER_URI);
     84                $this->setApiUrl(self::LIVE_API_URI);
    7685                break;
    7786        }
     
    8897     * @return void
    8998     */
    90     public function setApiUrl(string $url)
    91     {
    92         $this->apiUrl = $url;
     99    public function setShippingUrl(string $url)
     100    {
     101        $this->shippingUrl = $url;
    93102    }
    94103
     
    102111    }
    103112
     113    /**
     114     * @param string $url
     115     * @return void
     116     */
     117    public function setApiUrl(string $url)
     118    {
     119        $this->apiUrl = $url;
     120    }
    104121
    105122    /**
     
    110127    {
    111128        $this->locale = $locale;
    112     }
    113 
    114     /**
    115      * @return array
    116      * @throws Exception
    117      * @throws GuzzleException|MCException
    118      */
    119     //TODO How will this change with the flattening
    120     public function getPickuppoints(): array
    121     {
    122         return $this->makeApiRequest(self::GET, self::PICKUPPOINT_RESOURCES['listPickupPoints'])->body;
    123129    }
    124130
     
    134140     * @param array $body
    135141     * @param array $additionalHeaders
    136      * @param bool $managerRequest
     142     * @param string $requestType
    137143     * @return MCResponse
    138144     * @throws GuzzleException
     
    144150        array $body = [],
    145151        array $additionalHeaders = [],
    146         bool $managerRequest = false
     152        string $requestType = self::REQUEST_TYPE_SHIPPING
    147153    ): MCResponse {
    148         $uri = $this->apiUrl . $endpoint;
    149         if ($managerRequest) {
    150             $uri = $this->managerUrl . $endpoint;
    151         }
     154        if (
     155            !in_array($requestType, [
     156            self::REQUEST_TYPE_MANAGER,
     157            self::REQUEST_TYPE_SHIPPING,
     158            self::REQUEST_TYPE_API])
     159        ) {
     160            throw new InvalidArgumentException('Unknown request type: ' . $requestType);
     161        }
     162        switch ($requestType) {
     163            case self::REQUEST_TYPE_API:
     164                $uri = $this->apiUrl;
     165                break;
     166            case self::REQUEST_TYPE_SHIPPING:
     167                $uri = $this->shippingUrl;
     168                break;
     169            case self::REQUEST_TYPE_MANAGER:
     170                $uri = $this->managerUrl;
     171                break;
     172        }
     173        $uri .= $endpoint;
    152174
    153175        $headers = [
     
    183205
    184206        return new MCResponse($response);
    185     }
    186 
    187     /**
    188      * @return array|mixed|object
    189      * @throws GuzzleException
    190      * @throws MCException
    191      */
    192     //TODO How will this change with the flattening
    193 
    194     public function getCouriers()
    195     {
    196         return $this->makeApiRequest(self::GET, self::COURIER_RESOURCES['listCouriers'])->body;
    197207    }
    198208
     
    399409     * @throws MCException
    400410     */
    401     public function connectShop(string $userAgent, string $remoteAddr, string $orderUrl = ''): MCResponse
    402     {
     411    public function connectShop(
     412        string $userAgent,
     413        string $remoteAddr,
     414        string $orderUrl = '',
     415        string $webhookUrl = ''
     416    ): MCResponse {
    403417        $body = [
    404418            'shopId' => $this->shopId,
    405419            'secretKey' => $this->secretKey,
    406420            'instanceId' => $this->instanceId,
     421            'webhookUrl' => $webhookUrl,
    407422            'orderUrl' => $orderUrl,
    408423            'HTTP_USER_AGENT' => $userAgent,
     
    439454        return $response->code === 200 && $response->body == 'Valid';
    440455    }
     456
     457    /**
     458     * @param string $subscription
     459     * @return bool
     460     * @throws GuzzleException
     461     * @throws MCException
     462     */
     463    public function changeSubscriptionPlan(string $subscription): bool
     464    {
     465        $subscription = strtoupper($subscription);
     466        $endpoint = self::CONFIGURATION_RESOURCES['subscription'];
     467        $body = ['subscription' => $subscription];
     468        $response = $this->makeApiRequest(self::POST, $endpoint, $body, [], self::REQUEST_TYPE_API);
     469
     470        return $response->code === 200 && $response->rawBody == 'Success';
     471    }
     472
     473
     474    /**
     475     * @return bool
     476     * @throws GuzzleException
     477     * @throws MCException
     478     */
     479    public function deactivateSubscriptionPlan(): bool
     480    {
     481        $endpoint = self::CONFIGURATION_RESOURCES['deactivateSubscription'];
     482        $response = $this->makeApiRequest(self::POST, $endpoint, [], [], self::REQUEST_TYPE_API);
     483
     484        return $response->code === 200 && $response->rawBody == 'Success';
     485    }
    441486}
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Attribute/AsTwigFilter.php

    r3318735 r3489939  
    3030{
    3131    /**
    32      * @param non-empty-string $name The name of the filter in Twig.
    33      * @param bool|null $needsCharset Whether the filter needs the charset passed as the first argument.
    34      * @param bool|null $needsEnvironment Whether the filter needs the environment passed as the first argument, or after the charset.
    35      * @param bool|null $needsContext Whether the filter needs the context array passed as the first argument, or after the charset and the environment.
    36      * @param string[]|null $isSafe List of formats in which you want the raw output to be printed unescaped.
    37      * @param string|array|null $isSafeCallback Function called at compilation time to determine if the filter is safe.
    38      * @param string|null $preEscape Some filters may need to work on input that is already escaped or safe
    39      * @param string[]|null $preservesSafety Preserves the safety of the value that the filter is applied to.
    40      * @param DeprecatedCallableInfo|null $deprecationInfo Information about the deprecation
     32     * @param non-empty-string            $name             The name of the filter in Twig
     33     * @param bool|null                   $needsCharset     Whether the filter needs the charset passed as the first argument
     34     * @param bool|null                   $needsEnvironment Whether the filter needs the environment passed as the first argument, or after the charset
     35     * @param bool|null                   $needsContext     Whether the filter needs the context array passed as the first argument, or after the charset and the environment
     36     * @param string[]|null               $isSafe           List of formats in which you want the raw output to be printed unescaped
     37     * @param string|array|null           $isSafeCallback   Function called at compilation time to determine if the filter is safe
     38     * @param string|null                 $preEscape        Some filters may need to work on input that is already escaped or safe
     39     * @param string[]|null               $preservesSafety  Preserves the safety of the value that the filter is applied to
     40     * @param DeprecatedCallableInfo|null $deprecationInfo  Information about the deprecation
    4141     */
    4242    public function __construct(public string $name, public ?bool $needsCharset = null, public ?bool $needsEnvironment = null, public ?bool $needsContext = null, public ?array $isSafe = null, public string|array|null $isSafeCallback = null, public ?string $preEscape = null, public ?array $preservesSafety = null, public ?DeprecatedCallableInfo $deprecationInfo = null)
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Attribute/AsTwigFunction.php

    r3318735 r3489939  
    3030{
    3131    /**
    32      * @param non-empty-string $name The name of the function in Twig.
    33      * @param bool|null $needsCharset Whether the function needs the charset passed as the first argument.
    34      * @param bool|null $needsEnvironment Whether the function needs the environment passed as the first argument, or after the charset.
    35      * @param bool|null $needsContext Whether the function needs the context array passed as the first argument, or after the charset and the environment.
    36      * @param string[]|null $isSafe List of formats in which you want the raw output to be printed unescaped.
    37      * @param string|array|null $isSafeCallback Function called at compilation time to determine if the function is safe.
    38      * @param DeprecatedCallableInfo|null $deprecationInfo Information about the deprecation
     32     * @param non-empty-string            $name             The name of the function in Twig
     33     * @param bool|null                   $needsCharset     Whether the function needs the charset passed as the first argument
     34     * @param bool|null                   $needsEnvironment Whether the function needs the environment passed as the first argument, or after the charset
     35     * @param bool|null                   $needsContext     Whether the function needs the context array passed as the first argument, or after the charset and the environment
     36     * @param string[]|null               $isSafe           List of formats in which you want the raw output to be printed unescaped
     37     * @param string|array|null           $isSafeCallback   Function called at compilation time to determine if the function is safe
     38     * @param DeprecatedCallableInfo|null $deprecationInfo  Information about the deprecation
    3939     */
    4040    public function __construct(public string $name, public ?bool $needsCharset = null, public ?bool $needsEnvironment = null, public ?bool $needsContext = null, public ?array $isSafe = null, public string|array|null $isSafeCallback = null, public ?DeprecatedCallableInfo $deprecationInfo = null)
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Attribute/AsTwigTest.php

    r3318735 r3489939  
    3030{
    3131    /**
    32      * @param non-empty-string $name The name of the test in Twig.
    33      * @param bool|null $needsCharset Whether the test needs the charset passed as the first argument.
    34      * @param bool|null $needsEnvironment Whether the test needs the environment passed as the first argument, or after the charset.
    35      * @param bool|null $needsContext Whether the test needs the context array passed as the first argument, or after the charset and the environment.
    36      * @param DeprecatedCallableInfo|null $deprecationInfo Information about the deprecation
     32     * @param non-empty-string            $name             The name of the test in Twig
     33     * @param bool|null                   $needsCharset     Whether the test needs the charset passed as the first argument
     34     * @param bool|null                   $needsEnvironment Whether the test needs the environment passed as the first argument, or after the charset
     35     * @param bool|null                   $needsContext     Whether the test needs the context array passed as the first argument, or after the charset and the environment
     36     * @param DeprecatedCallableInfo|null $deprecationInfo  Information about the deprecation
    3737     */
    3838    public function __construct(public string $name, public ?bool $needsCharset = null, public ?bool $needsEnvironment = null, public ?bool $needsContext = null, public ?DeprecatedCallableInfo $deprecationInfo = null)
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Environment.php

    r3318735 r3489939  
    4242class Environment
    4343{
    44     public const VERSION = '3.21.1';
    45     public const VERSION_ID = 32101;
     44    public const VERSION = '3.23.0';
     45    public const VERSION_ID = 32300;
    4646    public const MAJOR_VERSION = 3;
    47     public const MINOR_VERSION = 21;
    48     public const RELEASE_VERSION = 1;
     47    public const MINOR_VERSION = 23;
     48    public const RELEASE_VERSION = 0;
    4949    public const EXTRA_VERSION = '';
    5050    private $charset;
     
    731731    }
    732732    /**
     733     * @param callable(string): (TwigTest|false) $callable
     734     */
     735    public function registerUndefinedTestCallback(callable $callable): void
     736    {
     737        $this->extensionSet->registerUndefinedTestCallback($callable);
     738    }
     739    /**
    733740     * @return void
    734741     */
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Error/Error.php

    r3318735 r3489939  
    149149        }
    150150
     151        if (null === $template) {
     152            return; // Impossible to guess the info as the template was not found in the backtrace
     153        }
     154
    151155        $r = new \ReflectionObject($template);
    152156        $file = $r->getFileName();
     
    159163        while ($e = array_pop($exceptions)) {
    160164            $traces = $e->getTrace();
    161             array_unshift($traces, ['file' => $e instanceof Error ? $e->phpFile : $e->getFile(), 'line' => $e instanceof Error ? $e->phpLine : $e->getLine()]);
     165            array_unshift($traces, ['file' => $e instanceof self ? $e->phpFile : $e->getFile(), 'line' => $e instanceof self ? $e->phpLine : $e->getLine()]);
    162166            while ($trace = array_shift($traces)) {
    163167                if (!isset($trace['file']) || !isset($trace['line']) || $file != $trace['file']) {
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser.php

    r3318735 r3489939  
    215215        makecommerceprefix_trigger_deprecation('twig/twig', '3.19', \sprintf('The "%s()" method is deprecated, use "MakeCommercePrefix\Twig\ExpressionParser\Infix\ArgumentsTrait::parseNamedArguments()" instead.', __METHOD__));
    216216
    217         $parsePrimary = new \ReflectionMethod($this->parser, 'parsePrimary');
     217        $parsePrimaryExpression = new \ReflectionMethod($this->parser, 'parsePrimaryExpression');
    218218
    219219        $namedArguments = false;
     
    264264
    265265                if ($definition) {
    266                     $value = $parsePrimary->invoke($this->parser);
     266                    $value = $parsePrimaryExpression->invoke($this->parser);
    267267
    268268                    if (!$this->checkConstantExpression($value)) {
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/Infix/ArgumentsTrait.php

    r3318735 r3489939  
    1414use MakeCommercePrefix\Twig\Error\SyntaxError;
    1515use MakeCommercePrefix\Twig\Node\Expression\ArrayExpression;
     16use MakeCommercePrefix\Twig\Node\Expression\Binary\SetBinary;
    1617use MakeCommercePrefix\Twig\Node\Expression\Unary\SpreadUnary;
    1718use MakeCommercePrefix\Twig\Node\Expression\Variable\ContextVariable;
     
    5960
    6061            $name = null;
    61             if (($token = $stream->nextIf(Token::OPERATOR_TYPE, '=')) || ($token = $stream->nextIf(Token::PUNCTUATION_TYPE, ':'))) {
     62            if ($value instanceof SetBinary) {
     63                $name = $value->getNode('left')->getAttribute('name');
     64                $value = $value->getNode('right');
     65            } elseif (($token = $stream->nextIf(Token::OPERATOR_TYPE, '=')) || ($token = $stream->nextIf(Token::PUNCTUATION_TYPE, ':'))) {
    6266                if (!$value instanceof ContextVariable) {
    6367                    throw new SyntaxError(\sprintf('A parameter name must be a string, "%s" given.', $value::class), $token->getLine(), $stream->getSourceContext());
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/Infix/DotExpressionParser.php

    r3318735 r3489939  
    3838    public function parse(Parser $parser, AbstractExpression $expr, Token $token): AbstractExpression
    3939    {
     40        $nullSafe = '?.' === $token->getValue();
    4041        $stream = $parser->getStream();
    4142        $token = $stream->getCurrent();
     
    5657                $attribute = new ConstantExpression($token->getValue(), $token->getLine());
    5758            } else {
    58                 throw new SyntaxError(\sprintf('Expected name or number, got value "%s" of type %s.', $token->getValue(), $token->toEnglish()), $token->getLine(), $stream->getSourceContext());
     59                throw new SyntaxError(\sprintf('Expected name or number, got value "%s" of type "%s".', $token->getValue(), $token->toEnglish()), $token->getLine(), $stream->getSourceContext());
    5960            }
    6061        }
     
    7576        }
    7677
    77         return new GetAttrExpression($expr, $attribute, $arguments, $type, $lineno);
     78        return new GetAttrExpression($expr, $attribute, $arguments, $type, $lineno, $nullSafe);
    7879    }
    7980
     
    8182    {
    8283        return '.';
     84    }
     85
     86    public function getAliases(): array
     87    {
     88        return ['?.'];
    8389    }
    8490
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/InfixExpressionParserInterface.php

    r3318735 r3489939  
    1212namespace MakeCommercePrefix\Twig\ExpressionParser;
    1313
     14use MakeCommercePrefix\Twig\Error\SyntaxError;
    1415use MakeCommercePrefix\Twig\Node\Expression\AbstractExpression;
    1516use MakeCommercePrefix\Twig\Parser;
     
    1819interface InfixExpressionParserInterface extends ExpressionParserInterface
    1920{
     21    /**
     22     * @throws SyntaxError
     23     */
    2024    public function parse(Parser $parser, AbstractExpression $left, Token $token): AbstractExpression;
    2125
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/Prefix/LiteralExpressionParser.php

    r3318735 r3489939  
    2121use MakeCommercePrefix\Twig\Node\Expression\Binary\ConcatBinary;
    2222use MakeCommercePrefix\Twig\Node\Expression\ConstantExpression;
     23use MakeCommercePrefix\Twig\Node\Expression\EmptyExpression;
    2324use MakeCommercePrefix\Twig\Node\Expression\Variable\ContextVariable;
    2425use MakeCommercePrefix\Twig\Parser;
     
    99100
    100101                    return new ContextVariable($token->getValue(), $token->getLine());
    101                 }
    102 
    103                 if ('=' === $token->getValue() && ('==' === $stream->look(-1)->getValue() || '!=' === $stream->look(-1)->getValue())) {
    104                     throw new SyntaxError(\sprintf('Unexpected operator of value "%s". Did you try to use "===" or "!==" for strict comparison? Use "is same as(value)" instead.', $token->getValue()), $token->getLine(), $stream->getSourceContext());
    105102                }
    106103
     
    175172            $first = false;
    176173
    177             $node->addElement($parser->parseExpression());
     174            // Check for empty slots (comma with no expression)
     175            if ($stream->test(Token::PUNCTUATION_TYPE, ',')) {
     176                $node->addElement(new EmptyExpression($stream->getCurrent()->getLine()));
     177            } else {
     178                $node->addElement($parser->parseExpression());
     179            }
    178180        }
    179181        $stream->expect(Token::PUNCTUATION_TYPE, ']', 'An opened sequence is not properly closed');
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/Prefix/UnaryOperatorExpressionParser.php

    r3318735 r3489939  
    3434        private ?string $description = null,
    3535        private array $aliases = [],
     36        private ?int $operandPrecedence = null,
    3637    ) {
    3738    }
     
    4243    public function parse(Parser $parser, Token $token): AbstractExpression
    4344    {
    44         return new ($this->nodeClass)($parser->parseExpression($this->precedence), $token->getLine());
     45        return new ($this->nodeClass)($parser->parseExpression($this->operandPrecedence ?? $this->precedence), $token->getLine());
    4546    }
    4647
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/PrefixExpressionParserInterface.php

    r3318735 r3489939  
    1212namespace MakeCommercePrefix\Twig\ExpressionParser;
    1313
     14use MakeCommercePrefix\Twig\Error\SyntaxError;
    1415use MakeCommercePrefix\Twig\Node\Expression\AbstractExpression;
    1516use MakeCommercePrefix\Twig\Parser;
     
    1819interface PrefixExpressionParserInterface extends ExpressionParserInterface
    1920{
     21    /**
     22     * @throws SyntaxError
     23     */
    2024    public function parse(Parser $parser, Token $token): AbstractExpression;
    2125}
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Extension/AttributeExtension.php

    r3318735 r3489939  
    105105
    106106                if ($callable->getMinimalNumberOfRequiredArguments() > $method->getNumberOfParameters()) {
    107                     throw new \LogicException(sprintf('"%s::%s()" needs at least %d arguments to be used AsTwigFilter, but only %d defined.', $reflectionClass->getName(), $method->getName(), $callable->getMinimalNumberOfRequiredArguments(), $method->getNumberOfParameters()));
     107                    throw new \LogicException(\sprintf('"%s::%s()" needs at least %d arguments to be used AsTwigFilter, but only %d defined.', $reflectionClass->getName(), $method->getName(), $callable->getMinimalNumberOfRequiredArguments(), $method->getNumberOfParameters()));
    108108                }
    109109
     
    126126
    127127                if ($callable->getMinimalNumberOfRequiredArguments() > $method->getNumberOfParameters()) {
    128                     throw new \LogicException(sprintf('"%s::%s()" needs at least %d arguments to be used AsTwigFunction, but only %d defined.', $reflectionClass->getName(), $method->getName(), $callable->getMinimalNumberOfRequiredArguments(), $method->getNumberOfParameters()));
     128                    throw new \LogicException(\sprintf('"%s::%s()" needs at least %d arguments to be used AsTwigFunction, but only %d defined.', $reflectionClass->getName(), $method->getName(), $callable->getMinimalNumberOfRequiredArguments(), $method->getNumberOfParameters()));
    129129                }
    130130
     
    133133
    134134            foreach ($method->getAttributes(AsTwigTest::class) as $reflectionAttribute) {
    135 
    136135                /** @var AsTwigTest $attribute */
    137136                $attribute = $reflectionAttribute->newInstance();
     
    146145
    147146                if ($callable->getMinimalNumberOfRequiredArguments() > $method->getNumberOfParameters()) {
    148                     throw new \LogicException(sprintf('"%s::%s()" needs at least %d arguments to be used AsTwigTest, but only %d defined.', $reflectionClass->getName(), $method->getName(), $callable->getMinimalNumberOfRequiredArguments(), $method->getNumberOfParameters()));
     147                    throw new \LogicException(\sprintf('"%s::%s()" needs at least %d arguments to be used AsTwigTest, but only %d defined.', $reflectionClass->getName(), $method->getName(), $callable->getMinimalNumberOfRequiredArguments(), $method->getNumberOfParameters()));
    149148                }
    150149
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Extension/CoreExtension.php

    r3318735 r3489939  
    1818use MakeCommercePrefix\Twig\Error\SyntaxError;
    1919use MakeCommercePrefix\Twig\ExpressionParser\Infix\ArrowExpressionParser;
     20use MakeCommercePrefix\Twig\ExpressionParser\Infix\AssignmentExpressionParser;
    2021use MakeCommercePrefix\Twig\ExpressionParser\Infix\BinaryOperatorExpressionParser;
    2122use MakeCommercePrefix\Twig\ExpressionParser\Infix\ConditionalTernaryExpressionParser;
     
    5657use MakeCommercePrefix\Twig\Node\Expression\Binary\NotEqualBinary;
    5758use MakeCommercePrefix\Twig\Node\Expression\Binary\NotInBinary;
     59use MakeCommercePrefix\Twig\Node\Expression\Binary\NotSameAsBinary;
    5860use MakeCommercePrefix\Twig\Node\Expression\Binary\NullCoalesceBinary;
    5961use MakeCommercePrefix\Twig\Node\Expression\Binary\OrBinary;
    6062use MakeCommercePrefix\Twig\Node\Expression\Binary\PowerBinary;
    6163use MakeCommercePrefix\Twig\Node\Expression\Binary\RangeBinary;
     64use MakeCommercePrefix\Twig\Node\Expression\Binary\SameAsBinary;
    6265use MakeCommercePrefix\Twig\Node\Expression\Binary\SpaceshipBinary;
    6366use MakeCommercePrefix\Twig\Node\Expression\Binary\StartsWithBinary;
     
    334337            // unary operators
    335338            new UnaryOperatorExpressionParser(NotUnary::class, 'not', 50, new PrecedenceChange('twig/twig', '3.15', 70)),
    336             new UnaryOperatorExpressionParser(SpreadUnary::class, '...', 512, description: 'Spread operator'),
     339            new UnaryOperatorExpressionParser(SpreadUnary::class, '...', 512, description: 'Spread operator', operandPrecedence: 0),
    337340            new UnaryOperatorExpressionParser(NegUnary::class, '-', 500),
    338341            new UnaryOperatorExpressionParser(PosUnary::class, '+', 500),
     
    361364            new BinaryOperatorExpressionParser(HasSomeBinary::class, 'has some', 20),
    362365            new BinaryOperatorExpressionParser(HasEveryBinary::class, 'has every', 20),
     366            new BinaryOperatorExpressionParser(SameAsBinary::class, '===', 20),
     367            new BinaryOperatorExpressionParser(NotSameAsBinary::class, '!==', 20),
    363368            new BinaryOperatorExpressionParser(RangeBinary::class, '..', 25),
    364369            new BinaryOperatorExpressionParser(AddBinary::class, '+', 30),
     
    374379            new ConditionalTernaryExpressionParser(),
    375380
     381            // assignment operator
     382            new AssignmentExpressionParser('='),
     383
    376384            // Twig callables
    377385            new IsExpressionParser(),
     
    418426                makecommerceprefix_trigger_deprecation('twig/twig', '3.12', 'Passing a non-countable sequence of values to "%s()" is deprecated.', __METHOD__);
    419427
    420                 return $values;
    421             }
    422 
    423             $values = self::toArray($values, false);
     428                $values = self::toArray($values, false);
     429            }
    424430        }
    425431
     
    16951701
    16961702            if (match (true) {
    1697                 \is_array($object) => \array_key_exists($arrayItem, $object),
     1703                \is_array($object) => \array_key_exists($arrayItem = (string) $arrayItem, $object),
    16981704                $object instanceof \ArrayAccess => $object->offsetExists($arrayItem),
    16991705                default => false,
     
    17161722
    17171723                if ($object instanceof \ArrayAccess) {
    1718                     $message = \sprintf('Key "%s" in object with ArrayAccess of class "%s" does not exist.', $arrayItem, $object::class);
     1724                    if (\is_object($arrayItem) || \is_array($arrayItem)) {
     1725                        $message = \sprintf('Key of type "%s" does not exist in ArrayAccess-able object of class "%s".', get_debug_type($arrayItem), get_debug_type($object));
     1726                    } else {
     1727                        $message = \sprintf('Key "%s" does not exist in ArrayAccess-able object of class "%s".', $arrayItem, get_debug_type($object));
     1728                    }
    17191729                } elseif (\is_object($object)) {
    1720                     $message = \sprintf('Impossible to access a key "%s" on an object of class "%s" that does not implement ArrayAccess interface.', $item, $object::class);
     1730                    $message = \sprintf('Impossible to access a key "%s" on an object of class "%s" that does not implement ArrayAccess interface.', $item, get_debug_type($object));
    17211731                } elseif (\is_array($object)) {
    17221732                    if (!$object) {
     
    18811891            }
    18821892
    1883             throw new RuntimeError(\sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()"/"has%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), $lineno, $source);
     1893            throw new RuntimeError(\sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()", "is%1$s()", "has%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), $lineno, $source);
    18841894        }
    18851895
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Extension/ExtensionInterface.php

    r3318735 r3489939  
    1111namespace MakeCommercePrefix\Twig\Extension;
    1212
     13use MakeCommercePrefix\Twig\ExpressionParser;
    1314use MakeCommercePrefix\Twig\ExpressionParser\ExpressionParserInterface;
    1415use MakeCommercePrefix\Twig\ExpressionParser\PrecedenceChange;
     16use MakeCommercePrefix\Twig\Node\Expression\Binary\AbstractBinary;
     17use MakeCommercePrefix\Twig\Node\Expression\Unary\AbstractUnary;
    1518use MakeCommercePrefix\Twig\NodeVisitor\NodeVisitorInterface;
    1619use MakeCommercePrefix\Twig\TokenParser\TokenParserInterface;
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/ExtensionSet.php

    r3318735 r3489939  
    2626use MakeCommercePrefix\Twig\NodeVisitor\NodeVisitorInterface;
    2727use MakeCommercePrefix\Twig\TokenParser\TokenParserInterface;
     28// Help opcache.preload discover always-needed symbols
     29// @see https://github.com/php/php-src/issues/10131
     30class_exists(BinaryOperatorExpressionParser::class);
    2831/**
    2932 * @author Fabien Potencier <fabien@symfony.com>
     
    5861    /** @var array<callable(string): (TwigFilter|false)> */
    5962    private $filterCallbacks = [];
     63    /** @var array<callable(string): (TwigTest|false)> */
     64    private $testCallbacks = [];
    6065    /** @var array<callable(string): (TokenParserInterface|false)> */
    6166    private $parserCallbacks = [];
     
    342347            }
    343348        }
     349        foreach ($this->testCallbacks as $callback) {
     350            if (false !== $test = $callback($name)) {
     351                return $test;
     352            }
     353        }
    344354        return null;
     355    }
     356    /**
     357     * @param callable(string): (TwigTest|false) $callable
     358     */
     359    public function registerUndefinedTestCallback(callable $callable): void
     360    {
     361        $this->testCallbacks[] = $callable;
    345362    }
    346363    public function getExpressionParsers(): ExpressionParsers
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Lexer.php

    r3318735 r3489939  
    526526    private function getOperatorRegex(): string
    527527    {
    528         $expressionParsers = ['='];
     528        $expressionParsers = [];
    529529        foreach ($this->env->getExpressionParsers() as $expressionParser) {
    530530            $expressionParsers = array_merge($expressionParsers, [$expressionParser->getName()], $expressionParser->getAliases());
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Node/EmbedNode.php

    r3318735 r3489939  
    4242            ->repr($this->getTemplateLine())
    4343            ->raw(', ')
    44             ->string($this->getAttribute('index'))
     44            ->repr($this->getAttribute('index'))
    4545            ->raw(')')
    4646        ;
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/ArrayExpression.php

    r3318735 r3489939  
    1313
    1414use MakeCommercePrefix\Twig\Compiler;
     15use MakeCommercePrefix\Twig\Error\SyntaxError;
    1516use MakeCommercePrefix\Twig\Node\Expression\Unary\SpreadUnary;
    1617use MakeCommercePrefix\Twig\Node\Expression\Unary\StringCastUnary;
     
    6162    }
    6263
     64    /**
     65     * Checks if the array is a sequence (keys are sequential integers starting from 0).
     66     *
     67     * @internal
     68     */
     69    public function isSequence(): bool
     70    {
     71        foreach ($this->getKeyValuePairs() as $i => $pair) {
     72            $key = $pair['key'];
     73            if ($key instanceof TempNameExpression) {
     74                $keyValue = $key->getAttribute('name');
     75            } elseif ($key instanceof ConstantExpression) {
     76                $keyValue = $key->getAttribute('value');
     77            } else {
     78                return false;
     79            }
     80
     81            if ($keyValue !== $i) {
     82                return false;
     83            }
     84        }
     85
     86        return true;
     87    }
     88
    6389    public function addElement(AbstractExpression $value, ?AbstractExpression $key = null): void
    6490    {
     
    76102
    77103            return;
     104        }
     105
     106        // Check for empty expressions which are only allowed in destructuring
     107        foreach ($this->getKeyValuePairs() as $pair) {
     108            if ($pair['value'] instanceof EmptyExpression) {
     109                throw new SyntaxError('Empty array elements are only allowed in destructuring assignments.', $pair['value']->getTemplateLine(), $this->getSourceContext());
     110            }
    78111        }
    79112
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/Binary/MatchesBinary.php

    r3318735 r3489939  
    1414use MakeCommercePrefix\Twig\Compiler;
    1515use MakeCommercePrefix\Twig\Error\SyntaxError;
     16use MakeCommercePrefix\Twig\Node\Expression\ConstantExpression;
    1617use MakeCommercePrefix\Twig\Node\Expression\ReturnBoolInterface;
    17 use MakeCommercePrefix\Twig\Node\Expression\ConstantExpression;
    1818use MakeCommercePrefix\Twig\Node\Node;
    1919
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/FunctionNode/EnumCasesFunction.php

    r3318735 r3489939  
    11<?php
     2
     3/*
     4 * This file is part of Twig.
     5 *
     6 * (c) Fabien Potencier
     7 *
     8 * For the full copyright and license information, please view the LICENSE
     9 * file that was distributed with this source code.
     10 */
    211
    312namespace MakeCommercePrefix\Twig\Node\Expression\FunctionNode;
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/FunctionNode/EnumFunction.php

    r3318735 r3489939  
    11<?php
     2
     3/*
     4 * This file is part of Twig.
     5 *
     6 * (c) Fabien Potencier
     7 *
     8 * For the full copyright and license information, please view the LICENSE
     9 * file that was distributed with this source code.
     10 */
    211
    312namespace MakeCommercePrefix\Twig\Node\Expression\FunctionNode;
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/GetAttrExpression.php

    r3318735 r3489939  
    2626     * @param ArrayExpression|NameExpression|null $arguments
    2727     */
    28     public function __construct(AbstractExpression $node, AbstractExpression $attribute, ?AbstractExpression $arguments, string $type, int $lineno)
     28    public function __construct(AbstractExpression $node, AbstractExpression $attribute, ?AbstractExpression $arguments, string $type, int $lineno, bool $nullSafe = false)
    2929    {
    3030        $nodes = ['node' => $node, 'attribute' => $attribute];
     
    3737        }
    3838
    39         parent::__construct($nodes, ['type' => $type, 'ignore_strict_check' => false, 'optimizable' => true], $lineno);
     39        parent::__construct($nodes, ['type' => $type, 'ignore_strict_check' => false, 'optimizable' => !$nullSafe, 'null_safe' => $nullSafe], $lineno);
    4040    }
    4141
     
    5050        $env = $compiler->getEnvironment();
    5151        $arrayAccessSandbox = false;
     52        $nullSafe = $this->getAttribute('null_safe');
     53        $objectVar = null;
    5254
    5355        // optimize array calls
     
    9496        }
    9597
    96         $compiler->raw('CoreExtension::getAttribute($this->env, $this->source, ');
    97 
    9898        if ($this->getAttribute('ignore_strict_check')) {
    9999            $this->getNode('node')->setAttribute('ignore_strict_check', true);
    100100        }
    101101
     102        if ($nullSafe) {
     103            $objectVar = '$'.$compiler->getVarName();
     104            $compiler
     105                ->raw('((null === ('.$objectVar.' = ')
     106                ->subcompile($this->getNode('node'))
     107                ->raw(')) ? null : ');
     108        }
     109
     110        $compiler->raw('CoreExtension::getAttribute($this->env, $this->source, ');
     111
     112        if ($nullSafe) {
     113            $compiler->raw($objectVar);
     114        } else {
     115            $compiler->subcompile($this->getNode('node'));
     116        }
     117
    102118        $compiler
    103             ->subcompile($this->getNode('node'))
    104119            ->raw(', ')
    105120            ->subcompile($this->getNode('attribute'))
     
    124139            $compiler->raw(')');
    125140        }
     141
     142        if ($nullSafe) {
     143            $compiler->raw(')');
     144        }
    126145    }
    127146
    128     private function changeIgnoreStrictCheck(GetAttrExpression $node): void
     147    private function changeIgnoreStrictCheck(self $node): void
    129148    {
    130149        $node->setAttribute('optimizable', false);
    131150        $node->setAttribute('ignore_strict_check', true);
    132151
    133         if ($node->getNode('node') instanceof GetAttrExpression) {
     152        if ($node->getNode('node') instanceof self) {
    134153            $this->changeIgnoreStrictCheck($node->getNode('node'));
    135154        }
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/Test/DefinedTest.php

    r3318735 r3489939  
    1616use MakeCommercePrefix\Twig\Error\SyntaxError;
    1717use MakeCommercePrefix\Twig\Node\Expression\AbstractExpression;
    18 use MakeCommercePrefix\Twig\Node\Expression\ArrayExpression;
    19 use MakeCommercePrefix\Twig\Node\Expression\BlockReferenceExpression;
    20 use MakeCommercePrefix\Twig\Node\Expression\ConstantExpression;
    21 use MakeCommercePrefix\Twig\Node\Expression\FunctionExpression;
    22 use MakeCommercePrefix\Twig\Node\Expression\GetAttrExpression;
    23 use MakeCommercePrefix\Twig\Node\Expression\MacroReferenceExpression;
    24 use MakeCommercePrefix\Twig\Node\Expression\MethodCallExpression;
    2518use MakeCommercePrefix\Twig\Node\Expression\SupportDefinedTestInterface;
    2619use MakeCommercePrefix\Twig\Node\Expression\TestExpression;
    27 use MakeCommercePrefix\Twig\Node\Expression\Variable\ContextVariable;
    2820use MakeCommercePrefix\Twig\Node\Node;
    2921use MakeCommercePrefix\Twig\TwigTest;
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Node/TypesNode.php

    r3318735 r3489939  
    11<?php
     2
     3/*
     4 * This file is part of Twig.
     5 *
     6 * (c) Fabien Potencier
     7 *
     8 * For the full copyright and license information, please view the LICENSE
     9 * file that was distributed with this source code.
     10 */
    211
    312namespace MakeCommercePrefix\Twig\Node;
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Parser.php

    r3318735 r3489939  
    7777    }
    7878
     79    /**
     80     * @throws SyntaxError
     81     */
    7982    public function parse(TokenStream $stream, $test = null, bool $dropNeedle = false): ModuleNode
    8083    {
     
    159162    }
    160163
     164    /**
     165     * @throws SyntaxError
     166     */
    161167    public function subparse($test, bool $dropNeedle = false): Node
    162168    {
     
    495501            $name = $name.' '.$this->getCurrentToken()->getValue();
    496502
    497             if ($test = $this->env->getTest($name)) {
    498                 $this->stream->next();
    499             }
     503            try {
     504                $test = $this->env->getTest($name);
     505            } catch (SyntaxError $e) {
     506                if (!$this->shouldIgnoreUnknownTwigCallables()) {
     507                    throw $e;
     508                }
     509
     510                $test = null;
     511            }
     512            $this->stream->next();
    500513        } else {
    501             $test = $this->env->getTest($name);
     514            try {
     515                $test = $this->env->getTest($name);
     516            } catch (SyntaxError $e) {
     517                if (!$this->shouldIgnoreUnknownTwigCallables()) {
     518                    throw $e;
     519                }
     520
     521                $test = null;
     522            }
    502523        }
    503524
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Resources/debug.php

    r3318735 r3489939  
    22
    33/*
    4  * This file is part of the Symfony package.
     4 * This file is part of Twig.
    55 *
    6  * (c) Fabien Potencier <fabien@symfony.com>
     6 * (c) Fabien Potencier
    77 *
    88 * For the full copyright and license information, please view the LICENSE
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Resources/string_loader.php

    r3318735 r3489939  
    22
    33/*
    4  * This file is part of the Symfony package.
     4 * This file is part of Twig.
    55 *
    6  * (c) Fabien Potencier <fabien@symfony.com>
     6 * (c) Fabien Potencier
    77 *
    88 * For the full copyright and license information, please view the LICENSE
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Runtime/EscaperRuntime.php

    r3318735 r3489939  
    1818final class EscaperRuntime implements RuntimeExtensionInterface
    1919{
    20     /** @var array<string, callable(string $string, string $charset): string> */
     20    /** @var array<string, callable(string, string): string> */
    2121    private $escapers = [];
    2222
     
    140140            case 'html':
    141141                // see https://www.php.net/htmlspecialchars
     142
     143                if ('UTF-8' === $charset) {
     144                    return htmlspecialchars($string, \ENT_QUOTES | \ENT_SUBSTITUTE, 'UTF-8');
     145                }
    142146
    143147                // Using a static variable to avoid initializing the array
     
    196200                    * \" is also supported but omitted, because the resulting string is not HTML safe.
    197201                    */
    198                     static $shortMap = [
     202                    $short = match ($char) {
    199203                        '\\' => '\\\\',
    200204                        '/' => '\\/',
     
    204208                        "\x0D" => '\r',
    205209                        "\x09" => '\t',
    206                     ];
    207 
    208                     if (isset($shortMap[$char])) {
    209                         return $shortMap[$char];
     210                        default => false,
     211                    };
     212
     213                    if ($short) {
     214                        return $short;
    210215                    }
    211216
     
    268273                     */
    269274                    $chr = $matches[0];
    270                     $ord = \ord($chr);
     275                    $ord = \ord($chr[0]);
    271276
    272277                    /*
     
    289294                        *     XML Parsing Error: undefined entity
    290295                        */
    291                         static $entityMap = [
     296                        return match ($ord) {
    292297                            34 => '&quot;', /* quotation mark */
    293298                            38 => '&amp;',  /* ampersand */
    294299                            60 => '&lt;',   /* less-than sign */
    295300                            62 => '&gt;',   /* greater-than sign */
    296                         ];
    297 
    298                         if (isset($entityMap[$ord])) {
    299                             return $entityMap[$ord];
    300                         }
    301 
    302                         return \sprintf('&#x%02X;', $ord);
     301                            default => \sprintf('&#x%02X;', $ord),
     302                        };
    303303                    }
    304304
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Template.php

    r3318735 r3489939  
    271271     * @param string|TemplateWrapper|array<string|TemplateWrapper> $template
    272272     */
    273     protected function load(string|TemplateWrapper|array $template, int $line, int|null $index = null): self
     273    protected function load(string|TemplateWrapper|array $template, int $line, ?int $index = null): self
    274274    {
    275275        try {
     
    316316     * @deprecated since Twig 3.21 and will be removed in 4.0. Use Template::load() instead.
    317317     */
    318     protected function loadTemplate($template, $templateName = null, int|null $line = null, int|null $index = null): self|TemplateWrapper
     318    protected function loadTemplate($template, $templateName = null, ?int $line = null, ?int $index = null): self|TemplateWrapper
    319319    {
    320320        makecommerceprefix_trigger_deprecation('twig/twig', '3.21', 'The "%s" method is deprecated.', __METHOD__);
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Test/IntegrationTestCase.php

    r3318735 r3489939  
    9292    }
    9393    /**
     94     * @return array<callable(string): (TwigTest|false)>
     95     */
     96    protected function getUndefinedTestCallbacks(): array
     97    {
     98        return [];
     99    }
     100    /**
    94101     * @return array<callable(string): (TokenParserInterface|false)>
    95102     */
     
    219226            foreach ($this->getUndefinedFunctionCallbacks() as $callback) {
    220227                $twig->registerUndefinedFunctionCallback($callback);
     228            }
     229            foreach ($this->getUndefinedTestCallbacks() as $callback) {
     230                $twig->registerUndefinedTestCallback($callback);
    221231            }
    222232            foreach ($this->getUndefinedTokenParserCallbacks() as $callback) {
  • makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/TokenParser/GuardTokenParser.php

    r3318735 r3489939  
    3333
    3434        $nameToken = $stream->expect(Token::NAME_TYPE);
     35        $name = $nameToken->getValue();
     36        if ('test' === $typeToken->getValue() && $stream->test(Token::NAME_TYPE)) {
     37            // try 2-words tests
     38            $name .= ' '.$stream->getCurrent()->getValue();
     39            $stream->next();
     40        }
    3541
    3642        try {
    37             $exists = null !== $this->parser->getEnvironment()->$method($nameToken->getValue());
     43            $exists = null !== $this->parser->getEnvironment()->$method($name);
    3844        } catch (SyntaxError) {
    3945            $exists = false;
  • makecommerce/trunk/payment/gateway/woocommerce/woocommerce.php

    r3447693 r3489939  
    1212
    1313    public $id = MAKECOMMERCE_PLUGIN_ID;
    14     public $version = '4.0.6';
     14    public $version = '4.0.7';
    1515   
    1616    public $payment_return_url;
  • makecommerce/trunk/payment/payment.php

    r3208955 r3489939  
    288288        }
    289289
     290        // Lock processing for this order+status to avoid race conditions between callback and redirect
     291        $lock_key = '_makecommerce_payment_lock_status_' . $paymentStatus;
     292        $locked   = add_post_meta( $orderId, $lock_key, time(), true );
     293        if ( ! $locked ) {
     294            return $returnUrl;
     295        }
     296
    290297        //check if we already processed this status in the past.
    291298        if ( $check_status && $order->get_meta( '_makecommerce_payment_processed_status', true ) == $paymentStatus ) {
Note: See TracChangeset for help on using the changeset viewer.