{"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":"2711bfe8121cc7ee13bd81bc6b41e81194b8c1caa9af68bebfba68b1e37dbc5d","isBugfix":0.7827,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.7962,"feature":0.0065,"refactor":0.1513,"tests_only":0.0253,"docs_only":0.0081,"dependency":0.0126},"confidence":0.5892},"scope":{"score":1.1628,"probabilities":{"0":0.0984,"1":0.6405,"2":0.2611},"confidence":0.2322},"risk":{"score":0.7484,"probabilities":{"0":0.5105,"1":0.2306,"2":0.2589},"confidence":0.0712},"area":{"choice":"catalog","probabilities":{"catalog":0.3699,"checkout":0.1444,"customer":0.0096,"admin":0.1271,"graphql_api":0.0114,"framework":0.1503,"frontend":0.0181,"other":0.1692},"confidence":0.115},"securityRelevant":0.0079,"reportedVersion":{"choice":"unspecified","probabilities":{"2.4.0":0.0052,"2.4.0-p1":0.0048,"2.4.1":0.0042,"2.4.1-p1":0.0036,"2.4.2":0.0051,"2.4.2-p1":0.0046,"2.4.2-p2":0.0063,"2.4.3":0.0094,"2.4.3-p1":0.0076,"2.4.3-p2":0.0098,"2.4.3-p3":0.0062,"2.4.4":0.012,"2.4.4-p1":0.0069,"2.4.4-p10":0.0066,"2.4.4-p11":0.0075,"2.4.4-p12":0.0067,"2.4.4-p13":0.0068,"2.4.4-p14":0.0089,"2.4.4-p15":0.0061,"2.4.4-p16":0.0069,"2.4.4-p17":0.0065,"2.4.4-p18":0.0058,"2.4.4-p2":0.0032,"2.4.4-p3":0.0037,"2.4.4-p4":0.0033,"2.4.4-p5":0.0038,"2.4.4-p6":0.0048,"2.4.4-p7":0.0042,"2.4.4-p8":0.0042,"2.4.4-p9":0.0039,"2.4.5":0.0155,"2.4.5-p1":0.0107,"2.4.5-p10":0.0066,"2.4.5-p11":0.0114,"2.4.5-p12":0.0104,"2.4.5-p13":0.008,"2.4.5-p14":0.0106,"2.4.5-p15":0.0077,"2.4.5-p16":0.0077,"2.4.5-p17":0.0097,"2.4.5-p2":0.0038,"2.4.5-p3":0.0053,"2.4.5-p4":0.0047,"2.4.5-p5":0.0052,"2.4.5-p6":0.0059,"2.4.5-p7":0.0064,"2.4.5-p8":0.0055,"2.4.5-p9":0.0051,"2.4.6":0.0253,"2.4.6-p1":0.0218,"2.4.6-p10":0.0135,"2.4.6-p11":0.0142,"2.4.6-p12":0.0101,"2.4.6-p13":0.0133,"2.4.6-p14":0.0103,"2.4.6-p15":0.0087,"2.4.6-p2":0.0052,"2.4.6-p3":0.0069,"2.4.6-p4":0.0088,"2.4.6-p5":0.0077,"2.4.6-p6":0.0107,"2.4.6-p7":0.0093,"2.4.6-p8":0.0063,"2.4.6-p9":0.0055,"2.4.7":0.0181,"2.4.7-p1":0.0141,"2.4.7-p10":0.0098,"2.4.7-p2":0.009,"2.4.7-p3":0.0141,"2.4.7-p4":0.0146,"2.4.7-p5":0.0124,"2.4.7-p6":0.0133,"2.4.7-p7":0.0147,"2.4.7-p8":0.0097,"2.4.7-p9":0.006,"2.4.8":0.0191,"2.4.8-p1":0.018,"2.4.8-p2":0.0193,"2.4.8-p3":0.0176,"2.4.8-p4":0.0142,"2.4.8-p5":0.012,"2.4.9":0.0177,"unspecified":0.2499},"confidence":0.0598},"backportWorthy":{"score":0.9576,"probabilities":{"0":0.3321,"1":0.3782,"2":0.2897},"confidence":0.0059}},"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"}