Skip to content

[Issue] Replace 'static::' with 'self::' when accessing private const. #30781

Closed
@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #30774: Replace 'static::' with 'self::' when accessing private const.


Description

Magento 2.4 -develop

This PR prevents 'Undefined class constant' error if a plugin will be added for one of these classes. Example:

Related Pull Requests

#28797
#29925

Steps to reproduce:

Case 1

Create a plugin for : Magento\Backend\ViewModel\ChartDisabled class

Actual Result: ✖️ error occurs

Screenshot from 2020-11-05 13-20-42

Case 2

Create a plugin for : Magento\Catalog\Model\Config\LayerCategoryConfig class

Actual Result: ✖️ error occurs

Screenshot from 2020-11-05 14-43-46

Case 3

Create a plugin for : Magento\DownloadableImportExport\Model\Import\Product\Type\Downloadable class

Actual Result: ✖️ error occurs

2020-11-05_15-24

Expected Result: ✔️ No errors when plugins are called

Related Issues

  1. Do not recommend using static:: for private constants magento-coding-standard#197

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Pull Request In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions