Skip to content

Commit 5671bba

Browse files
committed
Add descriptions to the phpdoc blocks, even if they are superfluous
1 parent 8e3bb74 commit 5671bba

File tree

8 files changed

+54
-4
lines changed

8 files changed

+54
-4
lines changed

app/code/Magento/Customer/Model/Plugin/CustomerNotification.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function __construct(
7272
$this->state = $state;
7373
$this->customerRepository = $customerRepository;
7474
$this->logger = $logger;
75-
$this->request = $request ?? ObjectManager::getInstance()->get(RequestInterface::class);
75+
$this->request = $request;
7676
}
7777

7878
/**
@@ -100,14 +100,31 @@ public function beforeExecute(ActionInterface $subject)
100100
}
101101
}
102102

103+
/**
104+
* Return the shared request.
105+
* If the request wasn't injected because of the backward compatible optional constructor dependency,
106+
* create a new request instance.
107+
*
108+
* @return RequestInterface
109+
*/
110+
private function getRequest(): RequestInterface
111+
{
112+
if (null === $this->request) {
113+
$this->request = ObjectManager::getInstance()->get(RequestInterface::class);
114+
}
115+
return $this->request;
116+
}
117+
103118
/**
104119
* Because RequestInterface has no isPost method the check is requied before calling it.
105120
*
106121
* @return bool
107122
*/
108123
private function isPostRequest(): bool
109124
{
110-
return method_exists($this->request, 'isPost') && $this->request->isPost();
125+
$request = $this->getRequest();
126+
127+
return method_exists($request, 'isPost') && $request->isPost();
111128
}
112129

113130
/**

app/code/Magento/Customer/Model/Visitor.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,10 @@ public function getOnlineInterval()
317317
}
318318

319319
/**
320+
* Return the shared request.
321+
* If the request wasn't injected because of the backward compatible optional constructor dependency,
322+
* create a new request instance.
323+
*
320324
* @return \Magento\Framework\App\RequestInterface|\Magento\Framework\App\Request\Http
321325
*/
322326
private function getRequest()

dev/tests/integration/testsuite/Magento/Framework/App/TestStubs/InheritanceBasedBackendAction.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
use Magento\Backend\App\Action;
66
use Magento\Framework\View\Result\PageFactory;
77

8+
/**
9+
* Stub inheritance based backend action controller for testing purposes.
10+
*/
811
class InheritanceBasedBackendAction extends Action
912
{
1013
/**

dev/tests/integration/testsuite/Magento/Framework/App/TestStubs/InheritanceBasedFrontendAction.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
use Magento\Framework\App\Action\Context;
77
use Magento\Framework\View\Result\PageFactory;
88

9+
/**
10+
* Stub inheritance based frontend action controller for testing purposes.
11+
*/
912
class InheritanceBasedFrontendAction extends Action
1013
{
1114
/**

dev/tests/integration/testsuite/Magento/Framework/App/TestStubs/InterfaceOnlyBackendAction.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
use Magento\Framework\App\ActionInterface;
66
use Magento\Framework\View\Result\PageFactory;
77

8+
/**
9+
* Stub interface action controller implementation for testing purposes.
10+
*/
811
class InterfaceOnlyBackendAction implements ActionInterface
912
{
1013
/**

dev/tests/integration/testsuite/Magento/Framework/App/TestStubs/InterfaceOnlyFrontendAction.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
use Magento\Framework\App\ActionInterface;
66
use Magento\Framework\View\Result\PageFactory;
77

8+
/**
9+
* Stub interface only based frontend action controller for testing purposes.
10+
*/
811
class InterfaceOnlyFrontendAction implements ActionInterface
912
{
1013
/**

lib/internal/Magento/Framework/App/Action/Plugin/ActionFlagNoDispatchPlugin.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Magento\Framework\App\ResponseInterface;
88

99
/**
10-
*
10+
* Do not call Action::execute() if the action flag FLAG_NO_DISPATCH is set.
1111
*/
1212
class ActionFlagNoDispatchPlugin
1313
{
@@ -28,6 +28,8 @@ public function __construct(ActionFlag $actionFlag, ResponseInterface $response)
2828
}
2929

3030
/**
31+
* Do not call proceed if the no dispatch action flag is set.
32+
*
3133
* @param ActionInterface $subject
3234
* @param callable $proceed
3335
* @return ResponseInterface

lib/internal/Magento/Framework/App/Action/Plugin/EventDispatchPlugin.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Magento\Framework\HTTP\PhpEnvironment\Response;
1313

1414
/**
15-
*
15+
* Dispatch the controller_action_predispatch and controller_action_post_dispatch events.
1616
*/
1717
class EventDispatchPlugin
1818
{
@@ -38,12 +38,19 @@ public function __construct(RequestInterface $request, ManagerInterface $eventMa
3838
$this->actionFlag = $actionFlag;
3939
}
4040

41+
/**
42+
* Trigger the controller_action_predispatch events
43+
*
44+
* @param ActionInterface $subject
45+
*/
4146
public function beforeExecute(ActionInterface $subject)
4247
{
4348
$this->dispatchPreDispatchEvents($subject);
4449
}
4550

4651
/**
52+
* Build the event parameter array
53+
*
4754
* @param ActionInterface $subject
4855
* @return mixed[]
4956
*/
@@ -53,6 +60,8 @@ private function getEventParameters(ActionInterface $subject): array
5360
}
5461

5562
/**
63+
* Trigger the controller_action_postdispatch events if the suppressing action flag is not set
64+
*
5665
* @param ActionInterface $subject
5766
* @param ResultInterface|Response|null $result
5867
* @return ResultInterface|Response|null
@@ -67,6 +76,8 @@ public function afterExecute(ActionInterface $subject, $result)
6776
}
6877

6978
/**
79+
* Check if action flags are set that would suppress the post dispatch events.
80+
*
7081
* @param ActionInterface $subject
7182
* @return bool
7283
*
@@ -78,6 +89,8 @@ private function isSetActionNoPostDispatchFlag(): bool
7889
}
7990

8091
/**
92+
* Dispatch the controller_action_predispatch events.
93+
*
8194
* @param ActionInterface $action
8295
*/
8396
private function dispatchPreDispatchEvents(ActionInterface $action)
@@ -94,6 +107,8 @@ private function dispatchPreDispatchEvents(ActionInterface $action)
94107
}
95108

96109
/**
110+
* Dispatch the controller_action_postdispatch events.
111+
*
97112
* @param ActionInterface $action
98113
*/
99114
private function dispatchPostDispatchEvents(ActionInterface $action)

0 commit comments

Comments
 (0)