Code Duplication    Length = 29-29 lines in 3 locations

src/Callbacks/AbstractBooleanCallback.php 1 location

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

src/Callbacks/AbstractMultiselectCallback.php 1 location

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

src/Callbacks/AbstractSelectCallback.php 1 location

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