Skip to content
Open
Changes from 6 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
35d3823
Log undeclared plugin only if it is not disabled
thomas-kl1 Jul 18, 2025
710453e
Log in dev mode only or when plugin is actually enabled
thomas-kl1 Jul 18, 2025
8988902
Add missing property
thomas-kl1 Jul 18, 2025
7a404b0
Add missing phpdoc
thomas-kl1 Jul 18, 2025
abbee11
Fix License
thomas-kl1 Jul 18, 2025
cc9df6c
Fix typo
thomas-kl1 Jul 19, 2025
cf3bc4c
Merge branch '2.4-develop' into patch-28
engcom-Hotel Jul 29, 2025
3e67495
Add missing signature on private methods + use CPP
thomas-kl1 Aug 3, 2025
de49ca7
Merge branch '2.4-develop' into patch-28
thomas-kl1 Aug 3, 2025
48da421
Inject mode instead of State instance
thomas-kl1 Aug 5, 2025
bbac3c8
Fix typo in property name
thomas-kl1 Aug 5, 2025
c5233f8
Inject app mode in interceptor generator
thomas-kl1 Aug 5, 2025
2d564db
Merge branch '2.4-develop' into patch-28
thomas-kl1 Aug 5, 2025
b4f5cfc
Fix property must not be accessed before initialization
thomas-kl1 Aug 6, 2025
5a82b87
Merge branch '2.4-develop' into patch-28
thomas-kl1 Aug 6, 2025
9e27141
Remove duplicate declaration
thomas-kl1 Aug 6, 2025
56eac3e
Fix phpcs
thomas-kl1 Aug 6, 2025
9fef293
scopeCode can be null
thomas-kl1 Aug 11, 2025
fa9c525
Merge branch '2.4-develop' into patch-28
thomas-kl1 Aug 11, 2025
844e978
Merge branch '2.4-develop' into patch-28
thomas-kl1 Aug 13, 2025
4d2f9ee
Fix phpcs
thomas-kl1 Aug 13, 2025
c610cc7
Merge branch '2.4-develop' into patch-28
engcom-Charlie Aug 19, 2025
471b82e
Merge branch '2.4-develop' into patch-28
engcom-Charlie Aug 25, 2025
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
@@ -1,13 +1,15 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2020 Adobe
* All Rights Reserved.
*/
declare(strict_types=1);

namespace Magento\Framework\Interception;

use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\App\State;
use Magento\Framework\Config\ReaderInterface;
use Magento\Framework\Config\ScopeInterface;
use Magento\Framework\Interception\ObjectManager\ConfigInterface;
Expand Down Expand Up @@ -104,6 +106,11 @@ class PluginListGenerator implements ConfigWriterInterface, ConfigLoaderInterfac
*/
private $scopePriorityScheme;

/**
* @var State
*/
private State $appState;

/**
* @var array
*/
Expand All @@ -119,6 +126,7 @@ class PluginListGenerator implements ConfigWriterInterface, ConfigLoaderInterfac
* @param LoggerInterface $logger
* @param DirectoryList $directoryList
* @param array $scopePriorityScheme
* @param State|null $appState
*/
public function __construct(
ReaderInterface $reader,
Expand All @@ -129,7 +137,8 @@ public function __construct(
ClassDefinitions $classDefinitions,
LoggerInterface $logger,
DirectoryList $directoryList,
array $scopePriorityScheme = ['global']
array $scopePriorityScheme = ['global'],
?State $appState = null
) {
$this->reader = $reader;
$this->scopeConfig = $scopeConfig;
Expand All @@ -140,6 +149,7 @@ public function __construct(
$this->logger = $logger;
$this->directoryList = $directoryList;
$this->scopePriorityScheme = $scopePriorityScheme;
$this->appState = $appState ?? ObjectManager::getInstance()->get(State::class);
}

/**
Expand Down Expand Up @@ -366,9 +376,12 @@ public function trimInstanceStartingBackslash(&$plugins)
public function filterPlugins(array &$plugins)
{
foreach ($plugins as $name => $plugin) {
if (empty($plugin['instance'])) {
if (!isset($plugin['instance'])) {
unset($plugins[$name]);
$this->logger->info("Reference to undeclared plugin with name '{$name}'.");
// Log the undeclared plugin when it is not disabled or when the app is in Developer mode.
if ($this->appState->getMode() === State::MODE_DEVELOPER || !($plugin['disabled'] ?? false)) {
$this->logger->debug("Reference to undeclared plugin with name '{$name}'.");
}
}
}
}
Expand Down