Code Duplication    Length = 29-29 lines in 3 locations

src/Callbacks/AbstractMultiselectCallback.php 1 location

@@ 75-103 (lines=29) @@
72
            }
73
74
            // query whether or not we're in debug mode
75
            if ($this->isDebugMode()) {
76
                // log a warning and continue with the next value
77
                $this->getSystemLogger()->warning(
78
                    $this->appendExceptionSuffix(
79
                        sprintf(
80
                            'Can\'t find multiselect option value "%s" for attribute "%s"',
81
                            $val,
82
                            $attributeCode
83
                        )
84
                    )
85
                );
86
87
                // add the missing option value to the registry
88
                $this->mergeAttributesRecursive(
89
                    array(
90
                        RegistryKeys::MISSING_OPTION_VALUES => array(
91
                            $attributeCode => array(
92
                                $val => array(
93
                                    $this->raiseCounter($val),
94
                                    array($this->getUniqueIdentifier() => true)
95
                                )
96
                            )
97
                        )
98
                    )
99
                );
100
101
                // continue with the next option value
102
                continue;
103
            }
104
105
            // throw an exception if the attribute is not available
106
            throw new \Exception(

src/Callbacks/AbstractSelectCallback.php 1 location

@@ 66-94 (lines=29) @@
63
        }
64
65
        // query whether or not we're in debug mode
66
        if ($this->isDebugMode()) {
67
            // log a warning and return immediately
68
            $this->getSystemLogger()->warning(
69
                $this->appendExceptionSuffix(
70
                    sprintf(
71
                        'Can\'t find select option value "%s" for attribute "%s"',
72
                        $attributeValue,
73
                        $attributeCode
74
                    )
75
                )
76
            );
77
78
            // add the missing option value to the registry
79
            $this->mergeAttributesRecursive(
80
                array(
81
                    RegistryKeys::MISSING_OPTION_VALUES => array(
82
                        $attributeCode => array(
83
                            $attributeValue => array(
84
                                $this->raiseCounter($attributeValue),
85
                                array($this->getUniqueIdentifier() => true)
86
                            )
87
                        )
88
                    )
89
                )
90
            );
91
92
            // return NULL, if the value can't be mapped to an option
93
            return;
94
        }
95
96
        // throw an exception if the attribute is NOT
97
        // available and we're not in debug mode

src/Callbacks/AbstractBooleanCallback.php 1 location

@@ 80-108 (lines=29) @@
77
        }
78
79
        // query whether or not we're in debug mode
80
        if ($this->isDebugMode()) {
81
            // log a warning and continue with the next value
82
            $this->getSystemLogger()->warning(
83
                $this->appendExceptionSuffix(
84
                    sprintf(
85
                        'Can\'t map option value "%s" for attribute %s to a boolean representation',
86
                        $attributeValue,
87
                        $attributeCode
88
                    )
89
                )
90
            );
91
92
            // add the missing option value to the registry
93
            $this->mergeAttributesRecursive(
94
                array(
95
                    RegistryKeys::MISSING_OPTION_VALUES => array(
96
                        $attributeCode => array(
97
                            $attributeValue => array(
98
                                $this->raiseCounter($attributeValue),
99
                                array($this->getUniqueIdentifier() => true)
100
                            )
101
                        )
102
                    )
103
                )
104
            );
105
106
            // return NULL, if NO value can be mapped to a boolean representation
107
            return;
108
        }
109
110
        // throw an exception if the attribute is not available
111
        throw new \Exception(