Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,16 @@ php-scoper-dump-autoload:
php-scoper-fix-autoload:
php fix-autoload.php

# segmentio/analytics-php is a non-scoped (psr0) lib shipped as-is: rewrite the
# deprecated "${var}" string interpolation (deprecated PHP 8.2, fatal PHP 9.0)
# into "{$var}". Runs on the freshly installed vendor, before bundling.
vendor-patch-segmentio:
@echo "patching segmentio interpolation deprecations (PHP 8.2+/9.0)..."
find ./vendor/segmentio/analytics-php/lib -type f -name '*.php' -exec \
sed -i -E 's/\$$\{([a-zA-Z_][a-zA-Z0-9_]*)\}/{$$\1}/g' {} \;

#php-scoper: php-scoper-add-prefix php-scoper-update-prefix php-scoper-dump-autoload php-scoper-fix-autoload
php-scoper: php-scoper-add-prefix php-scoper-dump-autoload php-scoper-fix-autoload
php-scoper: php-scoper-add-prefix vendor-patch-segmentio php-scoper-dump-autoload php-scoper-fix-autoload

##########
# BUNDLING
Expand Down
10 changes: 5 additions & 5 deletions src/Account/Session/ShopSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,22 @@ public function __construct(
/**
* @param bool $forceRefresh
* @param bool $throw
* @param array|null $scope
* @param array|null $audience
* @param array $scope
* @param array $audience
*
* @return Token
*
* @throws RefreshTokenException
*/
public function getValidToken($forceRefresh = false, $throw = true, array $scope = null, array $audience = null)
public function getValidToken($forceRefresh = false, $throw = true, array $scope = [], array $audience = [])
{
if ($scope === null) {
if (empty($scope)) {
$scope = ($this->getStatusManager()->identityVerified() ? [
'shop.verified',
] : []);
}

if ($audience === null) {
if (empty($audience)) {
$audience = [
'store/' . $this->getStatusManager()->getCloudShopId(),
$this->tokenAudience,
Expand Down
4 changes: 2 additions & 2 deletions src/Account/StatusManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function invalidateCache()
*
* @return bool
*/
public function cacheInvalidated(CachedShopStatus $cachedStatus = null)
public function cacheInvalidated($cachedStatus = null)
{
try {
$cachedStatus = $cachedStatus ?: $this->getCachedStatus();
Expand All @@ -206,7 +206,7 @@ public function cacheInvalidated(CachedShopStatus $cachedStatus = null)
*
* @return bool
*/
public function cacheExpired(CachedShopStatus $cachedStatus = null, $cacheTtl = self::CACHE_TTL)
public function cacheExpired($cachedStatus = null, $cacheTtl = self::CACHE_TTL)
{
try {
//$dateUpd = $this->getCacheDateUpd();
Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Link
*/
public function __construct(
ShopContext $shopContext,
\Link $link = null
$link = null
) {
if (null === $link) {
$link = new \Link();
Expand Down
2 changes: 1 addition & 1 deletion src/Repository/ConfigurationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ConfigurationRepository
*
* @throws \Exception
*/
public function __construct(Configuration $configuration = null)
public function __construct($configuration = null)
{
$this->configuration = $configuration;
}
Expand Down
Loading