diff --git a/Block/Adminhtml/Config/Settings/ButtonField.php b/Block/Adminhtml/Config/Settings/ButtonField.php
index c6c9c8a..9490a8c 100644
--- a/Block/Adminhtml/Config/Settings/ButtonField.php
+++ b/Block/Adminhtml/Config/Settings/ButtonField.php
@@ -5,9 +5,13 @@
use Dotdigitalgroup\Chat\Model\Config;
use Dotdigitalgroup\Email\Helper\Data;
use Dotdigitalgroup\Email\Helper\OauthValidator;
+use Magento\Backend\Block\Template\Context;
use Magento\Backend\Block\Widget\Button;
+use Magento\Config\Block\System\Config\Form\Field;
+use Magento\Framework\Data\Form\Element\AbstractElement;
+use Magento\Framework\Exception\LocalizedException;
-abstract class ButtonField extends \Magento\Config\Block\System\Config\Form\Field
+abstract class ButtonField extends Field
{
/**
* @var Config
@@ -26,14 +30,15 @@ abstract class ButtonField extends \Magento\Config\Block\System\Config\Form\Fiel
/**
* ButtonField constructor.
- * @param \Magento\Backend\Block\Template\Context $context
+ *
+ * @param Context $context
* @param Config $config
* @param Data $helper
* @param OauthValidator $oauthValidator
* @param array $data
*/
public function __construct(
- \Magento\Backend\Block\Template\Context $context,
+ Context $context,
Config $config,
Data $helper,
OauthValidator $oauthValidator,
@@ -47,6 +52,7 @@ public function __construct(
/**
* Returns the class name based on API Creds validation
+ *
* @return string
*/
public function getCssClass()
@@ -58,20 +64,25 @@ public function getCssClass()
}
/**
+ * Get Button url
+ *
* @return string
*/
abstract protected function getButtonUrl();
/**
- * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
+ * Get HTML element
+ *
+ * @param AbstractElement $element
* @return string
- * @throws \Magento\Framework\Exception\LocalizedException
+ * @throws LocalizedException
*/
- public function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
+ public function _getElementHtml(AbstractElement $element)
{
- return $this->getLayout()
- ->createBlock(Button::class)
- ->setType('button')
+
+ $block = $this->getLayout()->createBlock(Button::class);
+ /** @var \Magento\Framework\View\Element\AbstractBlock $block */
+ return $block->setType('button')
->setLabel(__('Configure'))
->setOnClick(sprintf("window.open('%s','_blank')", $this->getButtonUrl()))
->setData('class', $this->getCssClass())
@@ -80,17 +91,20 @@ public function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractEle
/**
* Removes use Default Checkbox
- * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
+ *
+ * @param AbstractElement $element
* @return string
*/
- public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
+ public function render(AbstractElement $element)
{
$element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
return parent::render($element);
}
/**
- * @param $url
+ * Get Dotdigital authorised url
+ *
+ * @param string $url
* @return string
*/
protected function getEcAuthorisedUrl($url)
diff --git a/Block/Adminhtml/Config/Settings/ConfigureTeamsButton.php b/Block/Adminhtml/Config/Settings/ConfigureTeamsButton.php
index 025dc2a..d2dbb02 100644
--- a/Block/Adminhtml/Config/Settings/ConfigureTeamsButton.php
+++ b/Block/Adminhtml/Config/Settings/ConfigureTeamsButton.php
@@ -6,6 +6,7 @@ class ConfigureTeamsButton extends ButtonField
{
/**
* Returns the URL to Configure Chat Teams
+ *
* @return string
*/
protected function getButtonUrl()
diff --git a/Block/Adminhtml/Config/Settings/ConfigureWidgetButton.php b/Block/Adminhtml/Config/Settings/ConfigureWidgetButton.php
index 4aa9a3d..71d3875 100644
--- a/Block/Adminhtml/Config/Settings/ConfigureWidgetButton.php
+++ b/Block/Adminhtml/Config/Settings/ConfigureWidgetButton.php
@@ -6,6 +6,7 @@ class ConfigureWidgetButton extends ButtonField
{
/**
* Returns the Url to Configure Chat Widget
+ *
* @return string
*/
protected function getButtonUrl()
diff --git a/Block/Adminhtml/StudioChat.php b/Block/Adminhtml/StudioChat.php
index 1f9d688..1e1d06f 100644
--- a/Block/Adminhtml/StudioChat.php
+++ b/Block/Adminhtml/StudioChat.php
@@ -42,6 +42,7 @@ class StudioChat extends \Magento\Backend\Block\Template implements EngagementCl
/**
* StudioChat constructor.
+ *
* @param Context $context
* @param IntegrationSetupFactory $integrationSetupFactory
* @param Data $helper
@@ -64,6 +65,8 @@ public function __construct(
}
/**
+ * Get action url for chat
+ *
* @return string
* @throws \Magento\Framework\Exception\LocalizedException
*/
diff --git a/Controller/Adminhtml/Studio/Index.php b/Controller/Adminhtml/Studio/Index.php
index d5a1387..798910f 100644
--- a/Controller/Adminhtml/Studio/Index.php
+++ b/Controller/Adminhtml/Studio/Index.php
@@ -5,15 +5,22 @@
use Dotdigitalgroup\Chat\Model\Config;
use Dotdigitalgroup\Email\Helper\Data;
use Magento\Backend\App\Action;
+use Magento\Framework\Exception\LocalizedException;
+use Magento\Framework\View\Result\PageFactory;
-class Index extends \Magento\Backend\App\AbstractAction
+class Index extends Action
{
/**
* Authorization level of a basic admin session
*
* @see _isAllowed()
*/
- const ADMIN_RESOURCE = 'Dotdigitalgroup_Chat::config';
+ public const ADMIN_RESOURCE = 'Dotdigitalgroup_Chat::config';
+
+ /**
+ * @var PageFactory
+ */
+ protected $resultPageFactory;
/**
* @var Data
@@ -27,15 +34,19 @@ class Index extends \Magento\Backend\App\AbstractAction
/**
* Index constructor.
+ *
* @param Action\Context $context
+ * @param PageFactory $resultPageFactory
* @param Data $helper
* @param Config $config
*/
public function __construct(
Action\Context $context,
+ PageFactory $resultPageFactory,
Data $helper,
Config $config
) {
+ $this->resultPageFactory = $resultPageFactory;
$this->helper = $helper;
$this->config = $config;
parent::__construct($context);
@@ -43,14 +54,22 @@ public function __construct(
/**
* Execute method.
+ *
+ * @return \Magento\Framework\Controller\Result\Redirect|\Magento\Framework\View\Result\Page
+ * @throws LocalizedException
*/
public function execute()
{
if ($this->helper->isEnabled() && !$this->config->isChatEnabled()) {
- return $this->_redirect('adminhtml/system_config/edit/section/chat_api_credentials');
+ return $this->resultRedirectFactory
+ ->create()
+ ->setPath('adminhtml/system_config/edit/section/chat_api_credentials');
}
-
- $this->_view->loadLayout();
- $this->_view->renderLayout();
+ $resultPage = $this->resultPageFactory->create();
+ $resultPage
+ ->getConfig()
+ ->getTitle()
+ ->prepend(__('Chat Studio'));
+ return $resultPage;
}
}
diff --git a/Controller/Adminhtml/Studio/Team.php b/Controller/Adminhtml/Studio/Team.php
index de0d5e1..3850a73 100644
--- a/Controller/Adminhtml/Studio/Team.php
+++ b/Controller/Adminhtml/Studio/Team.php
@@ -3,41 +3,49 @@
namespace Dotdigitalgroup\Chat\Controller\Adminhtml\Studio;
use Magento\Backend\App\Action;
-use Dotdigitalgroup\Chat\Model\Config;
+use Magento\Framework\View\Result\Page;
+use Magento\Framework\View\Result\PageFactory;
-class Team extends \Magento\Backend\App\AbstractAction
+class Team extends Action
{
/**
* Authorization level of a basic admin session
*
* @see _isAllowed()
*/
- const ADMIN_RESOURCE = 'Dotdigitalgroup_Email::iframe';
+ public const ADMIN_RESOURCE = 'Dotdigitalgroup_Email::iframe';
/**
- * @var Config
+ * @var PageFactory
*/
- private $config;
+ protected $resultPageFactory;
/**
* Index constructor.
+ *
* @param Action\Context $context
- * @param Config $config
+ * @param PageFactory $resultPageFactory
*/
public function __construct(
Action\Context $context,
- Config $config
+ PageFactory $resultPageFactory
) {
- $this->config = $config;
+ $this->resultPageFactory = $resultPageFactory;
parent::__construct($context);
}
/**
* Execute method.
+ *
+ * @return Page
*/
public function execute()
{
- $this->_view->loadLayout();
- $this->_view->renderLayout();
+ $resultPage = $this->resultPageFactory->create();
+ $resultPage
+ ->getConfig()
+ ->getTitle()
+ ->prepend(__('Chat Team / Widget'));
+ return $resultPage;
}
}
diff --git a/Controller/Adminhtml/Studio/Widget.php b/Controller/Adminhtml/Studio/Widget.php
index 8ad08e8..d7f8483 100644
--- a/Controller/Adminhtml/Studio/Widget.php
+++ b/Controller/Adminhtml/Studio/Widget.php
@@ -3,41 +3,49 @@
namespace Dotdigitalgroup\Chat\Controller\Adminhtml\Studio;
use Magento\Backend\App\Action;
-use Dotdigitalgroup\Chat\Model\Config;
+use Magento\Framework\View\Result\Page;
+use Magento\Framework\View\Result\PageFactory;
-class Widget extends \Magento\Backend\App\AbstractAction
+class Widget extends Action
{
/**
* Authorization level of a basic admin session
*
* @see _isAllowed()
*/
- const ADMIN_RESOURCE = 'Dotdigitalgroup_Email::iframe';
+ public const ADMIN_RESOURCE = 'Dotdigitalgroup_Email::iframe';
/**
- * @var Config
+ * @var PageFactory
*/
- private $config;
+ protected $resultPageFactory;
/**
* Index constructor.
+ *
* @param Action\Context $context
- * @param Config $config
+ * @param PageFactory $resultPageFactory
*/
public function __construct(
Action\Context $context,
- Config $config
+ PageFactory $resultPageFactory
) {
- $this->config = $config;
+ $this->resultPageFactory = $resultPageFactory;
parent::__construct($context);
}
/**
* Execute method.
+ *
+ * @return Page
*/
public function execute()
{
- $this->_view->loadLayout();
- $this->_view->renderLayout();
+ $resultPage = $this->resultPageFactory->create();
+ $resultPage
+ ->getConfig()
+ ->getTitle()
+ ->prepend(__('Chat Studio / Widget'));
+ return $resultPage;
}
}
diff --git a/Controller/Profile/Index.php b/Controller/Profile/Index.php
index ff3da2e..42e865c 100644
--- a/Controller/Profile/Index.php
+++ b/Controller/Profile/Index.php
@@ -18,7 +18,7 @@ class Index extends Action
* Profile constructor
*
* @param Context $context
- * @param $chatProfile
+ * @param UpdateChatProfile $chatProfile
*/
public function __construct(
Context $context,
@@ -36,9 +36,10 @@ public function __construct(
public function execute()
{
$this->chatProfile->update($this->getRequest()->getParam('profileId'));
-
- return $this->getResponse()
- ->setHttpResponseCode(204)
- ->sendHeaders();
+ /** @var \Magento\Framework\HTTP\PhpEnvironment\Response $response */
+ $response = $this->getResponse();
+ $response->setHttpResponseCode(204);
+ $response->sendHeaders();
+ return $response;
}
}
diff --git a/CustomerData/Chat.php b/CustomerData/Chat.php
index 8e2fa6b..f2d36e1 100644
--- a/CustomerData/Chat.php
+++ b/CustomerData/Chat.php
@@ -10,6 +10,7 @@
use Magento\Store\Model\StoreManagerInterface;
use Magento\Framework\UrlInterface;
use Dotdigitalgroup\Email\Helper\Data;
+use Magento\TestFramework\Event\Magento;
class Chat implements SectionSourceInterface
{
diff --git a/Model/Api/LiveChatApiClient.php b/Model/Api/LiveChatApiClient.php
index f57121b..a4cff91 100644
--- a/Model/Api/LiveChatApiClient.php
+++ b/Model/Api/LiveChatApiClient.php
@@ -10,7 +10,6 @@
class LiveChatApiClient
{
-
/**
* Chat config
*
@@ -21,7 +20,7 @@ class LiveChatApiClient
/**
* Zend HTTP Client
*
- * @var HttpClientFactory
+ * @var ClientFactory
*/
private $httpClientFactory;
diff --git a/Model/Api/Requests/UpdateProfile.php b/Model/Api/Requests/UpdateProfile.php
index 363dcf6..9eda312 100644
--- a/Model/Api/Requests/UpdateProfile.php
+++ b/Model/Api/Requests/UpdateProfile.php
@@ -6,6 +6,7 @@
use Dotdigitalgroup\Chat\Model\Api\LiveChatRequestInterface;
use Dotdigitalgroup\Chat\Model\Config;
use Dotdigitalgroup\Email\Logger\Logger;
+use Zend\Http\Response;
use Zend\Http\Request;
class UpdateProfile implements LiveChatRequestInterface
@@ -43,18 +44,22 @@ public function __construct(
}
/**
+ * Send update profile request
+ *
* @param string $profileId
* @param array $data
- * @return \Zend\Http\Response
+ * @return void|\Zend_Http_Response
*/
public function send(string $profileId, array $data = [])
{
try {
- return $this->client->request(
+ /** @var \Zend_Http_Response $response */
+ $response = $this->client->request(
sprintf('apispaces/%s/profiles/%s', $this->config->getApiSpaceId(), $profileId),
Request::METHOD_PATCH,
$data
);
+ return $response;
} catch (\Magento\Framework\Exception\LocalizedException $e) {
$this->logger->debug($e->getMessage());
}
diff --git a/Model/Api/Token/JwtDecoder.php b/Model/Api/Token/JwtDecoder.php
index 7b1f850..258669d 100644
--- a/Model/Api/Token/JwtDecoder.php
+++ b/Model/Api/Token/JwtDecoder.php
@@ -25,11 +25,12 @@ public function __construct(
}
/**
+ * Converts JWT
+ *
* Converts JWT string into array (without supplying a key)
* in order to check the token expiry.
*
* @param string $jwt The JWT
- *
* @return array
* @throws \InvalidArgumentException
*/
@@ -56,7 +57,6 @@ public function decode(string $jwt): array
* Decode a string with URL-safe Base64.
*
* @param string $input A Base64 encoded string
- *
* @return string
*/
private function urlSafeB64Decode(string $input): string
diff --git a/Model/Api/Token/Token.php b/Model/Api/Token/Token.php
index f350819..035d59d 100644
--- a/Model/Api/Token/Token.php
+++ b/Model/Api/Token/Token.php
@@ -42,6 +42,8 @@ class Token
private $logger;
/**
+ * Token check delay
+ *
* We want to allow a small amount of time when checking the token expiry,
* to account for 'clock skew' or just the time the script takes to proceed
* from checking the token to actually making the API call.
@@ -77,6 +79,8 @@ public function __construct(
}
/**
+ * Get API token
+ *
* @return string|null
* @throws \Magento\Framework\Exception\LocalizedException
*/
@@ -109,11 +113,13 @@ public function getApiToken()
private function isNotExpired(int $expTimestamp)
{
$currentDate = $this->dateTimeFactory->create('now', new \DateTimeZone('UTC'));
-
+ /** @var \DateTime $currentDate */
return ($currentDate->getTimestamp() + $this->leeway) < $expTimestamp;
}
/**
+ * Refresh API token
+ *
* If our stored token is expired or has no expiry,
* re-route back to EC to retrieve a new token.
*
diff --git a/Model/Config.php b/Model/Config.php
index ea16cc8..99b2851 100644
--- a/Model/Config.php
+++ b/Model/Config.php
@@ -22,11 +22,9 @@ class Config
public const XML_PATH_LIVECHAT_API_SPACE_ID = 'chat_api_credentials/credentials/api_space_id';
public const XML_PATH_LIVECHAT_API_HOST = 'chat_api_credentials/settings/api_host';
public const XML_PATH_LIVECHAT_API_TOKEN = 'chat_api_credentials/credentials/api_token';
-
public const CHAT_PORTAL_URL = 'WebChat';
public const CHAT_CONFIGURE_TEAM_PATH = 'team/users/all';
public const CHAT_CONFIGURE_WIDGET_PATH = 'account/chat-settings';
-
public const MAGENTO_PROFILE_CALLBACK_ROUTE = 'ec_chat/profile?isAjax=true';
/**
diff --git a/Model/DotdigitalConfigInterface.php b/Model/DotdigitalConfigInterface.php
index 8d861d5..866dd52 100644
--- a/Model/DotdigitalConfigInterface.php
+++ b/Model/DotdigitalConfigInterface.php
@@ -4,7 +4,7 @@
interface DotdigitalConfigInterface
{
- const CONFIGURATION_PATHS = [
+ public const CONFIGURATION_PATHS = [
Config::XML_PATH_LIVECHAT_ENABLED
];
}
diff --git a/Model/EmailFlagManager.php b/Model/EmailFlagManager.php
index fe86303..8dafe16 100644
--- a/Model/EmailFlagManager.php
+++ b/Model/EmailFlagManager.php
@@ -24,7 +24,8 @@ class EmailFlagManager
private $emailFlagFactory;
/**
- * EmailFlagManager constructor
+ * EmailFlagManager constructor.
+ *
* @param EmailFlagResource $flagResource
* @param EmailFlagFactory $flagFactory
*/
@@ -37,6 +38,8 @@ public function __construct(
}
/**
+ * Fetch flag by code
+ *
* @param string $code The code of flag
* @return string|int|float|bool|array|null
*/
@@ -46,6 +49,8 @@ public function fetch($code)
}
/**
+ * Save flag by code
+ *
* @param string $code The code of flag
* @param string|int|float|bool|array|null $value The value of flag
* @return bool
@@ -60,6 +65,8 @@ public function save($code, $value)
}
/**
+ * Delete flag by code
+ *
* @param string $code The code of flag
* @return bool
*/
@@ -80,8 +87,8 @@ public function delete($code)
*/
private function getEmailFlagObject($code)
{
- /** @var EmailFlag $flag */
$this->emailFlagResource->load(
+ /** @var EmailFlag $flag */
$flag = $this->emailFlagFactory->create(['data' => ['flag_code' => $code]]),
$code,
'flag_code'
diff --git a/Model/Profile/Data.php b/Model/Profile/Data.php
index 11dbe56..c8b6bca 100644
--- a/Model/Profile/Data.php
+++ b/Model/Profile/Data.php
@@ -5,36 +5,40 @@
use Magento\Customer\Api\CustomerRepositoryInterface;
use Magento\Customer\Api\Data\CustomerInterface;
use Magento\Customer\Model\Session;
+use Magento\Framework\Exception\LocalizedException;
+use Magento\Framework\Exception\NoSuchEntityException;
+use Magento\Framework\UrlInterface;
use Magento\Quote\Api\CartRepositoryInterface;
use Magento\Quote\Api\Data\CartInterface;
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory;
use Magento\Store\Api\Data\StoreInterface;
+use Magento\Store\Model\Store;
use Magento\Store\Model\StoreManagerInterface;
class Data
{
/**
- * @var \Magento\Customer\Model\Session
+ * @var Session
*/
private $customerSession;
/**
- * @var \Magento\Customer\Api\CustomerRepositoryInterface
+ * @var CustomerRepositoryInterface
*/
private $customerRepository;
/**
- * @var \Magento\Quote\Api\CartRepositoryInterface
+ * @var CartRepositoryInterface
*/
private $quoteRepository;
/**
- * @var \Magento\Store\Model\StoreManagerInterface
+ * @var StoreManagerInterface
*/
private $storeManager;
/**
- * @var \Magento\Sales\Model\ResourceModel\Order\CollectionFactory
+ * @var CollectionFactory
*/
private $orderCollectionFactory;
@@ -65,8 +69,8 @@ public function __construct(
* Collects data for chat user
*
* @return array
- * @throws \Magento\Framework\Exception\LocalizedException
- * @throws \Magento\Framework\Exception\NoSuchEntityException
+ * @throws LocalizedException
+ * @throws NoSuchEntityException
*/
public function getDataForChatUser()
{
@@ -83,7 +87,7 @@ public function getDataForChatUser()
try {
$quote = $this->quoteRepository->getForCustomer($loggedInCustomerId);
- } catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
+ } catch (NoSuchEntityException $e) {
$quote = null;
}
@@ -93,7 +97,7 @@ public function getDataForChatUser()
/**
* Returns basic payload for all users
*
- * @param StoreInterface $store
+ * @param Store $store
* @return array
*/
private function getBasePayload(StoreInterface $store)
@@ -102,7 +106,7 @@ private function getBasePayload(StoreInterface $store)
"store" => [
"id" => $store->getId(),
"url" => $store->getBaseUrl(
- \Magento\Framework\UrlInterface::URL_TYPE_WEB,
+ UrlInterface::URL_TYPE_WEB,
true
)
],
@@ -116,7 +120,7 @@ private function getBasePayload(StoreInterface $store)
* @param CustomerInterface $customer
* @param CartInterface|null $quote
* @return array
- * @throws \Magento\Framework\Exception\NoSuchEntityException
+ * @throws NoSuchEntityException
*/
private function getCustomerPayload(StoreInterface $store, CustomerInterface $customer, CartInterface $quote = null)
{
diff --git a/Model/Profile/UpdateChatProfile.php b/Model/Profile/UpdateChatProfile.php
index 9598b25..0b9c5dd 100644
--- a/Model/Profile/UpdateChatProfile.php
+++ b/Model/Profile/UpdateChatProfile.php
@@ -23,6 +23,8 @@ class UpdateChatProfile
private $updateProfile;
/**
+ * UpdateChatProfile constructor.
+ *
* @param Data $data
* @param UpdateProfile $updateProfile
* @param Helper $helper
@@ -38,12 +40,15 @@ public function __construct(
}
/**
+ * Update
+ *
* @param string $profileId
* @param string|null $emailAddress
* @return void
*/
public function update(string $profileId, string $emailAddress = null)
{
+ $data = [];
try {
$data = $this->data->getDataForChatUser();
} catch (\Exception $e) {
diff --git a/Observer/Adminhtml/ChatStatusChanged.php b/Observer/Adminhtml/ChatStatusChanged.php
index 04fe832..2c81d93 100644
--- a/Observer/Adminhtml/ChatStatusChanged.php
+++ b/Observer/Adminhtml/ChatStatusChanged.php
@@ -5,7 +5,6 @@
use Dotdigitalgroup\Chat\Model\Config;
use Dotdigitalgroup\Email\Helper\Data;
use Magento\Backend\App\Action\Context;
-use Magento\Framework\App\Request\Http;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Exception\LocalizedException;
@@ -74,8 +73,9 @@ public function __construct(
public function execute(Observer $observer)
{
$website = $this->helper->getWebsiteForSelectedScopeInAdmin();
+
+ /** @var \Magento\Framework\App\Request\Http $request */
$request = $this->context->getRequest();
- /** @var Http $request */
$groups = $request->getPost('groups');
$enabled = $this->getEnabled($groups);
diff --git a/Observer/CustomerLogin.php b/Observer/CustomerLogin.php
index 6f9a0ea..6a4002d 100644
--- a/Observer/CustomerLogin.php
+++ b/Observer/CustomerLogin.php
@@ -3,6 +3,7 @@
namespace Dotdigitalgroup\Chat\Observer;
use Dotdigitalgroup\Chat\Model\Config;
+use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\RequestInterface;
use Dotdigitalgroup\Chat\Model\Profile\UpdateChatProfile;
@@ -26,6 +27,8 @@ class CustomerLogin implements ObserverInterface
private $cookieReader;
/**
+ * CustomerLogin constructor.
+ *
* @param RequestInterface $request
* @param UpdateChatProfile $chatProfile
* @param CookieReaderInterface $cookieReader
@@ -41,9 +44,11 @@ public function __construct(
}
/**
- * @param \Magento\Framework\Event\Observer $observer
+ * Run observer
+ *
+ * @param Observer $observer
*/
- public function execute(\Magento\Framework\Event\Observer $observer)
+ public function execute(Observer $observer)
{
$chatProfileId = $this->cookieReader->getCookie(Config::COOKIE_CHAT_PROFILE, null);
if ($chatProfileId) {
diff --git a/Plugin/ConfigProviderPlugin.php b/Plugin/ConfigProviderPlugin.php
index 65d34f5..97f1a51 100644
--- a/Plugin/ConfigProviderPlugin.php
+++ b/Plugin/ConfigProviderPlugin.php
@@ -16,6 +16,7 @@ class ConfigProviderPlugin
/**
* ConfigProviderPlugin constructor.
+ *
* @param ScopeConfigInterface $scopeConfig
*/
public function __construct(
@@ -25,8 +26,10 @@ public function __construct(
}
/**
+ * After get configuration by store ID
+ *
* @param DotdigitalConfig $subject
- * @param $result
+ * @param array $result
* @param string|int $storeId
* @return array
*/
diff --git a/Plugin/EmailcapturePlugin.php b/Plugin/EmailcapturePlugin.php
index dfea6d8..820030b 100644
--- a/Plugin/EmailcapturePlugin.php
+++ b/Plugin/EmailcapturePlugin.php
@@ -20,6 +20,8 @@ class EmailcapturePlugin
private $cookieReader;
/**
+ * EmailcapturePlugin constructor.
+ *
* @param UpdateChatProfile $chatProfile
* @param CookieReaderInterface $cookieReader
*/
@@ -32,6 +34,8 @@ public function __construct(
}
/**
+ * After email capture execute
+ *
* @param Emailcapture $emailcapture
*/
public function afterExecute(Emailcapture $emailcapture)
diff --git a/Plugin/ModulePlugin.php b/Plugin/ModulePlugin.php
index f7a53db..2064f04 100644
--- a/Plugin/ModulePlugin.php
+++ b/Plugin/ModulePlugin.php
@@ -6,8 +6,8 @@
class ModulePlugin
{
- const MODULE_NAME = 'Dotdigitalgroup_Chat';
- const MODULE_DESCRIPTION = 'Dotdigital Chat for Magento 2';
+ public const MODULE_NAME = 'Dotdigitalgroup_Chat';
+ public const MODULE_DESCRIPTION = 'Dotdigital Chat for Magento 2';
/**
* @var Module
@@ -15,6 +15,8 @@ class ModulePlugin
private $module;
/**
+ * ModulePlugin constructor.
+ *
* @param Module $module
*/
public function __construct(Module $module)
@@ -23,6 +25,8 @@ public function __construct(Module $module)
}
/**
+ * Before fetch active module details
+ *
* @param Module $module
* @param array $modules
* @return array
diff --git a/view/frontend/templates/include.phtml b/view/frontend/templates/include.phtml
index 336b21b..bbd4ba2 100644
--- a/view/frontend/templates/include.phtml
+++ b/view/frontend/templates/include.phtml
@@ -1,4 +1,6 @@
-
+