• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

aimeos / aimeos-core / 42f61f54-cf59-4da5-a9dc-545fad6bcaa4

18 May 2024 11:39AM UTC coverage: 91.648% (+0.002%) from 91.646%
42f61f54-cf59-4da5-a9dc-545fad6bcaa4

push

circleci

aimeos
Allows different customer address types

15 of 15 new or added lines in 3 files covered. (100.0%)

2 existing lines in 1 file now uncovered.

11105 of 12117 relevant lines covered (91.65%)

52.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/MShop/Order/Item/Address/Base.php
1
<?php
2

3
/**
4
 * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
 * @copyright Metaways Infosystems GmbH, 2011
6
 * @copyright Aimeos (aimeos.org), 2015-2024
7
 * @package MShop
8
 * @subpackage Order
9
 */
10

11

12
namespace Aimeos\MShop\Order\Item\Address;
13

14

15
/**
16
 * Abstract class with constants for all order address items.
17
 *
18
 * @package MShop
19
 * @subpackage Order
20
 */
21
abstract class Base extends \Aimeos\MShop\Common\Item\Address\Base
22
{
23
        /**
24
         * Delivery address.
25
         */
26
        const TYPE_DELIVERY = 'delivery';
27

28
        /**
29
         * Billing address.
30
         */
31
        const TYPE_PAYMENT = 'payment';
32

33

34
        /**
35
         * Checks if the given address type is valid
36
         *
37
         * @param string $value Address type defined in \Aimeos\MShop\Order\Item\Address\Base
38
         * @return string Sanitized address type
39
         * @throws \Aimeos\MShop\Order\Exception If type is invalid
40
         * @deprecated 2025.01
41
         */
42
        protected function checkType( string $value ) : string
43
        {
44
                switch( $value )
45
                {
46
                        case \Aimeos\MShop\Order\Item\Address\Base::TYPE_DELIVERY:
47
                        case \Aimeos\MShop\Order\Item\Address\Base::TYPE_PAYMENT:
UNCOV
48
                                return (string) $value;
×
49
                }
50

UNCOV
51
                throw new \Aimeos\MShop\Order\Exception( sprintf( 'Address type "%1$s" not within allowed range', $value ) );
×
52
        }
53
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc