Code Duplication    Length = 13-14 lines in 4 locations

core/db_classes/EE_Payment.class.php 1 location

@@ 107-119 (lines=13) @@
104
     * @throws InvalidDataTypeException
105
     * @throws EE_Error
106
     */
107
    protected function __construct(
108
        array $fieldValues = array(),
109
        $bydb = false,
110
        $timezone = '',
111
        array $date_formats = array(),
112
        MoneyFactory $money_factory = null
113
    ) {
114
        if (! $money_factory instanceof MoneyFactory) {
115
            $money_factory = LoaderFactory::getLoader()->getShared('EventEspresso\core\services\currency\MoneyFactory');
116
        }
117
        $this->money_factory = $money_factory;
118
        parent::__construct($fieldValues, $bydb, $timezone, $date_formats);
119
    }
120
121
122
    /**

core/db_classes/EE_Price.class.php 1 location

@@ 107-119 (lines=13) @@
104
     * @throws InvalidDataTypeException
105
     * @throws EE_Error
106
     */
107
    protected function __construct(
108
        array $fieldValues = array(),
109
        $bydb = false,
110
        $timezone = '',
111
        array $date_formats = array(),
112
        MoneyFactory $money_factory = null
113
    ) {
114
        if (! $money_factory instanceof MoneyFactory) {
115
            $money_factory = LoaderFactory::getLoader()->getShared('EventEspresso\core\services\currency\MoneyFactory');
116
        }
117
        $this->money_factory = $money_factory;
118
        parent::__construct($fieldValues, $bydb, $timezone, $date_formats);
119
    }
120
121
122
    /**

core/db_classes/EE_Ticket.class.php 1 location

@@ 156-168 (lines=13) @@
153
     * @throws InvalidDataTypeException
154
     * @throws EE_Error
155
     */
156
    protected function __construct(
157
        array $fieldValues = array(),
158
        $bydb = false,
159
        $timezone = '',
160
        array $date_formats = array(),
161
        MoneyFactory $money_factory = null
162
    ) {
163
        if (! $money_factory instanceof MoneyFactory) {
164
            $money_factory = LoaderFactory::getLoader()->getShared('EventEspresso\core\services\currency\MoneyFactory');
165
        }
166
        $this->money_factory = $money_factory;
167
        parent::__construct($fieldValues, $bydb, $timezone, $date_formats);
168
    }
169
170
171
    /**

core/db_models/fields/EE_Money_Field.php 1 location

@@ 36-49 (lines=14) @@
33
     * @throws InvalidInterfaceException
34
     * @throws InvalidDataTypeException
35
     */
36
    public function __construct(
37
        $table_column,
38
        $nicename,
39
        $nullable,
40
        $default_value = null,
41
        MoneyFactory $factory = null
42
    ) {
43
        if (! $factory instanceof MoneyFactory) {
44
            $factory = LoaderFactory::getLoader()->getShared('EventEspresso\core\services\currency\MoneyFactory');
45
        }
46
        $this->money_factory = $factory;
47
        parent::__construct($table_column, $nicename, $nullable, $default_value);
48
        $this->setSchemaType('object');
49
    }
50
51
52
    /**