You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Too Many Nested Blocks in Function Declaration
(It is a good practice to introduce a new function rather than to use more nested blocks).
- And method length is 30 lines (20 allowed).
Code to move:
// Saving of the articles in the inventoryforeach ($articlesas$article) {
foreach ($article->getZoneStorages()->getSnapshot() as$zoneStorage) {
$inventoryArticles = newInventoryArticles();
$inventoryArticles->setArticle($article);
$inventoryArticles->setInventory($inventory);
$inventoryArticles->setQuantity($article->getQuantity());
$inventoryArticles->setRealstock(0);
$inventoryArticles->setUnitStorage($article->getUnitStorage());
$inventoryArticles->setPrice($article->getPrice());
$inventoryArticles->setZoneStorage($zoneStorage->getName());
$etm->persist($inventoryArticles);
}
}
Add the parameters for this code to work.
The text was updated successfully, but these errors were encountered:
Result of analysis:
Code to move:
Add the parameters for this code to work.
The text was updated successfully, but these errors were encountered: