Skip to content

Commit

Permalink
Merge pull request #155 from gigya/develop
Browse files Browse the repository at this point in the history
6.2.0
  • Loading branch information
Ynhockey authored Jul 11, 2024
2 parents 1214c3c + 624a48a commit 71cbd01
Show file tree
Hide file tree
Showing 68 changed files with 1,070 additions and 953 deletions.
4 changes: 2 additions & 2 deletions Api/GigyaAccountRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ interface GigyaAccountRepositoryInterface
* @throws GSApiException If error encountered on service call or functional error returned by service.
* Check error code to identify the case.
*/
public function update($gigyaAccount);
public function update(GigyaUser $gigyaAccount);

/**
* Get a Gigya customer account.
*
* @param string $uid
* @return GigyaUser
*/
public function get($uid);
public function get(string $uid): GigyaUser;
}
6 changes: 3 additions & 3 deletions Api/GigyaAccountServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ interface GigyaAccountServiceInterface
* @throws GSApiException If error encountered on service call or functional error returned by service.
* Check error code to identify the case.
*/
public function update($gigyaAccount);
public function update(GigyaUser $gigyaAccount);

/**
* Get a Gigya customer account.
*
* @param string $uid
* @return GigyaUser
*/
public function get($uid);
public function get(string $uid): GigyaUser;

/**
* Update the Gigya service with the latest successfully updated version of an account.
Expand All @@ -51,5 +51,5 @@ public function get($uid);
* @param $uid string
* @return GigyaUser null if the rollback failed or if the given uid has not been updated so far (thus nothing to roll back)
*/
public function rollback($uid);
public function rollback(string $uid): GigyaUser;
}
17 changes: 9 additions & 8 deletions Block/Account/Dashboard/GigyaInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@

namespace Gigya\GigyaIM\Block\Account\Dashboard;

use \Magento\Customer\Block\Account\Dashboard\Info;
use \Gigya\GigyaIM\Model\Config;
use \Magento\Framework\View\Element\Template\Context;
use \Magento\Customer\Helper\Session\CurrentCustomer;
use \Magento\Newsletter\Model\SubscriberFactory;
use \Magento\Customer\Helper\View;
use Magento\Customer\Block\Account\Dashboard\Info;
use Gigya\GigyaIM\Model\Config;
use Magento\Framework\View\Element\Template\Context;
use Magento\Customer\Helper\Session\CurrentCustomer;
use Magento\Newsletter\Model\SubscriberFactory;
use Magento\Customer\Helper\View;

/**
* Class Info
*
* @package Gigya\GigyaIM\Block\Account\Dashboard
* @api
*/
class GigyaInfo extends Info
{
Expand Down Expand Up @@ -49,15 +50,15 @@ public function __construct(
/**
* @return string
*/
public function getProfileDesktopScreensetId()
public function getProfileDesktopScreensetId(): string
{
return $this->configModel->getProfileDesktopScreensetId();
}

/**
* @return string
*/
public function getProfileMobileScreensetId()
public function getProfileMobileScreensetId(): string
{
return $this->configModel->getProfileMobileScreensetId();
}
Expand Down
18 changes: 13 additions & 5 deletions Block/Adminhtml/Customer/Edit/Tab/View/GigyaUID.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@

namespace Gigya\GigyaIM\Block\Adminhtml\Customer\Edit\Tab\View;

use Magento\Backend\Block\Template;
use Magento\Customer\Api\Data\CustomerInterface;
use Magento\Customer\Block\Adminhtml\Edit\Tab\View\PersonalInfo;

class GigyaUID extends \Magento\Backend\Block\Template
/**
* Class GigyaUID
*
* @package Gigya\GigyaIM\Block\Adminhtml\Customer\Edit\Tab\View
* @api
*/
class GigyaUID extends Template
{
/**
* Extract the Gigya ID from the customer present in the parent block.
*
* @return bool|string
*/
public function getGUIDFromParentBlock()
public function getGUIDFromParentBlock(): bool|string
{
$customer = $this->getCustomerFromParentBlock();
if ($customer) {
Expand All @@ -27,12 +35,12 @@ public function getGUIDFromParentBlock()
/**
* Extract the current customer from the parent block.
*
* @return bool|\Magento\Customer\Api\Data\CustomerInterface
* @return bool|CustomerInterface
*/
protected function getCustomerFromParentBlock()
protected function getCustomerFromParentBlock(): bool|CustomerInterface
{
$parentBlock = $this->getParentBlock();
if ($parentBlock && $parentBlock instanceof PersonalInfo) {
if ($parentBlock instanceof PersonalInfo) {
return $parentBlock->getCustomer();
}

Expand Down
4 changes: 2 additions & 2 deletions Block/Adminhtml/Form/AdditionalScreenSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class AdditionalScreenSet extends AbstractFieldArray
{
private $_checkboxRenderer;
private Checkbox $_checkboxRenderer;

public function __construct(Context $context, Checkbox $checkboxRenderer)
{
Expand All @@ -20,7 +20,7 @@ public function __construct(Context $context, Checkbox $checkboxRenderer)
/**
* {@inheritdoc}
*/
protected function _prepareToRender()
protected function _prepareToRender(): void
{
$this->addColumn('desktop_screen', ['label' => __('Screen-Set ID'), 'class' => 'required-entry', 'renderer' => false]);
$this->addColumn('mobile_screen', ['label' => __('Mobile Screen-Set ID'), 'renderer' => false]);
Expand Down
2 changes: 1 addition & 1 deletion Block/Adminhtml/Form/EmptyTextarea.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class EmptyTextarea extends Field
{
protected function _getElementHtml(AbstractElement $element)
protected function _getElementHtml(AbstractElement $element): string
{
$value = $element->getEscapedValue();
$label = $element->getLabel() ?? 'Value';
Expand Down
4 changes: 2 additions & 2 deletions Block/Adminhtml/System/Config/View/Checkbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class Checkbox extends AbstractBlock
{
protected function _toHtml()
protected function _toHtml(): string
{
$elementId = $this->getInputId();
$elementName = $this->getInputName();
Expand All @@ -17,7 +17,7 @@ protected function _toHtml()
'name="' . $elementName . '" data-column="' . $columnName . '"' .
'value="1" ' .
($column['size'] ? 'size="' . $column['size'] . '"' : '') .
' class="' . (isset($column['class']) ? $column['class'] : 'input-text') . '"' .
' class="' . ($column['class'] ?? 'input-text') . '"' .
(isset($column['style']) ? ' style="' . $column['style'] . '"' : '') . '/>';
}
}
18 changes: 10 additions & 8 deletions Block/Form/GigyaAuthenticationPopup.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

namespace Gigya\GigyaIM\Block\Form;

use \Magento\Customer\Block\Account\AuthenticationPopup;
use \Magento\Framework\View\Element\Template\Context;
use \Magento\Framework\Serialize\Serializer\Json;
use \Gigya\GigyaIM\Model\Config;
use Magento\Customer\Block\Account\AuthenticationPopup;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\View\Element\Template\Context;
use Magento\Framework\Serialize\Serializer\Json;
use Gigya\GigyaIM\Model\Config;

/**
* Class Login
Expand All @@ -20,7 +21,7 @@ class GigyaAuthenticationPopup extends AuthenticationPopup
/**
* @var Config
*/
protected $config;
protected Config $config;

/**
* GigyaAuthenticationPopup constructor.
Expand All @@ -43,23 +44,24 @@ public function __construct(
/**
* @return string
*/
public function getLoginDesktopScreensetId()
public function getLoginDesktopScreensetId(): string
{
return $this->config->getLoginDesktopScreensetId();
}

/**
* @return string
*/
public function getLoginMobileScreensetId()
public function getLoginMobileScreensetId(): string
{
return $this->config->getLoginMobileScreensetId();
}

/**
* @return string
* @throws LocalizedException
*/
public function _toHtml()
public function _toHtml(): string
{

if ($this->config->isGigyaEnabled()) {
Expand Down
23 changes: 12 additions & 11 deletions Block/Form/GigyaLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@

namespace Gigya\GigyaIM\Block\Form;

use \Magento\Customer\Block\Form\Login;
use \Gigya\GigyaIM\Model\Config;
use Magento\Customer\Block\Form\Login;
use Gigya\GigyaIM\Model\Config;
use Magento\Framework\Exception\LocalizedException;
use \Magento\Framework\View\Element\Template\Context;
use \Magento\Customer\Model\Session;
use \Magento\Customer\Model\Url;
use Magento\Framework\View\Element\Template\Context;
use Magento\Customer\Model\Session;
use Magento\Customer\Model\Url;

/**
* Class Login
*
* @package Gigya\GigyaIM\Block\Form
* @api
*/
class GigyaLogin extends Login
{
/**
* @var Config
*/
protected $configModel;
protected Config $configModel;

/**
* Login constructor.
Expand All @@ -47,25 +48,25 @@ public function __construct(
/**
* @return string
*/
public function getLoginDesktopScreensetId()
public function getLoginDesktopScreensetId(): string
{
return $this->configModel->getLoginDesktopScreensetId();
return (string)$this->configModel->getLoginDesktopScreensetId();
}

/**
* @return string
*/
public function getLoginMobileScreensetId()
public function getLoginMobileScreensetId(): string
{
return $this->configModel->getLoginMobileScreensetId();
return (string)$this->configModel->getLoginMobileScreensetId();
}

/**
* @return string
*
* @throws LocalizedException
*/
public function _toHtml()
public function _toHtml(): string
{
if ($this->configModel->isGigyaEnabled()) {
$this->getLayout()->unsetElement('customer.login.container');
Expand Down
29 changes: 15 additions & 14 deletions Block/Form/GigyaRegister.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,30 @@

namespace Gigya\GigyaIM\Block\Form;

use \Magento\Customer\Block\Form\Register;
use \Gigya\GigyaIM\Model\Config as GigyaConfig;
use \Magento\Framework\View\Element\Template\Context;
use \Magento\Directory\Helper\Data;
use \Magento\Framework\Json\EncoderInterface;
use \Magento\Framework\App\Cache\Type\Config;
use \Magento\Directory\Model\ResourceModel\Region\CollectionFactory as RegionCollectionFactory;
use \Magento\Directory\Model\ResourceModel\Country\CollectionFactory as CountryCollectionFactory;
use \Magento\Framework\Module\Manager;
use \Magento\Customer\Model\Session;
use \Magento\Customer\Model\Url;
use Magento\Customer\Block\Form\Register;
use Gigya\GigyaIM\Model\Config as GigyaConfig;
use Magento\Framework\View\Element\Template\Context;
use Magento\Directory\Helper\Data;
use Magento\Framework\Json\EncoderInterface;
use Magento\Framework\App\Cache\Type\Config;
use Magento\Directory\Model\ResourceModel\Region\CollectionFactory as RegionCollectionFactory;
use Magento\Directory\Model\ResourceModel\Country\CollectionFactory as CountryCollectionFactory;
use Magento\Framework\Module\Manager;
use Magento\Customer\Model\Session;
use Magento\Customer\Model\Url;

/**
* Class Register
*
* @package Gigya\GigyaIM\Block\Form
* @api
*/
class GigyaRegister extends Register
{
/**
* @var GigyaConfig
*/
protected $configModel;
protected GigyaConfig $configModel;

/**
* Register constructor.
Expand Down Expand Up @@ -75,15 +76,15 @@ public function __construct(
/**
* @return string
*/
public function getLoginDesktopScreensetId()
public function getLoginDesktopScreensetId(): string
{
return $this->configModel->getLoginDesktopScreensetId();
}

/**
* @return string
*/
public function getLoginMobileScreensetId()
public function getLoginMobileScreensetId(): string
{
return $this->configModel->getLoginMobileScreensetId();
}
Expand Down
Loading

0 comments on commit 71cbd01

Please sign in to comment.