From 86f5942a5dd81f24e8704b40c4814cbb6e99b0f7 Mon Sep 17 00:00:00 2001 From: Dmitry Furs Date: Sun, 31 Jan 2021 20:18:33 +0300 Subject: [PATCH 1/3] Extend .phpstorm.meta.php for more convenient autocomplete --- .../phpstorm.meta.php/di-autocomplete.php | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/resources/phpstorm.meta.php/di-autocomplete.php b/resources/phpstorm.meta.php/di-autocomplete.php index 3b14be35f..9fb8845b3 100644 --- a/resources/phpstorm.meta.php/di-autocomplete.php +++ b/resources/phpstorm.meta.php/di-autocomplete.php @@ -1,6 +1,123 @@ '@'])); override(\Magento\Framework\ObjectManagerInterface::create(0), map(['' => '@'])); + + override(\Magento\Framework\View\LayoutInterface::createBlock(0), map(['' => '@'])); + override(\Magento\Framework\View\TemplateEngine\Php::helper(0), map(['' => '@'])); + + override( + \Magento\Framework\Controller\ResultFactory::create(0), + map( + [ + \Magento\Framework\Controller\ResultFactory::TYPE_FORWARD => \Magento\Framework\Controller\Result\Forward::class, + \Magento\Framework\Controller\ResultFactory::TYPE_JSON => \Magento\Framework\Controller\Result\Json::class, + \Magento\Framework\Controller\ResultFactory::TYPE_LAYOUT => \Magento\Framework\View\Result\Layout::class, + \Magento\Framework\Controller\ResultFactory::TYPE_PAGE => \Magento\Framework\View\Result\Page::class, + \Magento\Framework\Controller\ResultFactory::TYPE_RAW => \Magento\Framework\Controller\Result\Raw::class, + \Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT => \Magento\Framework\Controller\Result\Redirect::class, + ] + ) + ); + + expectedArguments( + \Magento\Framework\Controller\ResultFactory::create(), + 0, + \Magento\Framework\Controller\ResultFactory::TYPE_FORWARD, + \Magento\Framework\Controller\ResultFactory::TYPE_JSON, + \Magento\Framework\Controller\ResultFactory::TYPE_LAYOUT, + \Magento\Framework\Controller\ResultFactory::TYPE_PAGE, + \Magento\Framework\Controller\ResultFactory::TYPE_RAW, + \Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT + ); + + registerArgumentsSet( + 'scope_types', + \Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT, + \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE + ); + expectedArguments( + \Magento\Framework\App\Config\ScopeConfigInterface::getValue(), + 1, + argumentsSet('scope_types') + ); + expectedArguments( + \Magento\Framework\App\Config\ScopeConfigInterface::isSetFlag(), + 1, + argumentsSet('scope_types') + ); + expectedArguments( + \Magento\Framework\App\Config\MutableScopeConfigInterface::setValue(), + 2, + argumentsSet('scope_types') + ); + + registerArgumentsSet( + 'condition_types', + 'eq', + 'in', + 'is', + 'to', + 'finset', + 'from', + 'gt', + 'gteq', + 'like', + 'lt', + 'lteq', + 'moreq', + 'neq', + 'nin', + 'notnull', + 'null' + ); + expectedArguments(\Magento\Framework\Api\SearchCriteriaBuilder::addFilter(), 2, argumentsSet('condition_types')); + expectedArguments(\Magento\Framework\Api\FilterBuilder::setConditionType(), 0, argumentsSet('condition_types')); + + expectedArguments( + \Magento\Framework\Api\SearchCriteriaBuilder::addSortOrder(), + 0, + \Magento\Framework\Api\SortOrder::SORT_ASC, + \Magento\Framework\Api\SortOrder::SORT_DESC + ); + + registerArgumentsSet( + 'field_types', + 'button', + 'checkbox', + 'checkboxes', + 'column', + 'date', + 'editablemultiselect', + 'editor', + 'fieldset', + 'file', + 'gallery', + 'hidden', + 'image', + 'imagefile', + 'label', + 'link', + 'multiline', + 'multiselect', + 'note', + 'obscure', + 'password', + 'radio', + 'radios', + 'reset', + 'select', + 'submit', + 'text', + 'textarea', + 'time' + ); + expectedArguments(\Magento\Framework\Data\Form\AbstractForm::addField(), 1, argumentsSet('field_types')); + expectedArguments(\Magento\Framework\Data\Form\Element\Fieldset::addField(), 1, argumentsSet('field_types')); + } From d5020e32bdbcc9bafad92fdb8782613547219586 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 2 Feb 2021 10:23:35 +0200 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index da21cd146..9c56cfd32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0). ## 3.1.0 +### Added + +- Extended `.phpstorm.meta.php` for more convenient autocomplete +86f5942 + ## 3.0.4 ### Fixed From d0ef6e6749762df33d4275023edd82f588465f54 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 2 Feb 2021 10:24:12 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c56cfd32..95d74d72a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0). ### Added - Extended `.phpstorm.meta.php` for more convenient autocomplete -86f5942 ## 3.0.4