Tidy Up Your Code
summary
Practical PHP rules and concrete refactors: enforce PSR formatting with PHP CS Fixer, add spacing and a blank line before return, prefer return early to drop nested else blocks, limit methods to about 5–10 lines, and split a large product-import into fetchProducts, saveProducts, saveProductImages so each step is testable. Use clear English names, avoid needless words and unclear abbreviations, prefer timestamps instead of booleans to record when state changes, and refactor to reduce cyclomatic complexity.
AI-written summary · about
