File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder
lib/internal/Magento/Framework Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ public function getSort(RequestInterface $request)
92
92
if (in_array ($ item ['field ' ], $ this ->skippedFields )) {
93
93
continue ;
94
94
}
95
- $ attribute = $ this ->attributeAdapterProvider ->getByAttributeCode ($ item ['field ' ]);
95
+ $ attribute = $ this ->attributeAdapterProvider ->getByAttributeCode (( string ) $ item ['field ' ]);
96
96
$ fieldName = $ this ->fieldNameResolver ->getFieldName ($ attribute );
97
97
if (isset ($ this ->map [$ fieldName ])) {
98
98
$ fieldName = $ this ->map [$ fieldName ];
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ public function unsetData($key = null)
120
120
* @param string $key
121
121
* @param string|int $index
122
122
* @return mixed
123
+ * @SuppressWarnings(PHPMD.CyclomaticComplexity)
123
124
*/
124
125
public function getData ($ key = '' , $ index = null )
125
126
{
@@ -128,7 +129,7 @@ public function getData($key = '', $index = null)
128
129
}
129
130
130
131
/* process a/b/c key as ['a']['b']['c'] */
131
- if (strpos (( string ) $ key , '/ ' ) !== false ) {
132
+ if ($ key !== null && strpos ($ key , '/ ' ) !== false ) {
132
133
$ data = $ this ->getDataByPath ($ key );
133
134
} else {
134
135
$ data = $ this ->_getData ($ key );
You can’t perform that action at this time.
0 commit comments