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:
2026-02-19 15:26:07 +01:00
parent a610c52317
commit 662c9f63de
30 changed files with 1380 additions and 1164 deletions

View File

@@ -216,8 +216,8 @@ class ShopProductController
$db = $GLOBALS['mdb'];
$product = $this->repository->findForAdmin( (int) \Shared\Helpers\Helpers::get( 'id' ) );
$languages = ( new \Domain\Languages\LanguagesRepository( $db ) )->languagesList();
$product = $this->repository->findForAdmin( (int) \Shared\Helpers\Helpers::get( 'id' ) ) ?: [];
$languages = $this->languagesRepository->languagesList();
$categories = ( new CategoryRepository( $db ) )->subcategories( null );
$layouts = $this->layoutsForProductEdit( $db );
$products = $this->repository->allProductsList();
@@ -920,7 +920,7 @@ class ShopProductController
*/
public function ajax_product_url(): void
{
echo json_encode( [ 'url' => ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->getProductUrl( (int) \Shared\Helpers\Helpers::get( 'product_id' ) ) ] );
echo json_encode( [ 'url' => $this->repository->getProductUrl( (int) \Shared\Helpers\Helpers::get( 'product_id' ) ) ] );
exit;
}
@@ -931,7 +931,7 @@ class ShopProductController
{
$response = [ 'status' => 'error', 'msg' => 'Podczas generowania kodu sku wystąpił błąd. Proszę spróbować ponownie.' ];
$sku = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->generateSkuCode();
$sku = $this->repository->generateSkuCode();
if ( $sku ) {
$response = [ 'status' => 'ok', 'sku' => $sku ];
}