Skip to content

Technical guidelines > Abstract classes MUST NOT be marked as public @api #25133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
namespace Magento\AdminNotification\Model\System\Message\Media;

/**
* Abstract Synchronization
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
* @since 100.0.2
*/
Expand Down
22 changes: 18 additions & 4 deletions app/code/Magento/Backend/App/AbstractAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/**
* Generic backend controller
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
* @SuppressWarnings(PHPMD.NumberOfChildren)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Expand Down Expand Up @@ -101,6 +102,8 @@ public function __construct(Action\Context $context)
}

/**
* Check current user permission on resource and privilege
*
* @return bool
*/
protected function _isAllowed()
Expand All @@ -119,6 +122,8 @@ protected function _getSession()
}

/**
* Get message manager
*
* @return \Magento\Framework\Message\ManagerInterface
*/
protected function getMessageManager()
Expand Down Expand Up @@ -146,6 +151,8 @@ protected function _setActiveMenu($itemId)
}

/**
* Add breadcrumb
*
* @param string $label
* @param string $title
* @param string|null $link
Expand All @@ -158,6 +165,8 @@ protected function _addBreadcrumb($label, $title, $link = null)
}

/**
* Add block to content container
*
* @param \Magento\Framework\View\Element\AbstractBlock $block
* @return $this
*/
Expand All @@ -167,6 +176,8 @@ protected function _addContent(\Magento\Framework\View\Element\AbstractBlock $bl
}

/**
* Add block to left container
*
* @param \Magento\Framework\View\Element\AbstractBlock $block
* @return $this
*/
Expand All @@ -176,6 +187,8 @@ protected function _addLeft(\Magento\Framework\View\Element\AbstractBlock $block
}

/**
* Add block to js container
*
* @param \Magento\Framework\View\Element\AbstractBlock $block
* @return $this
*/
Expand All @@ -200,6 +213,8 @@ private function _moveBlockToContainer(\Magento\Framework\View\Element\AbstractB
}

/**
* Dispatch request
*
* @param \Magento\Framework\App\RequestInterface $request
* @return \Magento\Framework\App\ResponseInterface
*/
Expand Down Expand Up @@ -286,8 +301,7 @@ public function _processUrlKeys()
}

/**
* Set session locale,
* process force locale set through url params
* Set session locale, process force locale set through url params
*
* @return $this
*/
Expand All @@ -309,8 +323,8 @@ protected function _processLocaleSettings()
* Set redirect into response
*
* @TODO MAGETWO-28356: Refactor controller actions to new ResultInterface
* @param string $path
* @param array $arguments
* @param string $path
* @param array $arguments
* @return \Magento\Framework\App\ResponseInterface
*/
protected function _redirect($path, $arguments = [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*
* phpcs:disable Magento2.Classes.AbstractApi
* Backend grid item abstract renderer
*
* phpcs:disable Magento2.Classes.AbstractApi
Copy link
Contributor

@ihor-sviziev ihor-sviziev Feb 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class already contains it. this line above, please fix duplicate

* @api
* @SuppressWarnings(PHPMD.NumberOfChildren)
* @api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/**
* Abstract cache command
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
* @since 100.0.2
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use Symfony\Component\Console\Input\InputInterface;

/**
* Abstract Cache Manage Command
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
* @since 100.0.2
*/
Expand All @@ -21,7 +24,7 @@ abstract class AbstractCacheManageCommand extends AbstractCacheCommand
const INPUT_KEY_TYPES = 'types';

/**
* {@inheritdoc}
* @inheritdoc
*/
protected function configure()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use Symfony\Component\Console\Output\OutputInterface;

/**
* Abstract Cache Set Command
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
* @since 100.0.2
*/
Expand All @@ -23,7 +26,7 @@ abstract class AbstractCacheSetCommand extends AbstractCacheManageCommand
abstract protected function isEnable();

/**
* {@inheritdoc}
* @inheritdoc
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
use Magento\Framework\App\Cache\Manager;

/**
* Abstract Cache Type Manage Command
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
* @since 100.0.2
*/
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Backend/Model/Menu/AbstractDirector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
namespace Magento\Backend\Model\Menu;

/**
* Abstract Director
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
* @since 100.0.2
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

/**
* Menu builder command
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
* @since 100.0.2
*/
Expand Down
9 changes: 6 additions & 3 deletions app/code/Magento/Backend/Model/Widget/Grid/AbstractTotals.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
namespace Magento\Backend\Model\Widget\Grid;

/**
* Abstract Totals
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
* @since 100.0.2
*/
Expand Down Expand Up @@ -133,9 +136,9 @@ protected function _countExpr($expr, $collection)
/**
* Check if operands in not null and set operands values if they are empty
*
* @param float|int &$firstOperand
* @param float|int &$secondOperand
* @param float|int &$tmpResult
* @param float|int $firstOperand
* @param float|int $secondOperand
* @param float|int $tmpResult
* @param float|int $result
* @return void
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/**
* Product view abstract block
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
* @deprecated 101.1.0
* @since 100.0.2
Expand Down
10 changes: 6 additions & 4 deletions app/code/Magento/Catalog/Model/AbstractModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

/**
* Abstract model for catalog entities
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @author Magento Core Team <core@magentocommerce.com>
Expand Down Expand Up @@ -313,8 +315,8 @@ private function getAttributeScopeOverriddenValue()
/**
* Retrieve default value for attribute code
*
* @param string $attributeCode
* @return array|boolean
* @param string $attributeCode
* @return array|boolean
*
* @deprecated 101.0.0
*/
Expand Down Expand Up @@ -348,8 +350,8 @@ public function setExistsStoreValueFlag($attributeCode)
/**
* Check if object attribute has value in current store
*
* @param string $attributeCode
* @return bool
* @param string $attributeCode
* @return bool
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
*
* @deprecated 101.0.0
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Catalog/Model/Indexer/AbstractFlatState.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use Magento\Store\Model\ScopeInterface;

/**
* Abstract Flat State
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
* @since 100.0.2
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/**
* Class AbstractAction
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/**
* Layer category filter abstract model
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
* @since 100.0.2
*/
Expand Down Expand Up @@ -362,9 +363,9 @@ public function getClearLinkText()
/**
* Get option text from frontend model by option id
*
* @param int $optionId
* @param int $optionId
* @throws \Magento\Framework\Exception\LocalizedException
* @return string|bool
* @return string|bool
*/
protected function getOptionText($optionId)
{
Expand Down
16 changes: 13 additions & 3 deletions app/code/Magento/Catalog/Model/Product/Type/AbstractType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
use Magento\Framework\Exception\LocalizedException;

/**
* Abstract Type
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
* Abstract model for product type implementation
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
Expand Down Expand Up @@ -355,6 +358,7 @@ public function isSalable($product)

/**
* Prepare product and its configuration to be added to some products list.
*
* Perform standard preparation process and then prepare options belonging to specific product type.
*
* @param \Magento\Framework\DataObject $buyRequest
Expand Down Expand Up @@ -440,6 +444,7 @@ public function processConfiguration(

/**
* Initialize product(s) for add to cart process.
*
* Advanced version of func to prepare product for cart - processMode can be specified there.
*
* @param \Magento\Framework\DataObject $buyRequest
Expand Down Expand Up @@ -532,6 +537,7 @@ public function processFileQueue()

/**
* Add file to File Queue
*
* @param array $queueOptions Array of File Queue
* (eg. ['operation'=>'move',
* 'src_name'=>'filename',
Expand Down Expand Up @@ -643,8 +649,7 @@ public function checkProductBuyState($product)
}

/**
* Prepare additional options/information for order item which will be
* created from this product
* Prepare additional options/information for order item which will be created from this product
*
* @param \Magento\Catalog\Model\Product $product
* @return array
Expand Down Expand Up @@ -900,7 +905,7 @@ public function getStoreFilter($product)
/**
* Set store filter for associated products
*
* @param $store int|\Magento\Store\Model\Store
* @param int|\Magento\Store\Model\Store $store
* @param \Magento\Catalog\Model\Product $product
* @return $this
*/
Expand Down Expand Up @@ -940,6 +945,7 @@ public function prepareQuoteItemQty($qty, $product)

/**
* Implementation of product specify logic of which product needs to be assigned to option.
*
* For example if product which was added to option already removed from catalog.
*
* @param \Magento\Catalog\Model\Product $optionProduct
Expand Down Expand Up @@ -979,6 +985,7 @@ public function setConfig($config)

/**
* Retrieve additional searchable data from type instance
*
* Using based on product id and store_id data
*
* @param \Magento\Catalog\Model\Product $product
Expand All @@ -999,6 +1006,7 @@ public function getSearchableData($product)

/**
* Retrieve products divided into groups required to purchase
*
* At least one product in each group has to be purchased
*
* @param \Magento\Catalog\Model\Product $product
Expand Down Expand Up @@ -1092,6 +1100,8 @@ public function getIdentities(\Magento\Catalog\Model\Product $product)
}

/**
* Get associated products
*
* @param \Magento\Catalog\Model\Product\Type\AbstractType $product
* @return array
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
Expand Down
Loading