# Katalog klas i metod — autoload/

Wygenerowano: 2026-02-18
Łącznie: **96 klas**, ~**530+ metod**

---

## Spis treści

1. [Domain/ — Warstwa domenowa (29 klas)](#domain)
2. [admin/ — Warstwa administracyjna (39 klas)](#admin)
3. [front/ — Warstwa frontendowa (21 klas)](#front)
4. [Shared/ — Klasy współdzielone (7 klas)](#shared)

---

<a id="domain"></a>
## 1. Domain/ — Warstwa domenowa

### Domain\Article\ArticleRepository ✅ REVIEWED
File: `autoload/Domain/Article/ArticleRepository.php`
Properties:
- `private $db`
- `private const MAX_PER_PAGE = 100`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function find(int $articleId): ?array` — try/catch na brak kolumny `o` (kompatybilność)
- ✅ `public function save(int $articleId, array $data, int $userId): int`
- ✅ `public function archive(int $articleId): bool`
- ✅ `public function restore(int $articleId): bool`
- ✅ `public function deletePermanently(int $articleId): bool`
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'date_add', string $sortDir = 'DESC', int $page = 1, int $perPage = 15): array`
- ✅ `public function listArchivedForAdmin(array $filters, string $sortColumn = 'date_add', string $sortDir = 'DESC', int $page = 1, int $perPage = 15): array`
- ✅ `public function saveGalleryOrder(int $articleId, string $order): bool`
- ✅ `public function saveFilesOrder(int $articleId, string $order): bool`
- ✅ `public function pagesSummaryForArticles(array $articleIds): array`
- ✅ `public function updateImageAlt(int $imageId, string $imageAlt): bool`
- ✅ `public function updateFileName(int $fileId, string $fileName): bool`
- ✅ `public function markFileToDelete(int $fileId): bool`
- ✅ `public function markImageToDelete(int $imageId): bool`
- ✅ `public function deleteNonassignedFiles(): void`
- ✅ `public function deleteNonassignedImages(): void`
- 🔧 `public function articlesByDateAdd(string $dateStart, string $dateEnd, string $langId = 'pl'): array` — naprawiono SQL injection (addslashes→parameterized), dodano parametr $langId
- 🔧 `public function articleDetailsFrontend(int $articleId, string $langId): ?array` — select+foreach → get() (uproszczono)
- 🔧 `public function articlesIds(int $pageId, string $langId, int $limit, int $sortType, int $from): ?array` — parametryzacja $langId
- 🔧 `public function pageArticlesCount(int $pageId, string $langId): int` — parametryzacja $langId
- ✅ `public function pageArticles(array $page, string $langId, int $bs): array`
- ✅ `public function news(int $pageId, int $limit, string $langId): ?array`
- ✅ `public function articleNoindex(int $articleId, string $langId): bool`
- 🔧 `public function topArticles(int $pageId, int $limit, string $langId): ?array` — parametryzacja $langId + DRY via fetchArticlesByPage()
- 🔧 `public function newsListArticles(int $pageId, int $limit, string $langId): ?array` — parametryzacja $langId + DRY via fetchArticlesByPage()

Private Methods:
- ✅ `private function createArticle(array $data, int $userId): int`
- ✅ `private function updateArticle(int $articleId, array $data, int $userId): int`
- ✅ `private function buildArticleRow(array $data, int $userId, bool $isNew): array`
- ✅ `private function buildLangRow($langId, array $data): array`
- ✅ `private function applyGalleryOrderIfProvided(int $articleId, array $data): void`
- ✅ `private function applyFilesOrderIfProvided(int $articleId, array $data): void`
- ✅ `private function saveTranslations(int $articleId, array $data, bool $isNew): void`
- ✅ `private function savePages(int $articleId, $pages, bool $isNew): void`
- ✅ `private function assignTempFiles(int $articleId): void`
- ✅ `private function assignTempImages(int $articleId): void`
- ✅ `private function deleteMarkedImages(int $articleId): void`
- ✅ `private function deleteMarkedFiles(int $articleId): void`
- ✅ `private function maxPageOrder(): int`
- ✅ `private function isCheckedValue($value): bool`
- ✅ `private function appendDateRangeFilter(array &$where, array &$params, string $column, string $fromKey, string $toKey, array $filters): void`
- 🔧 `private function fetchArticlesByPage(string $cachePrefix, int $pageId, int $limit, string $langId, string $orderBy): ?array` — NOWA, wspólna logika topArticles/newsListArticles

---

### Domain\Attribute\AttributeRepository ✅ REVIEWED
File: `autoload/Domain/Attribute/AttributeRepository.php`
Properties:
- `private $db`
- `private ?string $defaultLangId = null`
- `private const MAX_PER_PAGE = 100`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'o', string $sortDir = 'ASC', int $page = 1, int $perPage = 15): array`
- ✅ `public function findAttribute(int $attributeId): array`
- ✅ `public function saveAttribute(array $data): ?int`
- ✅ `public function deleteAttribute(int $attributeId): bool`
- ✅ `public function findValues(int $attributeId): array`
- ✅ `public function saveValues(int $attributeId, array $payload): bool`
- ✅ `public function saveLegacyValues(int $attributeId, array $names, array $values, array $ids, $defaultValue, array $impactOnThePrice): ?int`
- ✅ `public function valueDetails(int $valueId): array`
- ✅ `public function getAttributeNameById(int $attributeId, ?string $langId = null): string`
- ✅ `public function getAttributeValueById(int $valueId, ?string $langId = null): string` — z cache
- ✅ `public function getAttributesListForCombinations(): array`
- ✅ `public function frontAttributeDetails(int $attributeId, string $langId): array` — z cache
- ✅ `public function frontValueDetails(int $valueId, string $langId): array` — z cache
- ✅ `public function isValueDefault(int $valueId)`
- ✅ `public function getAttributeOrder(int $attributeId)`
- ✅ `public function getAttributeNameByValue(int $valueId, string $langId)` — parametryzowane query

Private Methods:
- ✅ `private function buildAdminWhere(array $filters): array`
- ✅ `private function saveAttributeTranslations(int $attributeId, array $names): void`
- ✅ `private function saveValueTranslations(int $valueId, array $translations): void`
- ✅ `private function valueBelongsToAttribute(int $valueId, int $attributeId): bool`
- ✅ `private function normalizeValueRows(array $rows): array`
- ✅ `private function refreshCombinationPricesForValue(int $valueId, ?string $impactOnThePrice): void`
- ✅ `private function toSwitchValue($value): int`
- ✅ `private function toTypeValue($value): int`
- ✅ `private function toNullableNumeric($value): ?string`
- ✅ `private function defaultAttribute(): array`
- ✅ `private function nextOrder(): int`
- ✅ `private function defaultLanguageId(): string`
- ✅ `private function clearFrontCache(int $id, string $type): void`
- 🔧 `private function clearTempAndCache(): void` — usunięto martwy check `class_exists('\S')`
- ✅ `private function normalizeDecimal(float $value, int $precision = 2): float`

---

### Domain\Banner\BannerRepository ✅ REVIEWED
File: `autoload/Domain/Banner/BannerRepository.php`
Properties:
- `private $db`
- `private const MAX_PER_PAGE = 100`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function find(int $bannerId): ?array` — pobiera baner + tłumaczenia
- ✅ `public function delete(int $bannerId): bool`
- ✅ `public function save(array $data)` — insert/update, obsługuje nowy i legacy format
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'name', string $sortDir = 'ASC', int $page = 1, int $perPage = 15): array` — z thumbnailami
- 🔧 `public function banners(string $langId): ?array` — parametryzacja $today + null guard na query()
- 🔧 `public function mainBanner(string $langId): ?array` — parametryzacja $today + null guard na query()

Private Methods:
- ✅ `private function fetchThumbnailsByBannerIds(array $bannerIds): array` — parametryzowane IN
- ✅ `private function saveTranslations(int $bannerId, array $src, array $url, array $html, array $text): void` — legacy format
- ✅ `private function saveTranslationsFromArray(int $bannerId, array $translations): void` — nowy format
- ✅ `private function upsertTranslation(int $bannerId, $langId, array $fields): void` — count+insert/update

---

### Domain\Basket\BasketCalculator ✅ REVIEWED
File: `autoload/Domain/Basket/BasketCalculator.php`
Properties: (brak — klasa statyczna)

Methods:
- ✅ `public static function summaryWp($basket)` — suma wag, is_array guard
- ✅ `public static function countProductsText($count)` — polska pluralizacja
- 🔧 `public static function summaryPrice($basket, $coupon = null, $langId = null, $productRepo = null)` — dodano opcjonalne DI params z fallbackiem do globals
- ✅ `public static function countProducts($basket)` — suma ilości, is_array guard
- ✅ `public static function validateBasket($basket)` — null guard
- 🔧 `public static function checkProductQuantityInStock($basket, bool $message = false)` — dodano is_array guard (bug: foreach na null)
- 🔧 `public static function calculateBasketProductPrice(float $price_brutto_promo, float $price_brutto, $coupon, $basket_position, $productRepo = null)` — dodano opcjonalny $productRepo z fallbackiem do globals

---

### Domain\Cache\CacheRepository ✅ REVIEWED
File: `autoload/Domain/Cache/CacheRepository.php`
Properties:
- `private $redisConnection`
- `private $basePath`

Methods:
- ✅ `public function __construct(?\Shared\Cache\RedisConnection $redisConnection = null, string $basePath = '../')`
- ✅ `public function clearCache(): array` — czyści katalogi temp/thumbs + Redis flushAll, null guard na connection

---

### Domain\Category\CategoryRepository ✅ REVIEWED
File: `autoload/Domain/Category/CategoryRepository.php`
Properties:
- `private $db`
- `private const SORT_TYPES`, `SORT_ORDER_SQL`, `PRODUCTS_PER_PAGE`, `LANGUAGE_FALLBACK_NAME_SQL`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function sortTypes(): array`
- ✅ `public function subcategories($parentId = null): array`
- ✅ `public function categoryDetails($categoryId = ''): array`
- ✅ `public function categoryProducts(int $categoryId): array` — parametryzowane query
- ✅ `public function categoryDelete($categoryId): bool` — guard na podkategorie
- ✅ `public function saveCategoriesOrder($categories): bool`
- ✅ `public function saveProductOrder($categoryId, $products): bool`
- ✅ `public function save(array $data): ?int` — upsert tłumaczeń
- ✅ `public function categoryTitle(int $categoryId): string`
- ✅ `public function getCategorySort(int $categoryId): int` — cache poprawny
- ✅ `public function categoryName(int $categoryId, string $langId): string` — cache poprawny
- ✅ `public function categoryUrl(int $categoryId, string $langId): string`
- ✅ `public function frontCategoryDetails(int $categoryId, string $langId): array` — cache
- ✅ `public function categoriesTree(string $langId, ?int $parentId = null): array` — rekurencyjne z cache
- ✅ `public function blogCategoryProducts(int $categoryId, string $langId, int $limit): array` — parametryzowane query
- ✅ `public function categoryProductsCount(int $categoryId, string $langId): int` — parametryzowane query
- ✅ `public function productsId(int $categoryId, int $sortType, string $langId, int $productsLimit, int $from): array` — ORDER BY z whitelist
- ✅ `public function paginatedCategoryProducts(int $categoryId, int $sortType, string $langId, int $page): array`
- ✅ `public function getCategoryProductIds(int $categoryId): array`
- 🔧 `public function subcategoriesLangCached(int $categoryId): array` — USUNIĘTA (martwy kod, myląca nazwa)

Private Methods:
- ✅ `private function maxOrder(): int`
- ✅ `private function refreshCategoryArtifacts(): void`
- ✅ `private function normalizeSeoLink($value): ?string`
- ✅ `private function toNullableString($value): ?string`
- ✅ `private function toSwitchValue($value): int`
- ✅ `private function toNullableInt($value): ?int`
- ✅ `private function defaultCategory(): array`
- ✅ `private function productName(int $productId): string`

---

### Domain\Client\ClientRepository ✅ REVIEWED
File: `autoload/Domain/Client/ClientRepository.php`
Properties:
- `private $db`
- `private const MAX_PER_PAGE = 100`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'client_surname', string $sortDir = 'ASC', int $page = 1, int $perPage = 15): array` — sort z whitelist, parametryzowane
- ✅ `public function ordersForClient(string $name, string $surname, string $email): array` — parametryzowane
- ✅ `public function totalsForClient(string $name, string $surname, string $email): array` — parametryzowane
- ✅ `public function clientDetails(int $clientId): ?array`
- ✅ `public function clientEmail(int $clientId): ?string`
- ✅ `public function clientAddresses(int $clientId): array`
- ✅ `public function addressDetails(int $addressId): ?array`
- ✅ `public function addressDelete(int $addressId): bool`
- ✅ `public function addressSave(int $clientId, ?int $addressId, array $data): bool`
- ✅ `public function markAddressAsCurrent(int $clientId, int $addressId): bool`
- 🔧 `public function clientOrders(int $clientId): array` — OrderRepository przeniesiony przed pętlę (performance)
- ✅ `public function authenticate(string $email, string $password): array` — md5 hashing (legacy)
- ✅ `public function createClient(string $email, string $password, bool $agreementMarketing): ?array`
- ✅ `public function confirmRegistration(string $hash): ?string`
- ✅ `public function generateNewPassword(string $hash): ?array`
- ✅ `public function initiatePasswordRecovery(string $email): ?string`

Private Methods:
- ✅ `private function normalizeTextFilter($value): string`

---

### Domain\Coupon\CouponRepository ✅ REVIEWED
File: `autoload/Domain/Coupon/CouponRepository.php`
Properties:
- `private $db`
- `private ?string $defaultLangId = null`
- `private const MAX_PER_PAGE = 100`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'name', string $sortDir = 'ASC', int $page = 1, int $perPage = 15): array` — sort z whitelist, parametryzowane
- ✅ `public function find(int $couponId): array`
- ✅ `public function save(array $data): ?int`
- ✅ `public function delete(int $couponId): bool`
- ✅ `public function findByName(string $name)` — zwraca object
- ✅ `public function isAvailable($coupon)` — obsługuje object i array
- ✅ `public function markAsUsed(int $couponId)`
- ✅ `public function incrementUsedCount(int $couponId)`
- ✅ `public function categoriesTree($parentId = null): array` — rekurencyjne

Private Methods:
- ✅ `private function defaultCoupon(): array`
- ✅ `private function toSwitchValue($value): int`
- ✅ `private function toNullableNumeric($value): ?string`
- ✅ `private function encodeIdList($values): ?string`
- ✅ `private function decodeIdList($raw): array`
- ✅ `private function normalizeIdList($values): array`
- ✅ `private function categoryTitle(array $languages): string`
- ✅ `private function defaultLanguageId(): string`

---

### Domain\Dashboard\DashboardRepository ✅ REVIEWED
File: `autoload/Domain/Dashboard/DashboardRepository.php`
Properties:
- `private $db`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function summaryOrders(): int` — Redis cache (300s TTL)
- ✅ `public function summarySales(): float` — Redis cache (300s TTL)
- ✅ `public function salesGrid(): array` — mapa dzień×godzina zamówień
- ✅ `public function mostViewedProducts(): array` — top 10 po visits
- ✅ `public function bestSalesProducts(): array` — top 10 po sprzedaży
- ✅ `public function last24MonthsSales(): array` — sprzedaż per miesiąc
- ✅ `public function lastOrders(int $limit = 10): array`

Private Methods:
- ✅ `private function calculateTotalSales(): float`

---

### Domain\Dictionaries\DictionariesRepository ✅ REVIEWED
File: `autoload/Domain/Dictionaries/DictionariesRepository.php`
Properties:
- `private $db`
- `private const MAX_PER_PAGE = 100`
- `private const CACHE_TTL = 86400`
- `private const CACHE_SUBDIR = 'dictionaries'`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'id', string $sortDir = 'ASC', int $page = 1, int $perPage = 15): array` — sort z whitelist, parametryzowane
- ✅ `public function allUnits(): array`
- ✅ `public function find(int $unitId): ?array` — z tłumaczeniami
- ✅ `public function save(array $data)` — insert + upsert tłumaczeń
- ✅ `public function delete(int $unitId): bool` — kasuje też tłumaczenia
- ✅ `public function getUnitNameById(int $unitId, $langId): string` — z cache

Private Methods:
- ✅ `private function normalizeTranslations(array $data): array`
- ✅ `private function upsertTranslation(int $unitId, $langId, string $text): void`
- 🔧 `private function clearCache(): void` — usunięto martwy check `class_exists('\S')`
- ✅ `private function cacheFetch(string $key)`
- ✅ `private function cacheStore(string $key, string $value): void`

---

### Domain\Integrations\IntegrationsRepository ✅ REVIEWED
File: `autoload/Domain/Integrations/IntegrationsRepository.php`
Properties:
- `private $db`
- `private const SETTINGS_TABLES`, `APILO_ENDPOINTS`, `APILO_SETTINGS_KEYS`

Public Methods:
- ✅ `public function __construct($db)`
- 🔧 `public function getSettings(string $provider): array` — dodano null guard na query()
- ✅ `public function getSetting(string $provider, string $name): ?string`
- ✅ `public function saveSetting(string $provider, string $name, $value): bool`
- ✅ `public function linkProduct(int $productId, $externalId, $externalName): bool`
- ✅ `public function unlinkProduct(int $productId): bool`
- ✅ `public function apiloAuthorize(string $clientId, string $clientSecret, string $authCode): bool`
- ✅ `public function apiloGetAccessToken(int $refreshLeadSeconds = 300): ?string`
- ✅ `public function apiloKeepalive(int $refreshLeadSeconds = 300): array`
- ✅ `public function apiloIntegrationStatus(): array`
- ✅ `public function apiloFetchList(string $type): bool`
- ✅ `public function apiloFetchListResult(string $type): array`
- ✅ `public function getProductSku(int $productId): ?string`
- 🔧 `public function apiloProductSearch(string $sku): array` — naprawiono curl_error() po curl_close()
- 🔧 `public function apiloCreateProduct(int $productId): array` — naprawiono mieszany array/object access ($product->field → $product['field'])
- ✅ `public function shopproImportProduct(int $productId): array`

Private Methods:
- ✅ `private function settingsTable(string $provider): string` — whitelist z const
- ✅ `private function refreshApiloAccessToken(array $settings): ?string`
- ✅ `private function shouldRefreshAccessToken(string $expiresAtRaw, int $leadSeconds = 300): bool`
- ✅ `private function isFutureDate(string $dateRaw): bool`
- ✅ `private function normalizeApiloMapList(array $data): ?array`
- ✅ `private function isMapListShape(array $list): bool`
- ✅ `private function extractApiloErrorMessage(array $data): string`

---

### Domain\Languages\LanguagesRepository ✅ REVIEWED
File: `autoload/Domain/Languages/LanguagesRepository.php`
Properties:
- `private $db`
- `private const MAX_PER_PAGE = 100`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'o', string $sortDir = 'ASC', int $page = 1, int $perPage = 15): array` — sort z whitelist
- ✅ `public function listTranslationsForAdmin(array $filters, string $sortColumn = 'text', string $sortDir = 'ASC', int $page = 1, int $perPage = 15): array`
- ✅ `public function languageDetails(string $languageId): ?array`
- ✅ `public function translationDetails(int $translationId): ?array`
- ✅ `public function maxOrder(): int`
- ✅ `public function languagesList(bool $onlyActive = false): array`
- ✅ `public function defaultLanguageId(): string`
- ✅ `public function deleteLanguage(string $languageId): bool` — sanitizeLanguageId + ALTER TABLE
- ✅ `public function saveLanguage(string $languageId, string $name, $status, $start, int $order): ?string`
- ✅ `public function deleteTranslation(int $translationId): bool`
- ✅ `public function saveTranslation(int $translationId, string $text, array $translations): ?int`
- 🔧 `public function defaultLanguage(): string` — dodano null guard na query()
- ✅ `public function activeLanguages(): array` — z cache
- ✅ `public function translations(string $language = 'pl'): array` — z cache

Private Methods:
- ✅ `private function sanitizeLanguageId(string $languageId): ?string` — regex /^[a-z]{2}$/
- ✅ `private function toSwitchValue($value): int`

---

### Domain\Layouts\LayoutsRepository ✅ REVIEWED
File: `autoload/Domain/Layouts/LayoutsRepository.php`
Properties:
- `private $db`
- `private const MAX_PER_PAGE = 100`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function delete(int $layoutId): bool` — guard na count <= 1
- ✅ `public function find(int $layoutId): array` — z pages/categories
- ✅ `public function save(array $data): ?int` — insert/update + sync pages/categories
- ✅ `public function listAll(): array`
- ✅ `public function menusWithPages(): array`
- ✅ `public function categoriesTree($parentId = null): array` — rekurencyjne
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'name', string $sortDir = 'ASC', int $page = 1, int $perPage = 15): array` — sort z whitelist
- ✅ `public function categoryDefaultLayoutId()`
- ✅ `public function getDefaultLayout(): ?array` — z cache
- 🔧 `public function getProductLayout(int $productId): ?array` — dodano 2× null guard na query()
- ✅ `public function getArticleLayout(int $articleId): ?array` — z cache
- 🔧 `public function getCategoryLayout(int $categoryId): ?array` — dodano null guard na query()
- ✅ `public function getActiveLayout(int $pageId): ?array` — z cache

Private Methods:
- ✅ `private function syncPages(int $layoutId, $pages): void`
- ✅ `private function syncCategories(int $layoutId, $categories): void`
- ✅ `private function normalizeIds($values): array`
- ✅ `private function toSwitchValue($value): int`
- ✅ `private function defaultLayout(): array`
- ✅ `private function clearFrontLayoutsCache(): void`
- ✅ `private function menuPages(int $menuId, $parentId = null): array` — rekurencyjne
- ✅ `private function pageTitle(int $pageId): string`

---

### Domain\Newsletter\NewsletterPreviewRenderer ✅ REVIEWED
File: `autoload/Domain/Newsletter/NewsletterPreviewRenderer.php`
Properties: (brak)

Methods:
- ✅ `public function render(array $articles, array $settings, ?array $template, string $dates = ''): string` — htmlspecialchars na danych user

---

### Domain\Newsletter\NewsletterRepository ✅ REVIEWED
File: `autoload/Domain/Newsletter/NewsletterRepository.php`
Properties:
- `private $db`
- `private SettingsRepository $settingsRepository`
- `private ?ArticleRepository $articleRepository`
- `private ?NewsletterPreviewRenderer $previewRenderer`
- `private const MAX_PER_PAGE = 100`

Public Methods:
- ✅ `public function __construct($db, ?SettingsRepository, ?ArticleRepository, ?NewsletterPreviewRenderer)`
- ✅ `public function getSettings(): array`
- ✅ `public function saveSettings(array $values): bool`
- ✅ `public function queueSend(string $dates = '', int $templateId = 0): bool`
- ✅ `public function templateByName(string $templateName): string`
- ✅ `public function templateDetails(int $templateId): ?array`
- ✅ `public function isAdminTemplate(int $templateId): bool`
- ✅ `public function deleteTemplate(int $templateId): bool` — guard na admin templates
- ✅ `public function saveTemplate(int $templateId, string $name, string $text): ?int`
- ✅ `public function listTemplatesSimple(bool $adminTemplates = false): array`
- ✅ `public function deleteSubscriber(int $subscriberId): bool`
- ✅ `public function listSubscribersForAdmin(array $filters, ...): array` — sort z whitelist
- ✅ `public function listTemplatesForAdmin(bool $adminTemplates, array $filters, ...): array` — sort z whitelist
- ✅ `public function unsubscribe(string $hash): bool`
- ✅ `public function confirmSubscription(string $hash): bool`
- ✅ `public function getHashByEmail(string $email): ?string`
- ✅ `public function removeByEmail(string $email): bool`
- ✅ `public function signup(string $email, string $serverName, bool $ssl, array $settings): bool` — walidacja email
- ✅ `public function sendQueued(int $limit, string $serverName, bool $ssl, string $unsubscribeLabel): bool`

Private Methods:
- ✅ `private function getArticleRepository(): ArticleRepository` — lazy loading
- ✅ `private function getPreviewRenderer(): NewsletterPreviewRenderer` — lazy loading

---

### Domain\Order\OrderAdminService ✅ REVIEWED
File: `autoload/Domain/Order/OrderAdminService.php`
Properties:
- `private OrderRepository $orders`
- `private const APILO_SYNC_QUEUE_FILE`

Public Methods:
- ✅ `public function __construct(OrderRepository $orders)`
- ✅ `public function details(int $orderId): array`
- ✅ `public function statuses(): array`
- ✅ `public function listForAdmin(array $filters, ...): array`
- ✅ `public function nextOrderId(int $orderId): ?int`
- ✅ `public function prevOrderId(int $orderId): ?int`
- ✅ `public function saveNotes(int $orderId, string $notes): bool`
- ✅ `public function saveOrderByAdmin(array $input): bool`
- ✅ `public function changeStatus(int $orderId, int $status, bool $sendEmail): array`
- ✅ `public function resendConfirmationEmail(int $orderId): bool`
- ✅ `public function setOrderAsUnpaid(int $orderId): bool`
- ✅ `public function setOrderAsPaid(int $orderId, bool $sendMail): bool`
- 🔧 `public function sendOrderToApilo(int $orderId): bool` — dodano 3× null guard na query()
- ✅ `public function toggleTrustmateSend(int $orderId): array`
- ✅ `public function deleteOrder(int $orderId): bool`
- ✅ `public function processApiloSyncQueue(int $limit = 10): int`

Private Methods:
- ✅ `private function sendStatusChangeEmail(array $order): bool`
- ✅ `private function syncApiloPaymentIfNeeded(array $order): void`
- ✅ `private function syncApiloStatusIfNeeded(array $order, int $status): void`
- ✅ `private function syncApiloPayment(array $order): bool`
- ✅ `private function syncApiloStatus(array $order, int $status): bool`
- ✅ `private static function queueApiloSync(...): void`
- ✅ `private static function apiloSyncQueuePath(): string`
- ✅ `private static function loadApiloSyncQueue(): array`
- ✅ `private static function saveApiloSyncQueue(array $queue): void`
- ✅ `private static function appendApiloLog(string $message): void`

---

### Domain\Order\OrderRepository ✅ REVIEWED
File: `autoload/Domain/Order/OrderRepository.php`
Properties:
- `private $db`
- `private const MAX_PER_PAGE = 100`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'date_order', string $sortDir = 'DESC', int $page = 1, int $perPage = 15): array` — sort z whitelist
- ✅ `public function findForAdmin(int $orderId): array`
- ✅ `public function orderProducts(int $orderId): array`
- ✅ `public function orderStatusHistory(int $orderId): array`
- ✅ `public function orderStatuses(): array`
- ✅ `public function nextOrderId(int $orderId): ?int`
- ✅ `public function prevOrderId(int $orderId): ?int`
- ✅ `public function saveNotes(int $orderId, string $notes): bool`
- ✅ `public function saveOrderByAdmin(...): bool`
- ✅ `public function calculateOrderSummaryByAdmin(int $orderId): float`
- ✅ `public function toggleTrustmateSend(int $orderId): ?int`
- ✅ `public function deleteOrder(int $orderId): bool`
- ✅ `public function findIdByHash(string $hash)`
- ✅ `public function findHashById(int $orderId)`
- ✅ `public function orderDetailsFrontend($orderId = null, $hash = '', $przelewy24Hash = '')`
- 🔧 `public function generateOrderNumber()` — dodano null guard na query()
- 🔧 `public function createFromBasket(...)` — AttributeRepository wyciągnięty przed pętlę, ProductRepository reuse zamiast new
- ✅ `public function getDb()`
- ✅ `public function findRawById(int $orderId): ?array`
- ✅ `public function findRawByHash(string $hash): ?array`
- ✅ `public function findRawByPrzelewy24Hash(string $hash): ?array`
- ✅ `public function setAsPaid(int $orderId): void`
- ✅ `public function setAsUnpaid(int $orderId): void`
- ✅ `public function updateOrderStatus(int $orderId, int $status): bool`
- ✅ `public function insertStatusHistory(int $orderId, int $statusId, int $mail): void`
- ✅ `public function updateApiloStatusDate(int $orderId, string $date): void`

Private Methods:
- ✅ `private function nullableString(string $value): ?string`
- ✅ `private function normalizeTextFilter($value): string`
- ✅ `private function normalizeDateFilter($value): ?string`

---

### Domain\Pages\PagesRepository ✅ REVIEWED
File: `autoload/Domain/Pages/PagesRepository.php`
Properties:
- `private $db`
- `private const PAGE_TYPES`, `SORT_TYPES`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function pageTypes(): array`
- ✅ `public function sortTypes(): array`
- ✅ `public function menusList(): array`
- ✅ `public function menusWithPages(): array`
- ✅ `public function menuPages(int $menuId, ?int $parentId = null): array` — rekurencyjne
- ✅ `public function menuDelete(int $menuId): bool` — guard na pages
- ✅ `public function pageDelete(int $pageId): bool` — guard na subpages
- ✅ `public function menuDetails(int $menuId): array`
- ✅ `public function menuSave(int $menuId, string $name, $status): bool`
- ✅ `public function pageDetails(int $pageId): array` — z tłumaczeniami i layout
- ✅ `public function pageArticles(int $pageId): array` — parametryzowane query
- ✅ `public function saveArticlesOrder(int $pageId, $articles): bool`
- ✅ `public function savePagesOrder(int $menuId, $pages): bool`
- ✅ `public function pageSave(array $data): ?int` — insert/update + upsert tłumaczeń
- ✅ `public function generateSeoLink(string $title, int $pageId = 0, int $articleId = 0, int $categoryId = 0): string`
- ✅ `public function pageUrlPreview(...): string`
- ✅ `public function toggleCookieValue(string $cookieName, int $itemId): void`
- ✅ `public function pageTitle(int $pageId): string`
- ✅ `public function pageLanguages(int $pageId): array`
- ✅ `public function frontPageDetails($id = '', $langId = ''): ?array` — z cache
- ✅ `public function frontPageSort(int $pageId)` — z cache
- ✅ `public function frontMainPageId()` — z cache
- ✅ `public function frontLangUrl(int $pageId, string $langId): string`
- ✅ `public function frontMenuDetails(int $menuId, string $langId): ?array` — z cache
- ✅ `public function frontMenuPages(int $menuId, string $langId, $parentId = null): ?array` — rekurencyjne z cache

Private Methods:
- ✅ `private function defaultPage(): array`
- ✅ `private function saveTranslations(int $pageId, int $pageType, array $data): void`
- ✅ `private function updateSubpagesMenuId(int $parentId, int $menuId): void` — rekurencyjne
- ✅ `private function isSeoLinkUsed(string $table, string $idColumn, string $seoLink, int $exceptId): bool`
- ✅ `private function maxPageOrder(): int`
- ✅ `private function toSwitchValue($value): int`
- ✅ `private function normalizeNullableInt($value): ?int`
- ✅ `private function nullIfEmpty($value): ?string`

---

### Domain\PaymentMethod\PaymentMethodRepository ✅ REVIEWED
File: `autoload/Domain/PaymentMethod/PaymentMethodRepository.php`
Properties:
- `private $db`
- `private const MAX_PER_PAGE = 100`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'name', string $sortDir = 'ASC', int $page = 1, int $perPage = 15): array`
- ✅ `public function find(int $paymentMethodId): ?array`
- ✅ `public function save(int $paymentMethodId, array $data): ?int`
- ✅ `public function allActive(): array`
- ✅ `public function allForAdmin(): array`
- ✅ `public function findActiveById(int $paymentMethodId): ?array`
- ✅ `public function isActive(int $paymentMethodId): int`
- ✅ `public function getApiloPaymentTypeId(int $paymentMethodId)`
- ✅ `public function forTransport(int $transportMethodId): array`
- ✅ `public function paymentMethodsByTransport(int $transportMethodId): array` — cached (Redis)
- ✅ `public function paymentMethodCached(int $paymentMethodId): ?array` — cached (Redis)
- ✅ `public function paymentMethodsCached(): array` — cached (Redis)

Private Methods:
- ✅ `private function normalizePaymentMethod(array $row): array`
- ✅ `private function normalizeApiloPaymentTypeId($value)`
- ✅ `private function toSwitchValue($value): int`

---

### Domain\Producer\ProducerRepository ✅ REVIEWED
File: `autoload/Domain/Producer/ProducerRepository.php`
Properties:
- `private $db`
- `private const MAX_PER_PAGE = 100`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'name', string $sortDir = 'ASC', int $page = 1, int $perPage = 15): array`
- ✅ `public function find(int $id): array`
- ✅ `public function save(int $id, string $name, int $status, ?string $img, array $description, array $data, array $metaTitle, array $langs): ?int`
- ✅ `public function delete(int $id): bool`
- ✅ `public function allProducers(): array`
- ✅ `public function findForFrontend(int $id, string $langId): ?array`
- ✅ `public function producerProducts(int $producerId, int $perPage = 12, int $page = 1): array`
- ✅ `public function allActiveIds(): array`
- ✅ `public function allActiveProducers(): array`

Private Methods:
- ✅ `private function defaultProducer(): array`
- ✅ `private function toSwitchValue($value): int`

---

### Domain\Product\ProductRepository ✅ REVIEWED
File: `autoload/Domain/Product/ProductRepository.php` (2846 linii, największa klasa)
Properties:
- `private $db`
- `private const MAX_PER_PAGE = 100`

Public Methods (CRUD admin):
- ✅ `public function __construct($db)`
- ✅ `public function getQuantity(int $productId): ?int`
- ✅ `public function find(int $productId): ?array`
- ✅ `public function listArchivedForAdmin(array $filters, string $sortColumn, string $sortDir, int $page, int $perPage): array`
- ✅ `public function getPrice(int $productId): ?float`
- ✅ `public function getName(int $productId, string $langId): ?string`
- ✅ `public function updateQuantity(int $productId, int $quantity): bool`
- ✅ `public function unarchive(int $productId): bool`
- ✅ `public function archive(int $productId): bool`
- ✅ `public function allProductsForMassEdit(): array`
- ✅ `public function getProductsByCategory(int $categoryId): array`
- ✅ `public function applyDiscountPercent(int $productId, float $discountPercent): ?array`
- ✅ `public function countProducts(?array $where = null): int`
- ✅ `public function listForAdmin(array $filters, string $sortColumn, string $sortDir, int $page, int $perPage): array`
- ✅ `public function findForAdmin(int $productId): ?array`
- ✅ `public function allProductsList(): array`
- ✅ `public function productCategoriesText(int $productId): string`
- ✅ `public function getParentId(int $productId): ?int`
- ✅ `public function productDefaultName(int $productId): ?string`
- ✅ `public function saveProduct(array $d, ?int $userId = null): ?int`
- ✅ `public function delete(int $productId): bool`
- ✅ `public function duplicate(int $productId, bool $withCombinations = false): bool`
- ✅ `public function toggleStatus(int $productId): bool`
- ✅ `public function updatePriceBrutto(int $productId, $price): bool`
- ✅ `public function updatePriceBruttoPromo(int $productId, $price): bool`
- 🔧 `public function updateCustomLabel(int $productId, string $label, $value): bool` — dodano whitelist walidację $label (SQL injection)

Public Methods (kombinacje):
- ✅ `public function getCombinationsForTable(int $productId): array`
- ✅ `public function getPermutations(int $productId): array`
- ✅ `public function generateCombinations(int $productId, array $attributes): bool`
- ✅ `public function deleteCombination(int $combinationId): bool`
- ✅ `public function countCombinations(int $productId): int`
- ✅ `public function saveCombinationStock0Buy(int $productId, $value): bool`
- ✅ `public function saveCombinationSku(int $productId, $sku): bool`
- ✅ `public function saveCombinationQuantity(int $productId, $quantity): bool`
- ✅ `public function saveCombinationPrice(int $productId, $priceNetto): bool`

Public Methods (zdjęcia/pliki/XML):
- ✅ `public function deleteImage(int $imageId): bool`
- ✅ `public function updateImageAlt(int $imageId, string $alt): bool`
- ✅ `public function saveImagesOrder(int $productId, string $order): bool`
- ✅ `public function deleteNonassignedImages(): void`
- ✅ `public function deleteFile(int $fileId): bool`
- ✅ `public function updateFileName(int $fileId, string $name): bool`
- ✅ `public function deleteNonassignedFiles(): void`
- ✅ `public function getProductImages(int $productId): array`
- ✅ `public function saveXmlName(int $productId, string $xmlName, string $langId): bool`
- 🔧 `public function customLabelSuggestions(string $customLabel, string $labelType): array` — dodano whitelist walidację $labelType (SQL injection)
- 🔧 `public function saveCustomLabel(int $productId, string $customLabel, string $labelType): bool` — dodano whitelist walidację $labelType (SQL injection)
- ✅ `public function generateEAN(string $number): string`
- 🔧 `public function generateGoogleFeedXml(): void` — TransportRepository przeniesiony przed pętlę (performance)
- ✅ `public function updateCombinationPricesFromBase(int $productId, $priceBrutto, $vat, $priceBruttoPromo): void`

Public Methods (frontend/cached):
- ✅ `public function getSkuWithFallback(int $productId, bool $withParentFallback = false)`
- ✅ `public function getEanWithFallback(int $productId, bool $withParentFallback = false)`
- ✅ `public function isProductActiveCached(int $productId): int`
- ✅ `public function getMinimalPriceCached(int $productId, $priceBruttoPromo = null)`
- ✅ `public function productCategoriesFront(int $productId): array`
- ✅ `public function getProductNameCached(int $productId, string $langId)`
- ✅ `public function getFirstImageCached(int $productId)`
- ✅ `public function getWeightCached(int $productId)`
- ✅ `public function promotedProductIdsCached(int $limit = 6): array`
- ✅ `public function topProductIds(int $limit = 6): array`
- ✅ `public function newProductIds(int $limit = 10): array`
- 🔧 `public function productDetailsFrontCached(int $productId, string $langId)` — naprawiono select()→$product['set_id'] (bug logiczny)
- ✅ `public function getWarehouseMessageZero(int $productId, string $langId)`
- ✅ `public function getWarehouseMessageNonzero(int $productId, string $langId)`
- ✅ `public function findCustomFieldCached(int $customFieldId)`
- ✅ `public function findCached(int $productId, string $langId = null, string $permutationHash = null)`
- ✅ `public function isProductOnPromotion(int $productId): bool`
- ✅ `public function productSetsWhenAddToBasket(int $productId): string`
- ✅ `public function addVisit(int $productId): void`
- ✅ `public function getProductImg(int $productId)`
- ✅ `public function getProductUrl(int $productId): string`
- 🔧 `public function searchProductsByNameCount(string $query, string $langId): int` — dodano null guard na query()
- 🔧 `public function getProductsIdByName(string $query, string $langId, int $limit, int $from): array` — dodano null guard na query()
- ✅ `public function searchProductsByName(string $query, string $langId, int $page = 0): array`
- 🔧 `public function searchProductByNameAjax(string $query, string $langId): array` — dodano null guard na query()
- ✅ `public function isStock0Buy(int $productId)`
- ✅ `public function getProductPermutationQuantityOptions(int $productId, $permutation)`
- ✅ `public function getProductIdByAttributes(int $parentId, array $attributes)`
- ✅ `public function getProductPermutationHash(int $productId)`
- ✅ `public function getProductAttributes($products)`
- ✅ `public function generateSkuCode(): string`
- ✅ `public function productMeta(int $productId): array`
- ✅ `public function generateSubtitleFromAttributes(string $permutationHash, string $langId = null): string`
- ✅ `public function getDefaultCombinationPrices(array $product): array`
- ✅ `public function getProductDataBySelectedAttributes(array $product, string $selectedAttribute): array`
- ✅ `public function productCategories(int $productId): array`
- ✅ `public static function arrayCartesian(array $input): array`

Private Methods:
- ✅ `private function defaultLangId(): string`
- ✅ `private function saveLanguages(int $productId, array $d, bool $isNew): void`
- ✅ `private function handleSeoRedirects(int $productId, string $langId, string $newSeoLink, string $currentSeoLink): void`
- ✅ `private function saveCategories(int $productId, $categories): void`
- ✅ `private function saveRelatedProducts(int $productId, $products): void`
- ✅ `private function moveTemporaryFiles(int $productId): void`
- ✅ `private function moveTemporaryImages(int $productId): void`
- ✅ `private function saveCustomFields(int $productId, array $names, array $types, array $required): void`
- ✅ `private function cleanupDeletedFiles(int $productId): void`
- ✅ `private function cleanupDeletedImages(int $productId): void`
- ✅ `private function nullIfEmpty($value)`
- ✅ `private function updateCombinationPrices(int $productId, float $priceNetto, float $vat, ?float $priceNettoPromo): void`
- ✅ `private function appendCombinationToXml(...): void`
- ✅ `private function appendProductToXml(...): void`
- ✅ `private function appendImagesToXml(...): void`
- ✅ `private function appendShippingToXml(...): void`

---

### Domain\ProductSet\ProductSetRepository ✅ REVIEWED
File: `autoload/Domain/ProductSet/ProductSetRepository.php`
Properties:
- `private $db`
- `private const MAX_PER_PAGE = 100`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'name', string $sortDir = 'ASC', int $page = 1, int $perPage = 15): array`
- ✅ `public function find(int $id): array`
- ✅ `public function save(int $id, string $name, int $status, array $productIds): ?int`
- ✅ `public function delete(int $id): bool`
- ✅ `public function allSets(): array`
- ✅ `public function allProductsMap(): array`

Private Methods:
- ✅ `private function syncProducts(int $setId, array $productIds): void`
- ✅ `private function defaultSet(): array`
- ✅ `private function toSwitchValue($value): int`
- ✅ `private function clearTempAndCache(): void`

---

### Domain\Promotion\PromotionRepository ✅ REVIEWED
File: `autoload/Domain/Promotion/PromotionRepository.php`
Properties:
- `private $db`
- `private ?string $defaultLangId = null`
- `private const MAX_PER_PAGE = 100`
- `public static $condition_type`
- `public static $discount_type`

Public Methods (admin):
- ✅ `public function __construct($db)`
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'id', string $sortDir = 'DESC', int $page = 1, int $perPage = 15): array`
- ✅ `public function find(int $promotionId): array`
- ✅ `public function save(array $data): ?int`
- ✅ `public function delete(int $promotionId): bool`
- ✅ `public function categoriesTree($parentId = null): array`
- ✅ `public function getActivePromotions()`

Public Methods (frontend basket promotion):
- ✅ `public function findPromotion($basket)`
- 🔧 `public function applyTypeWholeBasket(array $basket, $promotion): array` — reuse $productRepo zamiast new w pętli
- 🔧 `public function applyTypeCheapestProduct(array $basket, $promotion): array` — reuse $productRepo zamiast new w 2 pętlach
- 🔧 `public function applyTypeCategoriesOr(array $basket, $promotion): array` — reuse $productRepo zamiast new w pętli
- ✅ `public function applyTypeCategoriesAnd(array $basket, $promotion): array`
- ✅ `public function applyTypeCategoryCondition(array $basket, $promotion): array`

Private Methods:
- ✅ `private function defaultPromotion(): array`
- ✅ `private function toSwitchValue($value): int`
- ✅ `private function toNullableInt($value): ?int`
- ✅ `private function toNullableNumeric($value): ?string`
- ✅ `private function toNullableDate($value): ?string`
- ✅ `private function encodeIdList($values): ?string`
- ✅ `private function decodeIdList($raw): array`
- ✅ `private function normalizeIdList($values): array`
- ✅ `private function categoryTitle(array $languages): string`
- ✅ `private function defaultLanguageId(): string`
- ✅ `private function invalidateActivePromotionsCache(): void`

---

### Domain\Scontainers\ScontainersRepository ✅ REVIEWED
File: `autoload/Domain/Scontainers/ScontainersRepository.php`
Properties:
- `private $db`
- `private const MAX_PER_PAGE = 100`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'id', string $sortDir = 'DESC', int $page = 1, int $perPage = 15): array`
- ✅ `public function find(int $containerId): array`
- ✅ `public function detailsForLanguage(int $containerId, string $langId): ?array`
- ✅ `public function save(array $data): ?int`
- ✅ `public function delete(int $containerId): bool`
- ✅ `public function frontScontainerDetails(int $scontainerId, string $langId): array` — cached (Redis)

Private Methods:
- ✅ `private function baseListSelect(): string`
- ✅ `private function clearFrontCache(int $containerId): void`
- ✅ `private function translationsMap(int $containerId): array`
- ✅ `private function extractTranslations(array $data): array`
- ✅ `private function toSwitchValue($value): int`
- ✅ `private function defaultContainer(): array`

---

### Domain\Settings\SettingsRepository ✅ REVIEWED
File: `autoload/Domain/Settings/SettingsRepository.php`
Properties:
- `private $db`

Public Methods:
- ✅ `public function __construct($db = null)`
- ✅ `public function saveSettings(array $values): array`
- ✅ `public function updateSetting(string $param, $value): bool`
- ✅ `public function updateSettings(array $settings): bool`
- ✅ `public function getSettings(): array`
- ✅ `public function allSettings(bool $skipCache = false): array` — cached (Redis)
- ✅ `public function getSingleValue(string $param): string` — cached (Redis)

Private Methods:
- ✅ `private function isEnabled($value): bool`

---

### Domain\ShopStatus\ShopStatusRepository ✅ REVIEWED
File: `autoload/Domain/ShopStatus/ShopStatusRepository.php`
Properties:
- `private $db`
- `private const MAX_PER_PAGE = 100`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'o', string $sortDir = 'ASC', int $page = 1, int $perPage = 15): array`
- ✅ `public function find(int $statusId): ?array`
- ✅ `public function save(int $statusId, array $data): int`
- ✅ `public function getApiloStatusId(int $statusId): ?int`
- ✅ `public function getByIntegrationStatusId(string $integration, int $integrationStatusId): ?int`
- ✅ `public function allStatuses(): array`

---

### Domain\Transport\TransportRepository ✅ REVIEWED
File: `autoload/Domain/Transport/TransportRepository.php`
Properties:
- `private $db`
- `private const MAX_PER_PAGE = 100`

Public Methods:
- ✅ `public function __construct($db)`
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'name', string $sortDir = 'ASC', int $page = 1, int $perPage = 15): array`
- ✅ `public function find(int $transportId): ?array`
- ✅ `public function save(array $data): ?int`
- ✅ `public function allActive(): array`
- ✅ `public function findActiveById(int $transportId): ?array`
- ✅ `public function getApiloCarrierAccountId(int $transportId): ?int`
- ✅ `public function getTransportCost(int $transportId): ?float`
- ✅ `public function lowestTransportPrice(int $wp): ?float`
- ✅ `public function allForAdmin(): array`
- ✅ `public function transportMethodsFront($basket, $coupon): array`
- ✅ `public function transportCostCached($transportId)` — cached (Redis)
- ✅ `public function findActiveByIdCached($transportId)` — cached (Redis)
- ✅ `public function forPaymentMethod(int $paymentMethodId): array`

Private Methods:
- ✅ `private function savePaymentMethodLinks(int $transportId, $paymentMethods): void`
- ✅ `private function normalizeTransport(array $transport): array`
- ✅ `private function toSwitchValue($value): int`

---

### Domain\Update\UpdateRepository ✅ REVIEWED
File: `autoload/Domain/Update/UpdateRepository.php`
Properties:
- `private $db`

Methods:
- ✅ `public function __construct($db)`
- ✅ `public function update(): array`
- ✅ `public function runPendingMigrations(): void`
- ✅ `public function update0197(): void`
- ✅ `private function downloadAndApply(string $ver, string $dir, array $log): array`
- ✅ `private function executeSql(string $sqlUrl, array $log): array`
- ✅ `private function deleteFiles(string $filesUrl, array $log): array`
- ✅ `private function extractZip(string $fileName, array $log): array`
- ✅ `private function saveLog(array $log): void`

---

### Domain\User\UserRepository ✅ REVIEWED
File: `autoload/Domain/User/UserRepository.php`
Properties:
- `private $db`
- `private const MAX_PER_PAGE = 100`

Methods:
- ✅ `public function __construct($db)`
- ✅ `public function getById(int $userId): ?array`
- ✅ `public function updateById(int $userId, array $data): bool`
- ✅ `public function verifyTwofaCode(int $userId, string $code): bool`
- ✅ `public function sendTwofaCode(int $userId, bool $resend = false): bool`
- ✅ `public function delete(int $userId): bool`
- ✅ `public function find(int $userId): ?array`
- ✅ `public function save(int $userId, string $login, $status, string $password, string $passwordRepeat, $admin, $twofaEnabled = 0, string $twofaEmail = ''): array`
- ✅ `public function checkLogin(string $login, int $userId): array`
- ✅ `public function logon(string $login, string $password): int`
- ✅ `public function details(string $login): ?array`
- ✅ `public function listForAdmin(array $filters, string $sortColumn = 'login', string $sortDir = 'ASC', int $page = 1, int $perPage = 15): array`
- ✅ `private function toSwitchValue($value): int`

---

<a id="admin"></a>
## 2. admin/ — Warstwa administracyjna

### admin\App ✅ REVIEWED
File: `autoload/admin/App.php`
Properties:
- `private static array $newControllers`

Constants:
- `const APP_SECRET_KEY = 'c3cb2537d25c0efc9e573d059d79c3b8'`

Methods:
- ✅ `public static function finalize_admin_login(array $user, string $domain, string $cookie_name, bool $remember = false)`
- 🔧 `public static function special_actions()` — null guard po details() w logowaniu i 2FA
- ✅ `public static function render(): string`
- ✅ `public static function route()`
- ✅ `private static function createController(string $moduleName)`
- ✅ `private static function getControllerFactories(): array`
- ✅ `public static function update()`

---

### admin\Controllers\ArticlesArchiveController ✅ REVIEWED
File: `autoload/admin/Controllers/ArticlesArchiveController.php`
Properties:
- `private ArticleRepository $repository`

Methods:
- ✅ `public function __construct(ArticleRepository $repository)`
- ✅ `public function list(): string`
- ✅ `public function view_list(): string`
- ✅ `public function restore(): void`
- ✅ `public function article_restore(): void`
- ✅ `public function delete(): void`
- ✅ `public function article_delete(): void`

---

### admin\Controllers\ArticlesController ✅ REVIEWED
File: `autoload/admin/Controllers/ArticlesController.php`
Properties:
- `private ArticleRepository $repository`
- `private LanguagesRepository $languagesRepository`
- `private LayoutsRepository $layoutsRepository`
- `private PagesRepository $pagesRepository`

Methods:
- ✅ `public function __construct(ArticleRepository $repository, LanguagesRepository $languagesRepository, LayoutsRepository $layoutsRepository, PagesRepository $pagesRepository)`
- ✅ `public function list(): string`
- ✅ `public function galleryOrderSave(): void`
- ✅ `public function filesOrderSave(): void`
- ✅ `public function save(): void`
- ✅ `public function imageAltChange(): void`
- ✅ `public function fileNameChange(): void`
- ✅ `public function imageDelete(): void`
- ✅ `public function fileDelete(): void`
- ✅ `public function delete(): void`
- ✅ `public function edit(): string`
- ✅ `private function resolveSavePayload(): array`
- ✅ `private function buildFormViewModel(array $article, array $languages, array $menus, array $layouts): FormEditViewModel`
- ✅ `private function renderPagesTree(array $menus, array $article): string`
- ✅ `private function renderImagesBox(array $article): string`
- ✅ `private function renderFilesBox(array $article): string`
- ✅ `private function escapeHtml(string $value): string`

---

### admin\Controllers\BannerController ✅ REVIEWED
File: `autoload/admin/Controllers/BannerController.php`
Properties:
- `private BannerRepository $repository`
- `private LanguagesRepository $languagesRepository`
- `private FormRequestHandler $formHandler`

Methods:
- ✅ `public function __construct(BannerRepository $repository, LanguagesRepository $languagesRepository)`
- ✅ `public function list(): string`
- 🔧 `public function edit(): string` — null guard: find() ?: []
- 🔧 `public function save(): void` — null guard: find() ?: []
- ✅ `public function delete(): void`
- ✅ `private function buildFormViewModel(array $banner, array $languages, ?array $errors = null): FormEditViewModel`
- ✅ `private function getFormId(): string`

---

### admin\Controllers\DashboardController ✅ REVIEWED
File: `autoload/admin/Controllers/DashboardController.php`
Properties:
- `private DashboardRepository $repository`
- `private ShopStatusRepository $statusesRepository`

Methods:
- ✅ `public function __construct(DashboardRepository $repository, ShopStatusRepository $statusesRepository)`
- ✅ `public function main_view(): string`

---

### admin\Controllers\DictionariesController ✅ REVIEWED
File: `autoload/admin/Controllers/DictionariesController.php`
Properties:
- `private DictionariesRepository $repository`
- `private LanguagesRepository $languagesRepository`
- `private FormRequestHandler $formHandler`

Methods:
- ✅ `public function __construct(DictionariesRepository $repository, LanguagesRepository $languagesRepository)`
- ✅ `public function list(): string`
- ✅ `public function edit(): string`
- ✅ `public function save(): void`
- ✅ `public function delete(): void`
- ✅ `private function buildFormViewModel(array $unit, array $languages, ?array $errors = null): FormEditViewModel`
- ✅ `private function getFormId(): string`

---

### admin\Controllers\FilemanagerController ✅ REVIEWED
File: `autoload/admin/Controllers/FilemanagerController.php`
Properties: (brak)

Constants:
- `private const RFM_KEY_TTL = 1200`
- `private const FILEMANAGER_DIALOG_PATH = '/libraries/filemanager-9.14.2/dialog.php'`

Methods:
- ✅ `public function draw(): string`
- ✅ `private function ensureFilemanagerAccessKey(): string`
- ✅ `private function buildFilemanagerUrl(string $akey): string`

---

### admin\Controllers\IntegrationsController ✅ REVIEWED
File: `autoload/admin/Controllers/IntegrationsController.php`
Properties:
- `private IntegrationsRepository $repository`

Methods:
- ✅ `public function __construct(IntegrationsRepository $repository)`
- ✅ `public function apilo_settings(): string`
- ✅ `public function apilo_settings_save(): void`
- ✅ `public function apilo_authorization(): void`
- ✅ `public function get_platform_list(): void`
- ✅ `public function get_status_types_list(): void`
- ✅ `public function get_carrier_account_list(): void`
- ✅ `public function get_payment_types_list(): void`
- ✅ `public function apilo_create_product(): void`
- ✅ `public function apilo_product_search(): void`
- ✅ `public function apilo_product_select_save(): void`
- ✅ `public function apilo_product_select_delete(): void`
- ✅ `public function shoppro_settings(): string`
- ✅ `public function shoppro_settings_save(): void`
- ✅ `public function shoppro_product_import(): void`
- ✅ `private function fetchApiloListWithFeedback(string $type, string $label): void`

---

### admin\Controllers\LanguagesController ✅ REVIEWED
File: `autoload/admin/Controllers/LanguagesController.php`
Properties:
- `private LanguagesRepository $repository`
- `private FormRequestHandler $formHandler`

Methods:
- ✅ `public function __construct(LanguagesRepository $repository)`
- ✅ `public function list(): string`
- ✅ `public function view_list(): string`
- ✅ `public function language_edit(): string`
- ✅ `public function language_save(): void`
- ✅ `public function language_delete(): void`
- ✅ `public function translation_list(): string`
- ✅ `public function translation_edit(): string`
- ✅ `public function translation_save(): void`
- ✅ `public function translation_delete(): void`
- ✅ `private function buildLanguageFormViewModel(array $language, int $maxOrder, ?array $errors = null): FormEditViewModel`
- ✅ `private function buildTranslationFormViewModel(array $translation, array $languages, ?array $errors = null): FormEditViewModel`
- ✅ `private function extractLegacyTranslations(array $values, array $languages): array`
- ✅ `private function clearLanguageSessions(array $languages): void`
- ✅ `private function getLanguageFormId(): string`
- ✅ `private function getTranslationFormId(): string`

---

### admin\Controllers\LayoutsController ✅ REVIEWED
File: `autoload/admin/Controllers/LayoutsController.php`
Properties:
- `private LayoutsRepository $repository`
- `private LanguagesRepository $languagesRepository`

Methods:
- ✅ `public function __construct(LayoutsRepository $repository, LanguagesRepository $languagesRepository)`
- ✅ `public function list(): string`
- ✅ `public function edit(): string`
- ✅ `public function save(): void`
- ✅ `public function delete(): void`

---

### admin\Controllers\NewsletterController ✅ REVIEWED
File: `autoload/admin/Controllers/NewsletterController.php`
Properties:
- `private NewsletterRepository $repository`
- `private NewsletterPreviewRenderer $previewRenderer`
- `private FormRequestHandler $formHandler`

Methods:
- ✅ `public function __construct(NewsletterRepository $repository, NewsletterPreviewRenderer $previewRenderer)`
- ✅ `public function list(): string`
- ✅ `public function view_list(): string`
- ✅ `public function emails_list(): string`
- ✅ `public function email_delete(): void`
- ✅ `public function delete(): void`
- ✅ `public function prepare(): string`
- ✅ `public function preview(): string`
- ✅ `public function send(): void`
- ✅ `public function settings(): string`
- ✅ `public function settings_save(): void`
- ✅ `public function email_templates_user(): string`
- ✅ `public function email_templates_admin(): string`
- ✅ `public function email_template_edit(): string`
- ✅ `public function template_save(): void`
- ✅ `public function email_template_delete(): void`
- ✅ `private function buildSettingsFormViewModel(array $settings, ?array $errors = null): FormEditViewModel`
- ✅ `private function buildTemplateFormViewModel(array $template, ?array $errors = null): FormEditViewModel`
- ✅ `private function templatesListViewModel(): PaginatedTableViewModel`
- ✅ `private function settingsFormId(): string`
- ✅ `private function templateFormId(int $templateId): string`

---

### admin\Controllers\PagesController ✅ REVIEWED
File: `autoload/admin/Controllers/PagesController.php`
Properties:
- `private PagesRepository $repository`
- `private LanguagesRepository $languagesRepository`
- `private LayoutsRepository $layoutsRepository`

Methods:
- ✅ `public function __construct(PagesRepository $repository, LanguagesRepository $languagesRepository, LayoutsRepository $layoutsRepository)`
- ✅ `public function list(): string`
- ✅ `public function browseList(): string`
- ✅ `public function pagesUrlBrowser(): string`
- 🔧 `public function menuEdit(): string` — null guard: menuDetails() ?: []
- ✅ `public function menuSave(): void`
- ✅ `private function buildMenuFormViewModel(array $menu): FormEditViewModel`
- ✅ `public function menuDelete(): void`
- 🔧 `public function edit(): string` — null guard: pageDetails() ?: []
- ✅ `public function save(): void`
- ✅ `private function buildPageFormViewModel(array $page, int $parentId, int $menuId, array $menus, array $layouts, array $languages): FormEditViewModel`
- ✅ `public function delete(): void`
- ✅ `public function pageArticles(): string`
- ✅ `public function savePagesOrder(): void`
- ✅ `public function saveArticlesOrder(): void`
- ✅ `public function generateSeoLink(): void`
- ✅ `public function cookieMenus(): void`
- ✅ `public function cookiePages(): void`
- ✅ `private function withPreviewUrls(array $pages, string $defaultLanguage): array`
- ✅ `private function cookieState(string $cookieName): array`

---

### admin\Controllers\ProductArchiveController ✅ REVIEWED
File: `autoload/admin/Controllers/ProductArchiveController.php`
Properties:
- `private ProductRepository $productRepository`

Methods:
- ✅ `public function __construct(ProductRepository $productRepository)`
- 🔧 `public function list(): string` — fix: $this->repository → $this->productRepository
- ✅ `public function unarchive(): void`

---

### admin\Controllers\ScontainersController ✅ REVIEWED
File: `autoload/admin/Controllers/ScontainersController.php`
Properties:
- `private ScontainersRepository $repository`
- `private LanguagesRepository $languagesRepository`
- `private FormRequestHandler $formHandler`

Methods:
- ✅ `public function __construct(ScontainersRepository $repository, LanguagesRepository $languagesRepository)`
- ✅ `public function list(): string`
- ✅ `public function view_list(): string`
- 🔧 `public function edit(): string` — null guard: find() ?: []
- ✅ `public function container_edit(): string`
- 🔧 `public function save(): void` — null guard: find() ?: []
- ✅ `public function container_save(): void`
- ✅ `public function delete(): void`
- ✅ `public function container_delete(): void`
- ✅ `private function buildFormViewModel(array $container, array $languages, ?array $errors = null): FormEditViewModel`
- ✅ `private function formId(): string`

---

### admin\Controllers\SettingsController ✅ REVIEWED
File: `autoload/admin/Controllers/SettingsController.php`
Properties:
- `private SettingsRepository $settingsRepository`
- `private LanguagesRepository $languagesRepository`
- `private FormRequestHandler $formHandler`

Methods:
- ✅ `public function __construct(SettingsRepository $settingsRepository, LanguagesRepository $languagesRepository)`
- ✅ `public function clearCache(): void`
- ✅ `public function clearCacheAjax(): void`
- ✅ `public function globalSearchAjax(): void`
- ✅ `public function save(): void`
- ✅ `public function view(): string`
- ✅ `private function buildFormViewModel(array $settings, array $languages, ?array $errors = null): FormEditViewModel`
- ✅ `private function getFormId(): string`
- ✅ `private function transformSettingsToFormData(array $settings, array $languages): array`
- ✅ `private function transformFormDataToSettings(array $data): array`

---

### admin\Controllers\ShopAttributeController ✅ REVIEWED
File: `autoload/admin/Controllers/ShopAttributeController.php`
Properties:
- `private AttributeRepository $repository`
- `private LanguagesRepository $languagesRepository`

Methods:
- ✅ `public function __construct(AttributeRepository $repository, LanguagesRepository $languagesRepository)`
- ✅ `public function list(): string`
- 🔧 `public function edit(): string` — null guard: findAttribute() ?: []
- ✅ `public function save(): void`
- ✅ `public function delete(): void`
- ✅ `public function values(): string`
- ✅ `public function values_save(): void`
- ✅ `public function value_row_tpl(): void`
- ✅ `private function validateValuesRows(array $rows, string $defaultLanguageId): array`
- ✅ `private function buildFormViewModel(array $attribute, array $languages): FormEditViewModel`

---

### admin\Controllers\ShopCategoryController ✅ REVIEWED
File: `autoload/admin/Controllers/ShopCategoryController.php`
Properties:
- `private CategoryRepository $repository`
- `private LanguagesRepository $languagesRepository`

Methods:
- ✅ `public function __construct(CategoryRepository $repository, LanguagesRepository $languagesRepository)`
- ✅ `public function view_list(): string`
- ✅ `public function list(): string`
- ✅ `public function category_edit(): string`
- ✅ `public function edit(): string`
- ✅ `public function save(): void`
- ✅ `public function category_delete(): void`
- ✅ `public function delete(): void`
- ✅ `public function category_products(): string`
- ✅ `public function products(): string`
- ✅ `public function category_url_browser(): void`
- ✅ `public function save_categories_order(): void`
- ✅ `public function save_products_order(): void`
- ✅ `public function cookie_categories(): void`

---

### admin\Controllers\ShopClientsController ✅ REVIEWED
File: `autoload/admin/Controllers/ShopClientsController.php`
Properties:
- `private ClientRepository $repository`

Methods:
- ✅ `public function __construct(ClientRepository $repository)`
- ✅ `public function list(): string`
- ✅ `public function view_list(): string`
- ✅ `public function details(): string`
- ✅ `public function clients_details(): string`

---

### admin\Controllers\ShopCouponController ✅ REVIEWED
File: `autoload/admin/Controllers/ShopCouponController.php`
Properties:
- `private CouponRepository $repository`

Methods:
- ✅ `public function __construct(CouponRepository $repository)`
- ✅ `public function list(): string`
- ✅ `public function view_list(): string`
- 🔧 `public function edit(): string` — null guard: find() ?: []
- ✅ `public function coupon_edit(): string`
- ✅ `public function save(): void`
- ✅ `public function coupon_save(): void`
- ✅ `public function delete(): void`
- ✅ `public function coupon_delete(): void`
- ✅ `private function buildFormViewModel(array $coupon, array $categories): FormEditViewModel`

---

### admin\Controllers\ShopOrderController ✅ REVIEWED
File: `autoload/admin/Controllers/ShopOrderController.php`
Properties:
- `private OrderAdminService $service`

Methods:
- ✅ `public function __construct(OrderAdminService $service)`
- ✅ `public function list(): string`
- ✅ `public function view_list(): string`
- ✅ `public function details(): string`
- ✅ `public function order_details(): string`
- ✅ `public function edit(): string`
- ✅ `public function order_edit(): string`
- ✅ `public function save(): void`
- ✅ `public function order_save(): void`
- ✅ `public function notes_save(): void`
- ✅ `public function order_status_change(): void`
- ✅ `public function order_resend_confirmation_email(): void`
- ✅ `public function set_order_as_unpaid(): void`
- ✅ `public function set_order_as_paid(): void`
- ✅ `public function send_order_to_apilo(): void`
- ✅ `public function toggle_trustmate_send(): void`
- ✅ `public function delete(): void`
- ✅ `public function order_delete(): void`
- ✅ `private function formatDateTime(string $value): string`

---

### admin\Controllers\ShopPaymentMethodController ✅ REVIEWED
File: `autoload/admin/Controllers/ShopPaymentMethodController.php`
Properties:
- `private PaymentMethodRepository $repository`

Methods:
- ✅ `public function __construct(PaymentMethodRepository $repository)`
- ✅ `public function list(): string`
- ✅ `public function edit(): string`
- ✅ `public function save(): void`
- ✅ `private function buildFormViewModel(array $paymentMethod, array $apiloPaymentTypes): FormEditViewModel`
- ✅ `private function getApiloPaymentTypes(): array`

---

### admin\Controllers\ShopProducerController ✅ REVIEWED
File: `autoload/admin/Controllers/ShopProducerController.php`
Properties:
- `private ProducerRepository $repository`
- `private LanguagesRepository $languagesRepository`
- `private FormRequestHandler $formHandler`

Methods:
- ✅ `public function __construct(ProducerRepository $repository, LanguagesRepository $languagesRepository)`
- ✅ `public function list(): string`
- ✅ `public function view_list(): string`
- 🔧 `public function edit(): string` — null guard: find() ?: []
- ✅ `public function producer_edit(): string`
- 🔧 `public function save(): void` — null guard: find() ?: []
- ✅ `public function producer_save(): void`
- ✅ `public function delete(): void`
- ✅ `public function producer_delete(): void`
- ✅ `private function buildFormViewModel(array $producer, array $languages, ?array $errors = null): FormEditViewModel`
- ✅ `private function formId(): string`
- ✅ `private function toSwitchValue($value): int`

---

### admin\Controllers\ShopProductController ✅ REVIEWED
File: `autoload/admin/Controllers/ShopProductController.php`
Properties:
- `private ProductRepository $repository`
- `private IntegrationsRepository $integrationsRepository`
- `private LanguagesRepository $languagesRepository`

Methods:
- ✅ `public function __construct(ProductRepository $repository, IntegrationsRepository $integrationsRepository, LanguagesRepository $languagesRepository)`
- ✅ `public function view_list(): string`
- 🔧 `public function product_edit(): string` — null safety: findForAdmin() ?: []; redundancja: użyto $this->languagesRepository zamiast new LanguagesRepository
- ✅ `private function layoutsForProductEdit($db): array`
- ✅ `private function buildProductFormViewModel(array $product, array $languages, array $categories, array $layouts, array $products, array $sets, array $producers, array $units, $dlang): FormEditViewModel`
- ✅ `private function renderSkuField(array $product): string`
- ✅ `private function renderCategoriesTree(array $categories, array $product, $dlang): string`
- ✅ `private function renderGalleryBox(array $product): string`
- ✅ `private function renderFilesBox(array $product): string`
- ✅ `private function renderRelatedProducts(array $product, array $products, array $sets): string`
- ✅ `private function renderCustomFieldsBox(array $product): string`
- ✅ `private function escapeHtml(string $value): string`
- ✅ `private function resolveSavePayload(): array`
- ✅ `public function save(): void`
- ✅ `public function duplicate_product(): void`
- ✅ `public function product_archive(): void`
- ✅ `public function product_unarchive(): void`
- ✅ `public function product_delete(): void`
- ✅ `public function change_product_status(): void`
- ✅ `public function product_change_price_brutto(): void`
- ✅ `public function product_change_price_brutto_promo(): void`
- ✅ `public function product_change_custom_label(): void`
- ✅ `public function product_custom_label_suggestions(): void`
- ✅ `public function product_custom_label_save(): void`
- 🔧 `public function ajax_product_url(): void` — redundancja: użyto $this->repository zamiast new ProductRepository
- 🔧 `public function generate_sku_code(): void` — redundancja: użyto $this->repository zamiast new ProductRepository
- ✅ `public function product_combination(): string`
- ✅ `public function generate_combination(): void`
- ✅ `public function delete_combination(): void`
- ✅ `public function product_combination_stock_0_buy_save(): void`
- ✅ `public function product_combination_sku_save(): void`
- ✅ `public function product_combination_quantity_save(): void`
- ✅ `public function product_combination_price_save(): void`
- ✅ `public function delete_combination_ajax(): void`
- ✅ `public function image_delete(): void`
- ✅ `public function images_order_save(): void`
- ✅ `public function image_alt_change(): void`
- ✅ `public function product_file_delete(): void`
- ✅ `public function product_file_name_change(): void`
- ✅ `public function product_image_delete(): void`
- ✅ `public function mass_edit(): string`
- ✅ `public function mass_edit_save(): void`
- ✅ `public function get_products_by_category(): void`

---

### admin\Controllers\ShopProductSetsController ✅ REVIEWED
File: `autoload/admin/Controllers/ShopProductSetsController.php`
Properties:
- `private ProductSetRepository $repository`

Methods:
- ✅ `public function __construct(ProductSetRepository $repository)`
- ✅ `public function list(): string`
- ✅ `public function view_list(): string`
- 🔧 `public function edit(): string` — null safety: find() ?: []
- ✅ `public function set_edit(): string`
- ✅ `public function save(): void`
- ✅ `public function delete(): void`
- ✅ `public function set_delete(): void`
- ✅ `private function buildFormViewModel(array $set, array $products = []): FormEditViewModel`
- ✅ `private function toSwitchValue($value): int`
- ✅ `private function renderProductsSelect(array $products, array $selectedProducts): string`

---

### admin\Controllers\ShopPromotionController ✅ REVIEWED
File: `autoload/admin/Controllers/ShopPromotionController.php`
Properties:
- `private PromotionRepository $repository`

Methods:
- ✅ `public function __construct(PromotionRepository $repository)`
- ✅ `public function list(): string`
- 🔧 `public function edit(): string` — null safety: find() ?: []
- ✅ `public function save(): void`
- ✅ `public function delete(): void`
- ✅ `private function buildFormViewModel(array $promotion, array $categories): FormEditViewModel`

---

### admin\Controllers\ShopStatusesController ✅ REVIEWED
File: `autoload/admin/Controllers/ShopStatusesController.php`
Properties:
- `private ShopStatusRepository $repository`

Methods:
- ✅ `public function __construct(ShopStatusRepository $repository)`
- ✅ `public function list(): string`
- ✅ `public function edit(): string`
- ✅ `public function save(): void`
- ✅ `private function buildFormViewModel(array $status, array $apiloStatusList): FormEditViewModel`
- ✅ `private function getApiloStatusList(): array`

---

### admin\Controllers\ShopTransportController ✅ REVIEWED
File: `autoload/admin/Controllers/ShopTransportController.php`
Properties:
- `private TransportRepository $transportRepository`
- `private PaymentMethodRepository $paymentMethodRepository`

Methods:
- ✅ `public function __construct(TransportRepository $transportRepository, PaymentMethodRepository $paymentMethodRepository)`
- ✅ `public function list(): string`
- ✅ `public function edit(): string`
- ✅ `public function save(): void`
- ✅ `private function buildFormViewModel(array $transport, array $paymentMethods, array $apiloCarrierAccounts): FormEditViewModel`
- ✅ `private function getApiloCarrierAccounts(): array`

---

### admin\Controllers\UpdateController ✅ REVIEWED
File: `autoload/admin/Controllers/UpdateController.php`
Properties:
- `private UpdateRepository $repository`

Methods:
- ✅ `public function __construct(UpdateRepository $repository)`
- ✅ `public function main_view(): string`
- ✅ `public function update(): void`
- ✅ `public function updateAll(): void`

---

### admin\Controllers\UsersController ✅ REVIEWED
File: `autoload/admin/Controllers/UsersController.php`
Properties:
- `private UserRepository $repository`
- `private FormRequestHandler $formHandler`

Methods:
- ✅ `public function __construct(UserRepository $repository)`
- ✅ `public function user_delete(): void`
- ✅ `public function user_save(): void`
- ✅ `public function user_edit(): string`
- ✅ `public function view_list(): string`
- ✅ `public function list(): string`
- ✅ `public function login_form(): string`
- ✅ `public function twofa(): string`
- ✅ `private function normalizeUser(?array $user): array`
- ✅ `private function buildFormViewModel(array $user, ?array $errors = null): FormEditViewModel`
- ✅ `private function getFormId(): string`
- ✅ `private function isTwofaEmailValidForEnabled($twofaEnabled, string $twofaEmail): bool`

---

### admin\Support\TableListRequestFactory ✅ REVIEWED
File: `autoload/admin/Support/class.TableListRequestFactory.php`
Properties: (brak)

Constants:
- `public const DEFAULT_PER_PAGE_OPTIONS = [5, 10, 15, 25, 50, 100]`
- `public const DEFAULT_PER_PAGE = 15`

Methods:
- ✅ `public static function fromRequest(array $filterDefinitions, array $sortableColumns, string $defaultSortColumn = 'date_add', ?array $perPageOptions = null, ?int $defaultPerPage = null): array`

---

### admin\Support\Forms\FormFieldRenderer ✅ REVIEWED
File: `autoload/admin/Support/Forms/FormFieldRenderer.php`
Properties:
- `private FormEditViewModel $form`

Methods:
- ✅ `public function __construct(FormEditViewModel $form)`
- ✅ `public function renderField(FormField $field): string`
- ✅ `public function renderText(FormField $field): string`
- ✅ `public function renderNumber(FormField $field): string`
- ✅ `public function renderEmail(FormField $field): string`
- ✅ `public function renderPassword(FormField $field): string`
- ✅ `public function renderDate(FormField $field): string`
- ✅ `public function renderDatetime(FormField $field): string`
- ✅ `public function renderSwitch(FormField $field): string`
- ✅ `public function renderSelect(FormField $field): string`
- ✅ `public function renderTextarea(FormField $field): string`
- ✅ `public function renderEditor(FormField $field): string`
- ✅ `public function renderImage(FormField $field): string`
- ✅ `public function renderFile(FormField $field): string`
- ✅ `public function renderHidden(FormField $field): string`
- ✅ `public function renderColor(FormField $field): string`
- ✅ `public function renderCustom(FormField $field): string`
- ✅ `public function renderLangSection(FormField $section): string`
- ✅ `private function renderLangField(FormField $field, $languageId, string $sectionName): string`
- ✅ `private function generateFilemanagerUrl(string $fieldId): string`
- ✅ `private function wrapWithError(string $html, ?string $error): string`

---

### admin\Support\Forms\FormRequestHandler ✅ REVIEWED
File: `autoload/admin/Support/Forms/FormRequestHandler.php`
Properties:
- `private FormValidator $validator`

Methods:
- ✅ `public function __construct()`
- ✅ `public function handleSubmit(FormEditViewModel $formViewModel, array $postData): array`
- ✅ `private function processData(array $postData, array $fields): array`
- ✅ `private function processLangSection(array $postData, $section): array`
- ✅ `public function restoreFromPersist(FormEditViewModel $formViewModel): ?array`
- ✅ `public function isFormSubmit(string $formId): bool`

---

### admin\Validation\FormValidator ✅ REVIEWED
File: `autoload/admin/Validation/FormValidator.php`
Properties:
- `private array $errors`

Methods:
- ✅ `public function validate(array $data, array $fields, ?array $languages = null): array`
- ✅ `private function validateField(array $data, FormField $field): void`
- ✅ `private function validateLangSection(array $data, FormField $section, array $languages): void`
- ✅ `private function isEmpty($value): bool`
- ✅ `private function isValidDate(string $date): bool`
- ✅ `private function isValidDateTime(string $datetime): bool`
- ✅ `public function isValid(): bool`
- ✅ `public function getErrors(): array`
- ✅ `public function getFirstError(): ?string`

---

### admin\ViewModels\Common\PaginatedTableViewModel ✅ REVIEWED
File: `autoload/admin/ViewModels/Common/class.PaginatedTableViewModel.php`
Properties:
- `public array $columns`
- `public array $rows`
- `public array $filters`
- `public array $sort`
- `public array $pagination`
- `public array $query`
- `public array $perPageOptions`
- `public array $sortableColumns`
- `public string $basePath`
- `public string $emptyMessage`
- `public ?string $createUrl`
- `public ?string $createLabel`
- `public ?string $customScriptView`

Methods:
- ✅ `public function __construct(array $columns = [], array $rows = [], array $filters = [], array $sort = [], array $pagination = [], array $query = [], array $perPageOptions = [5, 10, 15, 25, 50, 100], array $sortableColumns = [], string $basePath = '', string $emptyMessage = 'Brak danych.', ?string $createUrl = null, ?string $createLabel = null, ?string $customScriptView = null)`

---

### admin\ViewModels\Forms\FormAction ✅ REVIEWED
File: `autoload/admin/ViewModels/Forms/FormAction.php`
Properties:
- `public string $name`
- `public string $label`
- `public string $type`
- `public string $url`
- `public ?string $backUrl`
- `public string $cssClass`
- `public array $attributes`

Methods:
- ✅ `public function __construct(string $name, string $label, string $url = '', ?string $backUrl = null, string $cssClass = 'btn btn-primary', string $type = 'submit', array $attributes = [])`
- ✅ `public static function save(string $url, string $backUrl = '', string $label = 'Zapisz'): self`
- ✅ `public static function cancel(string $backUrl, string $label = 'Anuluj'): self`

---

### admin\ViewModels\Forms\FormEditViewModel ✅ REVIEWED
File: `autoload/admin/ViewModels/Forms/FormEditViewModel.php`
Properties:
- `public string $formId`
- `public string $title`
- `public string $method`
- `public string $action`
- `public ?string $backUrl`
- `public array $tabs`
- `public array $fields`
- `public array $hiddenFields`
- `public array $actions`
- `public bool $persist`
- `public array $data`
- `public ?array $validationErrors`
- `public ?array $languages`

Methods:
- ✅ `public function __construct(string $formId, string $title, array $data = [], array $fields = [], array $tabs = [], array $actions = [], string $method = 'POST', string $action = '', ?string $backUrl = null, bool $persist = true, array $hiddenFields = [], ?array $languages = null, ?array $validationErrors = null)`
- ✅ `public function hasTabs(): bool`
- ✅ `public function hasLangSections(): bool`
- ✅ `public function getFieldsForTab(string $tabId): array`
- ✅ `public function getLangSectionsForTab(string $tabId): array`
- ✅ `public function getFieldValue(FormField $field, $languageId = null, ?string $langFieldName = null)`
- ✅ `public function hasError(string $fieldName, $languageId = null): bool`
- ✅ `public function getError(string $fieldName, $languageId = null): ?string`
- ✅ `public function clearPersist(): void`
- ✅ `public function saveToPersist(array $data): void`

---

### admin\ViewModels\Forms\FormField ✅ REVIEWED
File: `autoload/admin/ViewModels/Forms/FormField.php`
Properties:
- `public string $name`
- `public string $type`
- `public string $label`
- `public $value`
- `public string $tabId`
- `public bool $required`
- `public array $attributes`
- `public array $options`
- `public ?string $helpText`
- `public ?string $placeholder`
- `public ?string $id`
- `public bool $useFilemanager`
- `public ?string $filemanagerUrl`
- `public string $editorToolbar`
- `public int $editorHeight`
- `public ?array $langFields`
- `public ?string $langSectionParentTab`
- `public ?string $customHtml`

Methods:
- ✅ `public function __construct(string $name, string $type = FormFieldType::TEXT, string $label = '', $value = null, string $tabId = 'default', bool $required = false, array $attributes = [], array $options = [], ?string $helpText = null, ?string $placeholder = null, bool $useFilemanager = false, ?string $filemanagerUrl = null, string $editorToolbar = 'MyTool', int $editorHeight = 300, ?array $langFields = null, ?string $langSectionParentTab = null, ?string $customHtml = null)`
- ✅ `public static function text(string $name, array $config = []): self`
- ✅ `public static function number(string $name, array $config = []): self`
- ✅ `public static function email(string $name, array $config = []): self`
- ✅ `public static function password(string $name, array $config = []): self`
- ✅ `public static function date(string $name, array $config = []): self`
- ✅ `public static function datetime(string $name, array $config = []): self`
- ✅ `public static function switch(string $name, array $config = []): self`
- ✅ `public static function select(string $name, array $config = []): self`
- ✅ `public static function textarea(string $name, array $config = []): self`
- ✅ `public static function editor(string $name, array $config = []): self`
- ✅ `public static function image(string $name, array $config = []): self`
- ✅ `public static function file(string $name, array $config = []): self`
- ✅ `public static function color(string $name, array $config = []): self`
- ✅ `public static function hidden(string $name, $value = null): self`
- ✅ `public static function custom(string $name, string $html, array $config = []): self`
- ✅ `public static function langSection(string $name, string $parentTab, array $fields): self`
- ✅ `public function getLocalizedName($languageId): string`
- ✅ `public function getLocalizedId($languageId): string`

---

### admin\ViewModels\Forms\FormFieldType ✅ REVIEWED
File: `autoload/admin/ViewModels/Forms/FormFieldType.php`
Properties: (brak)

Constants:
- `public const TEXT = 'text'`
- `public const NUMBER = 'number'`
- `public const EMAIL = 'email'`
- `public const PASSWORD = 'password'`
- `public const DATE = 'date'`
- `public const DATETIME = 'datetime'`
- `public const SWITCH = 'switch'`
- `public const SELECT = 'select'`
- `public const TEXTAREA = 'textarea'`
- `public const EDITOR = 'editor'`
- `public const IMAGE = 'image'`
- `public const FILE = 'file'`
- `public const HIDDEN = 'hidden'`
- `public const LANG_SECTION = 'lang_section'`
- `public const CUSTOM = 'custom'`
- `public const COLOR = 'color'`

Methods: (brak — klasa ze stałymi)

---

### admin\ViewModels\Forms\FormTab ✅ REVIEWED
File: `autoload/admin/ViewModels/Forms/FormTab.php`
Properties:
- `public string $id`
- `public string $label`
- `public string $icon`
- `public ?string $parentTabId`

Methods:
- ✅ `public function __construct(string $id, string $label, string $icon = '', ?string $parentTabId = null)`

---

<a id="front"></a>
## 3. front/ — Warstwa frontendowa

### front\App ✅ REVIEWED
File: `autoload/front/App.php`
Properties: (brak)

Methods:
- ✅ `static public function pageTitle()`
- ✅ `static public function title()`
- ✅ `public static function route($product = '', $category = '')`
- ✅ `public static function checkUrlParams()`
- ✅ `public static function getControllerFactories()`

---

### front\LayoutEngine ✅ REVIEWED
File: `autoload/front/LayoutEngine.php`
Properties (regex constants):
- `const menu_pattern = '/MENU:[0-9]*/'`
- `const menu_main_pattern = '/MENU_GLOWNE:[0-9]*/'`
- `const container_pattern = '/KONTENER:[0-9]*/'`
- `const language_pattern = '/LANG:[a-zA-Z0-9_-]*/'`
- `const products_promoted = '/PROMOWANE_PRODUKTY((:([0-9]*))?)/`
- `const news_pattern = '/AKTUALNOSCI:([0-9]*)((:([0-9]*))?)/`
- `const article_products_category_pattern = '/PRODUKTY_KATEGORIA:([0-9]*)((:([0-9]*))?)/`
- `const news_list_pattern = '/AKTUALNOSCI_LISTA:([0-9]*)((:([0-9]*))?)/`
- `const top_news_pattern = '/NAJPOULARNIEJSZE_ARTYKULY:([0-9]*)((:([0-9]*))?)/`
- `const single_product_pattern = '/PRODUKT:[0-9]*/'`
- `const products_box = '/PRODUKTY_BOX:[0-9,]*/'`
- `const produkty_top = '/PRODUKTY_TOP((:([0-9]*))?)/`
- `const produkty_new = '/PRODUKTY_NEW((:([0-9]*))?)/`

Methods:
- 🔧 `public static function show()` — fix: `$level` → `null` (l.68, undefined variable); `$_GET['permutation_hash']` → `?? null` (l.196)
- ✅ `public static function facebook($facebook_link)`
- ✅ `static public function title($title, $show_title, $page_title)`
- ✅ `public static function alert()`
- ✅ `public static function copyright()`
- ✅ `public static function contact()`
- ✅ `public static function cookieInformation()`

---

### front\Controllers\NewsletterController ✅ REVIEWED
File: `autoload/front/Controllers/NewsletterController.php`
Properties:
- `private NewsletterRepository $repository`

Methods:
- ✅ `public function __construct(NewsletterRepository $repository)`
- ✅ `public function signin()`
- ✅ `public function confirm()`
- ✅ `public function unsubscribe()`

---

### front\Controllers\SearchController ✅ REVIEWED
File: `autoload/front/Controllers/SearchController.php`
Properties: (brak)

Methods:
- ✅ `public function searchResults()`
- ✅ `public function searchProducts()`

---

### front\Controllers\ShopBasketController ✅ REVIEWED
File: `autoload/front/Controllers/ShopBasketController.php`
Properties:
- `public static $title = ['mainView' => 'Koszyk']`
- `private $orderRepository`
- `private $paymentMethodRepository`

Methods:
- ✅ `public function __construct(\Domain\Order\OrderRepository $orderRepository, \Domain\PaymentMethod\PaymentMethodRepository $paymentMethodRepository)`
- ✅ `public function basketMessageSave()`
- ✅ `public function basketRemoveProduct()`
- ✅ `public function basketIncreaseQuantityProduct()`
- ✅ `public function basketDecreaseQuantityProduct()`
- ✅ `public function basketChangeQuantityProduct()`
- ✅ `public function productMessageChange()`
- 🔧 `public function basketAddProduct()` — fix: dodano brakujące `global $lang_id` (l.119)
- ✅ `public function transportMethodInpostCheck()`
- ✅ `public function inpostCheck()`
- ✅ `public function orlenSave()`
- ✅ `public function inpostSave()`
- ✅ `public function basketPaymentMethodSet()`
- ✅ `public function basketTransportMethodSet()`
- ✅ `public function basketPaymentsMethods()`
- ✅ `public function summaryView()`
- ✅ `public function basketSave()`
- ✅ `public function mainView()`
- ✅ `private function jsonBasketResponse($basket, $coupon, $lang_id, $basket_transport_method_id)`

---

### front\Controllers\ShopClientController ✅ REVIEWED
File: `autoload/front/Controllers/ShopClientController.php`
Properties:
- `private $clientRepo`

Methods:
- ✅ `public function __construct(ClientRepository $clientRepo)`
- ✅ `public function markAddressAsCurrent()`
- ✅ `public function addressDelete()`
- ✅ `public function addressEdit()`
- ✅ `public function addressSave()`
- ✅ `public function clientAddresses()`
- ✅ `public function clientOrders()`
- ✅ `public function newPassword()`
- ✅ `public function sendEmailPasswordRecovery()`
- ✅ `public function recoverPassword()`
- ✅ `public function logout()`
- ✅ `public function login()`
- ✅ `public function confirm()`
- ✅ `public function signup()`
- ✅ `public function loginForm()`
- ✅ `public function registerForm()`
- ✅ `private function buildEmailBody(string $templateName, array $replacements = []): string`

---

### front\Controllers\ShopCouponController ✅ REVIEWED
File: `autoload/front/Controllers/ShopCouponController.php`
Properties:
- `private CouponRepository $repository`

Methods:
- ✅ `public function __construct(CouponRepository $repository)`
- ✅ `public function useCoupon()`
- ✅ `public function deleteCoupon()`

---

### front\Controllers\ShopOrderController ✅ REVIEWED
File: `autoload/front/Controllers/ShopOrderController.php`
Properties:
- `private $repository`
- `private $adminService`

Methods:
- ✅ `public function __construct(OrderRepository $repository, OrderAdminService $adminService)`
- ✅ `public function paymentConfirmation()`
- ✅ `public function paymentStatusTpay()`
- ✅ `public function paymentStatusPrzelewy24pl()`
- ✅ `public function paymentStatusHotpay()`
- ✅ `public function orderDetails()`

---

### front\Controllers\ShopProducerController ✅ REVIEWED
File: `autoload/front/Controllers/ShopProducerController.php`
Properties:
- `private ProducerRepository $repository`

Methods:
- ✅ `public function __construct(ProducerRepository $repository)`
- ✅ `public function products()`
- ✅ `public function list()`

---

### front\Controllers\ShopProductController ✅ REVIEWED
File: `autoload/front/Controllers/ShopProductController.php`
Properties:
- `private $categoryRepository`

Methods:
- ✅ `public function __construct(\Domain\Category\CategoryRepository $categoryRepository)`
- ✅ `public function lazyLoadingProducts()`
- ✅ `public function warehouseMessage()`
- ✅ `public function drawProductAttributes()`
- ✅ `private static function getPermutation($attributes)`
- ✅ `private static function getPermutationQuantity($productId, $permutation)`

---

### front\Views\Articles ✅ REVIEWED
File: `autoload/front/Views/Articles.php`
Properties: (brak)

Methods:
- ✅ `public static function fullArticle($article)`
- ✅ `public static function miniatureArticlesList($articles, $ls, $bs, $page)`
- ✅ `public static function entryArticlesList($articles, $ls, $bs, $page)`
- ✅ `public static function fullArticlesList($articles, $ls, $bs, $page)`
- ✅ `public static function news($page_id, $articles)`
- ✅ `public static function newsList($articles)`
- ✅ `public static function generateTableOfContents($content)`
- ✅ `public static function processHeaders($matches)`
- ✅ `public static function generateHeadersIds($text)`
- ✅ `public static function getImage($article)`

---

### front\Views\Banners ✅ REVIEWED
File: `autoload/front/Views/Banners.php`
Properties: (brak)

Methods:
- ✅ `public static function banners($banners)`
- ✅ `public static function mainBanner($banner)`

---

### front\Views\Languages ✅ REVIEWED
File: `autoload/front/Views/Languages.php`
Properties: (brak)

Methods:
- ✅ `public static function render($languages)`

---

### front\Views\Menu ✅ REVIEWED
File: `autoload/front/Views/Menu.php`
Properties: (brak)

Methods:
- ✅ `public static function pages($pages, $level = 0, $current_page = 0)`
- ✅ `public static function menu($menu, $current_page)`

---

### front\Views\Newsletter ✅ REVIEWED
File: `autoload/front/Views/Newsletter.php`
Properties: (brak)

Methods:
- ✅ `public static function render()`

---

### front\Views\Scontainers ✅ REVIEWED
File: `autoload/front/Views/Scontainers.php`
Properties: (brak)

Methods:
- ✅ `public static function scontainer($scontainer)`

---

### front\Views\ShopCategory ✅ REVIEWED
File: `autoload/front/Views/ShopCategory.php`
Properties: (brak)

Methods:
- ✅ `public static function categoryDescription($category): string`
- ✅ `public static function categoryView($category, string $langId, int $currentPage = 1): string`
- ✅ `public static function categories($categories, $currentCategory = 0, $level = 0): string`

---

### front\Views\ShopClient ✅ REVIEWED
File: `autoload/front/Views/ShopClient.php`
Properties: (brak)

Methods:
- ✅ `public static function addressEdit($values): string`
- ✅ `public static function clientAddresses($values): string`
- ✅ `public static function clientMenu($values): string`
- ✅ `public static function clientOrders($values): string`
- ✅ `public static function recoverPassword(): string`
- ✅ `public static function miniLogin(): string`
- ✅ `public static function loginForm($values = ''): string`
- ✅ `public static function registerForm(): string`

---

### front\Views\ShopPaymentMethod ✅ REVIEWED
File: `autoload/front/Views/ShopPaymentMethod.php`
Properties: (brak)

Methods:
- ✅ `public static function basketPaymentMethods($payment_methods, $payment_id)`

---

### front\Views\ShopProduct ✅ REVIEWED
File: `autoload/front/Views/ShopProduct.php`
Properties: (brak)

Methods:
- ✅ `public static function productUrl($product)`

---

### front\Views\ShopSearch ✅ REVIEWED
File: `autoload/front/Views/ShopSearch.php`
Properties: (brak)

Methods:
- ✅ `public static function simpleForm()`

---

<a id="shared"></a>
## 4. Shared/ — Klasy współdzielone

### Shared\Cache\CacheHandler ✅ REVIEWED
File: `autoload/Shared/Cache/CacheHandler.php`
Properties:
- `protected $redis`

Methods:
- ✅ `public function __construct()`
- ✅ `public function get($key)`
- ✅ `public function set($key, $value, $ttl = 86400)`
- ✅ `public function exists($key)`
- ✅ `public function delete($key)`
- ✅ `public function deletePattern($pattern)`

---

### Shared\Cache\RedisConnection ✅ REVIEWED
File: `autoload/Shared/Cache/RedisConnection.php`
Properties:
- `private static $instance = null`
- `private $redis`

Methods:
- ✅ `private function __construct()`
- ✅ `public static function getInstance()`
- ✅ `public function getConnection()`

---

### Shared\Email\Email ✅ REVIEWED
File: `autoload/Shared/Email/Email.php`
Properties:
- `public $table = 'pp_newsletter_templates'`

Methods:
- ✅ `public function load_by_name(string $name)`
- ✅ `public function email_check($email)`
- ✅ `public function send(string $email, string $subject, bool $newsletter_headers = false, string $file = null)`

---

### Shared\Helpers\Helpers ✅ REVIEWED
File: `autoload/Shared/Helpers/Helpers.php`
Properties: (brak — wszystkie metody statyczne)

Methods:
- ✅ `static function canAddRedirect($from, $to, $lang_id = null)`
- ✅ `static public function clear_product_cache(int $product_id)`
- ✅ `static public function remove_special_chars($string)`
- ✅ `static public function removeDuplicates($array, $param)`
- 🔧 `static public function generate_webp_image($file, $compression_quality = 85)` — fix: `$_GET['c_w']`/`$_GET['c_h']` → `?? null` (l.117-118); `'png'` → `'image/png'` (l.177, bug: warunek nigdy nie był spełniony)
- ✅ `public static function is_array_fix($value)`
- ✅ `public static function delete_cache()`
- ✅ `public static function pretty_date($format, $timestamp = null)`
- ✅ `public static function lang($text)`
- ✅ `public static function array_cartesian_product($input)`
- ✅ `static public function normalize_decimal($val, int $precision = 2)`
- ✅ `public static function decimal($val, $precision = 2, $dec_point = ',', $thousands_sep = ' ')`
- ✅ `public static function get_new_version()`
- ✅ `public static function get_version()`
- ✅ `public static function set_session($var, $val)`
- ✅ `public static function get_session($var)`
- ✅ `public static function delete_session($var)`
- ✅ `public static function get($var, $clear = false)`
- ✅ `public static function set_message($text)`
- ✅ `public static function alert($text)`
- ✅ `public static function error($text)`
- ✅ `public static function htacces($dir = '../')`
- ✅ `public static function seo($val, $delete_rhombs = false)`
- ✅ `public static function noPL($string)`
- ✅ `public static function delete_dir($dir)`
- ✅ `public static function email_check($email)`
- ✅ `public static function send_email($email, $subject, $text, $replay = '', $file = '')`
- ✅ `public static function shortPrice($price)`
- ✅ `public static function isWholeNumber($value)`

---

### Shared\Html\Html ✅ REVIEWED
File: `autoload/Shared/Html/Html.php`
Properties: (brak — wszystkie metody statyczne)

Methods:
- ✅ `public static function form_text(array $params = array())`
- ✅ `public static function input_switch(array $params = array())`
- ✅ `public static function select(array $params = array())`
- ✅ `public static function textarea(array $params = array())`
- ✅ `public static function input_icon(array $params = array())`
- ✅ `public static function input(array $params = array())`
- ✅ `public static function button(array $params = array())`
- ✅ `public static function panel(array $params = array())`

---

### Shared\Image\ImageManipulator ✅ REVIEWED
File: `autoload/Shared/Image/ImageManipulator.php`
Properties:
- `protected int $width`
- `protected int $height`
- `protected $image`
- `protected ?string $file = null`

Methods:
- ✅ `public function __construct(?string $file = null)`
- ✅ `public function setImageFile(string $file): self`
- ✅ `public function setImageString(string $data): self`
- ✅ `public function resample(int $width, int $height, bool $constrainProportions = true): self`
- ✅ `public function enlargeCanvas(int $width, int $height, array $rgb = [], ?int $xpos = null, ?int $ypos = null): self`
- ✅ `public function crop($x1, int $y1 = 0, int $x2 = 0, int $y2 = 0): self`
- ✅ `protected function _replace($res): self`
- ✅ `public function save(string $fileName, ?int $type = null): void`
- ✅ `public function getResource()`
- ✅ `public function getWidth(): int`
- ✅ `public function getHeight(): int`
- ✅ `public function __destruct()`
- ✅ `private function isValidImageResource($image): bool`

---

### Shared\Tpl\Tpl ✅ REVIEWED
File: `autoload/Shared/Tpl/Tpl.php`
Properties:
- `protected $vars = array()`

Methods:
- ✅ `public static function view($file, $values = '')`
- ✅ `public function secureHTML($val)`
- ✅ `public function render($file)`
- ✅ `private function renderFile($path)`
- ✅ `public function __set($name, $value)`
- ✅ `public function __get($name)`

---

## Podsumowanie

| Warstwa | Pliki | Klasy | Metody (przybliżone) |
|---------|-------|-------|----------------------|
| Domain/ | 29 | 29 | ~435 |
| admin/ | 39 | 39 | ~340 |
| front/ | 21 | 21 | ~85 |
| Shared/ | 7 | 7 | ~63 |
| **Razem** | **96** | **96** | **~923** |

### Największe klasy (wg liczby metod)
1. `Domain\Product\ProductRepository` — ~88 metod
2. `admin\Controllers\ShopProductController` — ~42 metody
3. `Shared\Helpers\Helpers` — 29 metod
4. `Domain\Attribute\AttributeRepository` — 28 metod
5. `Domain\Category\CategoryRepository` — 21 metod
6. `admin\Support\Forms\FormFieldRenderer` — 21 metod
7. `admin\Controllers\NewsletterController` — 21 metod
8. `Domain\Order\OrderRepository` — 20 metod
9. `admin\Controllers\PagesController` — 20 metod
10. `admin\ViewModels\Forms\FormField` — 19 metod
