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 0252ccea30
commit de11afb003
30 changed files with 1380 additions and 1164 deletions

View File

@@ -28,7 +28,8 @@ class IntegrationsRepository
public function getSettings( string $provider ): array
{
$table = $this->settingsTable( $provider );
$results = $this->db->query( "SELECT * FROM $table" )->fetchAll( \PDO::FETCH_ASSOC );
$stmt = $this->db->query( "SELECT * FROM $table" );
$results = $stmt ? $stmt->fetchAll( \PDO::FETCH_ASSOC ) : [];
$settings = [];
foreach ( $results as $row )
$settings[$row['name']] = $row['value'];
@@ -535,8 +536,9 @@ class IntegrationsRepository
$response = curl_exec( $ch );
if ( curl_errno( $ch ) ) {
$error = curl_error( $ch );
curl_close( $ch );
return [ 'status' => 'error', 'msg' => 'Błąd cURL: ' . curl_error( $ch ) ];
return [ 'status' => 'error', 'msg' => 'Błąd cURL: ' . $error ];
}
curl_close( $ch );
@@ -595,8 +597,8 @@ class IntegrationsRepository
if ( !empty( $responseData['products'] ) ) {
$this->db->update( 'pp_shop_products', [
'apilo_product_id' => reset( $responseData['products'] ),
'apilo_product_name' => $product->language['name'],
], [ 'id' => $product->id ] );
'apilo_product_name' => $product['language']['name'],
], [ 'id' => $product['id'] ] );
return [ 'success' => true, 'message' => 'Produkt został dodany do magazynu APILO.' ];
}