ver. 0.294: Code review complete — 96/96 classes, 27 fixes across all layers
Full codebase review of autoload/ directory (96 classes, ~1144 methods). Fixes: null safety (query/find guards), redundant DI bypass, undefined variables, missing globals, and Imagick WebP mime type bug in Helpers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -271,25 +271,27 @@ class LayoutsRepository
|
||||
$cacheHandler->delete($cacheKey);
|
||||
}
|
||||
|
||||
$layoutRows = $this->db->query(
|
||||
$stmt = $this->db->query(
|
||||
"SELECT pp_layouts.*
|
||||
FROM pp_layouts
|
||||
JOIN pp_shop_products ON pp_layouts.id = pp_shop_products.layout_id
|
||||
WHERE pp_shop_products.id = " . (int)$productId . "
|
||||
ORDER BY pp_layouts.id DESC"
|
||||
)->fetchAll(\PDO::FETCH_ASSOC);
|
||||
);
|
||||
$layoutRows = $stmt ? $stmt->fetchAll(\PDO::FETCH_ASSOC) : [];
|
||||
|
||||
if (is_array($layoutRows) && isset($layoutRows[0])) {
|
||||
$layout = $layoutRows[0];
|
||||
} else {
|
||||
$layoutRows = $this->db->query(
|
||||
$stmt2 = $this->db->query(
|
||||
"SELECT pp_layouts.*
|
||||
FROM pp_layouts
|
||||
JOIN pp_layouts_categories ON pp_layouts.id = pp_layouts_categories.layout_id
|
||||
JOIN pp_shop_products_categories ON pp_shop_products_categories.category_id = pp_layouts_categories.category_id
|
||||
WHERE pp_shop_products_categories.product_id = " . (int)$productId . "
|
||||
ORDER BY pp_shop_products_categories.o ASC, pp_layouts.id DESC"
|
||||
)->fetchAll(\PDO::FETCH_ASSOC);
|
||||
);
|
||||
$layoutRows = $stmt2 ? $stmt2->fetchAll(\PDO::FETCH_ASSOC) : [];
|
||||
|
||||
if (is_array($layoutRows) && isset($layoutRows[0])) {
|
||||
$layout = $layoutRows[0];
|
||||
@@ -348,13 +350,14 @@ class LayoutsRepository
|
||||
$cacheHandler->delete($cacheKey);
|
||||
}
|
||||
|
||||
$layoutRows = $this->db->query(
|
||||
$stmt = $this->db->query(
|
||||
"SELECT pp_layouts.*
|
||||
FROM pp_layouts
|
||||
JOIN pp_layouts_categories ON pp_layouts.id = pp_layouts_categories.layout_id
|
||||
WHERE pp_layouts_categories.category_id = " . (int)$categoryId . "
|
||||
ORDER BY pp_layouts.id DESC"
|
||||
)->fetchAll(\PDO::FETCH_ASSOC);
|
||||
);
|
||||
$layoutRows = $stmt ? $stmt->fetchAll(\PDO::FETCH_ASSOC) : [];
|
||||
|
||||
if (is_array($layoutRows) && isset($layoutRows[0])) {
|
||||
$layout = $layoutRows[0];
|
||||
|
||||
Reference in New Issue
Block a user