Code Duplication    Length = 26-26 lines in 3 locations

src/Callbacks/BooleanCallback.php 1 location

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

src/Callbacks/MultiselectCallback.php 1 location

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

src/Callbacks/SelectCallback.php 1 location

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