magento-lts
magento-lts copied to clipboard
phpstan: fixed calls to Mage_Core_Block_Abstract
Description (*)
Some phpstan/docblock fixes ...
Contribution checklist (*)
- [x] Pull request has a meaningful description of its purpose
- [x] All commits are accompanied by meaningful commit messages
- [x] All automated tests passed successfully (all builds are green)
- [x] Add yourself to contributors list
Unit Test Results
1 files ±0 1 suites ±0 0s :stopwatch: ±0s 0 tests ±0 0 :heavy_check_mark: ±0 0 :zzz: ±0 0 :x: ±0 7 runs ±0 5 :heavy_check_mark: ±0 2 :zzz: ±0 0 :x: ±0
Results for commit 73db66ec. ± Comparison against base commit a002f37a.
Unit Test Results
1 files ±0 1 suites ±0 0s :stopwatch: ±0s 0 tests ±0 0 :heavy_check_mark: ±0 0 :zzz: ±0 0 :x: ±0 7 runs ±0 5 :heavy_check_mark: ±0 2 :zzz: ±0 0 :x: ±0
Results for commit 920a5cb3. ± Comparison against base commit 873050bc.
Unit Test Results
1 files ±0 1 suites ±0 0s :stopwatch: ±0s 0 tests ±0 0 :heavy_check_mark: ±0 0 :zzz: ±0 0 :x: ±0 7 runs ±0 5 :heavy_check_mark: ±0 2 :zzz: ±0 0 :x: ±0
Results for commit 920a5cb3. ± Comparison against base commit 873050bc.
I'm working on a large PR (#416 - Adminhtml), so it would be nice to have phpstan fixes (along with docblock updates) reviewed.
Just to explain (same for PR #2421) why i'v changed this (or similiar) ...
if ($root = $this->getLayout()->getBlock('root')) {
to
/** @var Mage_Page_Block_Html $root */
$root = $this->getLayout()->getBlock('root');
if ($root) {
PhpStorm can resolve these classes, because we told it with our phpstorm.meta.files. PHPStan - that only reads DOCblock, compares it to params or returned variables - does not know about class/method-mappings, so we have to make it more explict.
With this changes autocomplete/"jump-to method" should also work for other IDE then Phpstorm (not tested)
Unit Test Results
1 files ±0 1 suites ±0 0s :stopwatch: ±0s 0 tests ±0 0 :heavy_check_mark: ±0 0 :zzz: ±0 0 :x: ±0 7 runs ±0 5 :heavy_check_mark: ±0 2 :zzz: ±0 0 :x: ±0
Results for commit ba9ffe06. ± Comparison against base commit 873050bc.