{"data":{"id":"magento2-37784","source":"github-pr","sourceRef":"magento/magento2#37784","title":"Fixes incorrect classes being referenced in Magento modules.","pr":{"number":37784,"url":"https://github.com/magento/magento2/pull/37784","author":"hostep","mergedAt":"2024-09-05T13:38:34Z","mergeCommit":"86074a0d6192bbcaf13488c3b5d0d45f072a0a38","headCommit":"7b6884468d566f74d57e8e21046bc97fdbc672c8","baseRef":"2.4-develop","diffSha256":"4903beb68cf659911c678fe523038128cb012f0ca4d58db901f25061cb8b8271"},"issues":[{"number":39126,"url":"https://github.com/magento/magento2/issues/39126","title":"[Issue] Fixes incorrect classes being referenced in Magento modules.","labels":["Area: Framework","Component: Backend","Issue: Confirmed","Priority: P2","Progress: done","Reported on 2.4.x","Reproduced on 2.4.x","Triage: Dev.Experience"],"kind":"pr-derived"}],"fixedIn":"2.4.8","containingTags":["2.4.8","2.4.8-p1","2.4.8-p2","2.4.8-p3","2.4.8-p4","2.4.8-p5","2.4.9"],"reportedOn":null,"codeMatch":{"2.4.6":"conflict","2.4.6-p1":"conflict","2.4.6-p2":"conflict","2.4.6-p3":"conflict","2.4.6-p4":"conflict","2.4.6-p5":"conflict","2.4.6-p6":"conflict","2.4.6-p7":"conflict","2.4.6-p8":"conflict","2.4.6-p9":"conflict","2.4.6-p10":"conflict","2.4.6-p11":"conflict","2.4.6-p12":"conflict","2.4.6-p13":"conflict","2.4.6-p14":"conflict","2.4.6-p15":"conflict","2.4.7":"conflict","2.4.7-p1":"conflict","2.4.7-p2":"conflict","2.4.7-p3":"conflict","2.4.7-p4":"conflict","2.4.7-p5":"conflict","2.4.7-p6":"conflict","2.4.7-p7":"conflict","2.4.7-p8":"conflict","2.4.7-p9":"conflict","2.4.7-p10":"conflict","2.4.8":"conflict","2.4.8-p1":"conflict","2.4.8-p2":"conflict","2.4.8-p3":"conflict","2.4.8-p4":"conflict","2.4.8-p5":"conflict","2.4.9":"conflict"},"affectedVersions":[],"components":["magento/module-catalog","magento/module-catalog-inventory","magento/module-catalog-rule","magento/module-cms","magento/module-paypal","magento/module-sales","magento/module-sales-rule"],"files":[{"path":"app/code/Magento/Catalog/Model/ProductRepository.php","change":"modified","package":"magento/module-catalog"},{"path":"app/code/Magento/CatalogInventory/Model/Indexer/Stock/Action/Full.php","change":"modified","package":"magento/module-catalog-inventory"},{"path":"app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php","change":"modified","package":"magento/module-catalog-rule"},{"path":"app/code/Magento/CatalogRule/Model/ResourceModel/Rule/Collection.php","change":"modified","package":"magento/module-catalog-rule"},{"path":"app/code/Magento/Cms/Model/PageRepository.php","change":"modified","package":"magento/module-cms"},{"path":"app/code/Magento/Paypal/Observer/AddPaypalShortcutsObserver.php","change":"modified","package":"magento/module-paypal"},{"path":"app/code/Magento/Sales/Controller/Adminhtml/Creditmemo/AbstractCreditmemo/PrintAction.php","change":"modified","package":"magento/module-sales"},{"path":"app/code/Magento/SalesRule/Model/ResourceModel/Rule.php","change":"modified","package":"magento/module-sales-rule"},{"path":"app/code/Magento/SalesRule/Model/ResourceModel/Rule/Collection.php","change":"modified","package":"magento/module-sales-rule"}],"stripped":{"tests":["app/code/Magento/Sales/Test/Unit/Helper/ReorderTest.php"],"docs":[],"outsideCode":[]},"linesChanged":77,"mergeBatched":false,"excluded":null,"sections":{"description":"These were found by running phpstan with level 0 on all code in `app/code/Magento`","stepsToReproduce":"1. Run: `vendor/bin/phpstan clear-result-cache && bin/magento setup:di:compile && composer dump-autoload`\n2. Run: `vendor/bin/phpstan analyse --level=0 -c ./dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon app/code/Magento/` (if you don't use a very modern computer with a very good processor and enough memory, it might take a long time to run, or even crash)\n3. After applying the changes from this PR and re-running steps 1 and 2 from above, you should have 16 fewer errors.\n4. Try printing a creditmemo as pdf file in the backoffice, the filename you get should be `creditmemo{current-date}.pdf`\n5. Make sure reindexing of stocks still works as expected\n6. All automated tests should keep running correctly I hope","expectedResult":null,"actualResult":null,"source":"pr"},"signatures":[],"labels":{"area":["Framework"],"component":["Backend"],"priority":"P2","severity":null,"reportedOn":["2.4.x"]},"categories":[],"triage":{"model":"@cf/cloudflare/clef","requestHash":"c713e3b1824c36106e96cb9dca6b7fc64fa9ae5aea699f423ee93dd5f8c9b6c2","isBugfix":0.7352,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.702,"feature":0.0058,"refactor":0.1134,"tests_only":0.0249,"docs_only":0.0065,"dependency":0.0094,"cleanup":0.138},"confidence":0.4464},"scope":{"score":1.1371,"probabilities":{"0":0.0844,"1":0.6941,"2":0.2215},"confidence":0.307},"risk":{"score":0.7433,"probabilities":{"0":0.516,"1":0.2247,"2":0.2593},"confidence":0.076},"area":{"choice":"catalog","probabilities":{"catalog":0.365,"checkout":0.1515,"customer":0.011,"admin":0.1245,"graphql_api":0.0121,"framework":0.1469,"frontend":0.018,"other":0.171},"confidence":0.1121},"securityRelevant":0.0072,"reportedVersion":{"choice":"unspecified","probabilities":{"2.4.0":0.0055,"2.4.0-p1":0.0048,"2.4.1":0.0043,"2.4.1-p1":0.0035,"2.4.2":0.0057,"2.4.2-p1":0.0057,"2.4.2-p2":0.0066,"2.4.3":0.0106,"2.4.3-p1":0.0096,"2.4.3-p2":0.0116,"2.4.3-p3":0.0072,"2.4.4":0.0124,"2.4.4-p1":0.0072,"2.4.4-p10":0.0069,"2.4.4-p11":0.0078,"2.4.4-p12":0.0068,"2.4.4-p13":0.0072,"2.4.4-p14":0.0089,"2.4.4-p15":0.0063,"2.4.4-p16":0.0068,"2.4.4-p17":0.0062,"2.4.4-p18":0.0059,"2.4.4-p2":0.0032,"2.4.4-p3":0.0038,"2.4.4-p4":0.0039,"2.4.4-p5":0.0041,"2.4.4-p6":0.0047,"2.4.4-p7":0.0045,"2.4.4-p8":0.0047,"2.4.4-p9":0.0038,"2.4.5":0.015,"2.4.5-p1":0.0111,"2.4.5-p10":0.007,"2.4.5-p11":0.0123,"2.4.5-p12":0.0114,"2.4.5-p13":0.0102,"2.4.5-p14":0.011,"2.4.5-p15":0.008,"2.4.5-p16":0.0086,"2.4.5-p17":0.0093,"2.4.5-p2":0.0039,"2.4.5-p3":0.0055,"2.4.5-p4":0.0046,"2.4.5-p5":0.0077,"2.4.5-p6":0.006,"2.4.5-p7":0.0065,"2.4.5-p8":0.0054,"2.4.5-p9":0.005,"2.4.6":0.0263,"2.4.6-p1":0.0192,"2.4.6-p10":0.0135,"2.4.6-p11":0.0146,"2.4.6-p12":0.0109,"2.4.6-p13":0.0127,"2.4.6-p14":0.0114,"2.4.6-p15":0.009,"2.4.6-p2":0.0058,"2.4.6-p3":0.0084,"2.4.6-p4":0.0094,"2.4.6-p5":0.0084,"2.4.6-p6":0.0122,"2.4.6-p7":0.0091,"2.4.6-p8":0.0065,"2.4.6-p9":0.0055,"2.4.7":0.0198,"2.4.7-p1":0.0148,"2.4.7-p10":0.011,"2.4.7-p2":0.0087,"2.4.7-p3":0.0133,"2.4.7-p4":0.0149,"2.4.7-p5":0.0113,"2.4.7-p6":0.0142,"2.4.7-p7":0.0123,"2.4.7-p8":0.0104,"2.4.7-p9":0.0071,"2.4.8":0.0219,"2.4.8-p1":0.0191,"2.4.8-p2":0.0207,"2.4.8-p3":0.0184,"2.4.8-p4":0.0152,"2.4.8-p5":0.0122,"2.4.9":0.0213,"unspecified":0.2118},"confidence":0.0429},"backportWorthy":{"score":0.9395,"probabilities":{"0":0.346,"1":0.3685,"2":0.2855},"confidence":0.0055}},"curated":{"title":"Creditmemo pdf filename and stock Full indexer use classes not found","description":"Running phpstan with level 0 on all code in app/code/Magento found classes not found. PrintAction now gets the filename creditmemo{current-date}.pdf, not \\creditmemo::class with the date, and the CatalogInventory Full stock indexer uses BatchSizeManagementInterface and runs switchTable with the main table of each indexer. Classes declared as a virtualType get @phpstan-ignore-next-line.","categories":[],"author":"claude-code/opus-5.5","date":"2026-10-06","reviewedBy":null},"tests":null},"_documentation":"https://magento.watch/api","_description":"Upstream fix magento2-37784 details"}