Skip to content

Commit

Permalink
code fix with php-cs-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nahid committed Sep 11, 2023
1 parent f736064 commit 6410733
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 0 additions & 2 deletions src/Actions/InstallShop.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public function __construct(
*/
public function __invoke(ShopDomain $shopDomain, ?string $code): array
{

if (!$this->isValidShop($shopDomain)) {
return [
'completed' => false,
Expand Down Expand Up @@ -135,5 +134,4 @@ public function isValidShop(ShopDomain $shopDomain): bool

return $isMatched === 1;
}

}
4 changes: 2 additions & 2 deletions src/Http/Middleware/IframeProtection.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ function () use ($request) {
? $shop->name
: '*.myshopify.com';

$iframeAncestors = "frame-ancestors https://admin.shopify.com https://$domain";
$iframeAncestors = "frame-ancestors https://$domain https://admin.shopify.com";

if (!blank($ancestors)) {
$iframeAncestors .= ' ' . $ancestors;
$iframeAncestors .= ' '.$ancestors;
}

$response->headers->set(
Expand Down
4 changes: 3 additions & 1 deletion src/Http/Middleware/VerifyShopify.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function __construct(
* @param Request $request The request object.
* @param Closure $next The next action.
*
* @throws SignatureVerificationException If HMAC verification fails.
* @throws SignatureVerificationException|HttpException If HMAC verification fails.
*
* @return mixed
*/
Expand All @@ -107,6 +107,7 @@ public function handle(Request $request, Closure $next)

if ($storeResult) {
$this->loginFromShop($shop);

return $next($request);
}
}
Expand Down Expand Up @@ -533,6 +534,7 @@ protected function getShopIfAlreadyInstalled(Request $request): ?ShopModel
* Login and validate store
*
* @param ShopModel $shop
*
* @return void
*/
protected function loginFromShop(ShopModel $shop): void
Expand Down
8 changes: 4 additions & 4 deletions src/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static function createHmac(array $opts, string $secret): Hmac
ksort($data);
$queryCompiled = [];
foreach ($data as $key => $value) {
$queryCompiled[] = "{$key}=" . (is_array($value) ? implode(',', $value) : $value);
$queryCompiled[] = "{$key}=".(is_array($value) ? implode(',', $value) : $value);
}
$data = implode(
$buildQueryWithJoin ? '&' : '',
Expand Down Expand Up @@ -72,7 +72,7 @@ public static function parseQueryString(string $queryString, string $delimiter =

$params = [];
$split = preg_split(
$delimiter ? $commonSeparator[$delimiter] || '/[' . $delimiter . ']\s*/' : $defaultSeparator,
$delimiter ? $commonSeparator[$delimiter] || '/['.$delimiter.']\s*/' : $defaultSeparator,
$queryString ?? ''
);

Expand Down Expand Up @@ -229,7 +229,7 @@ public static function getShopsTable(): string
*/
public static function getShopsTableForeignKey(): string
{
return Str::singular(self::getShopsTable()) . '_id';
return Str::singular(self::getShopsTable()).'_id';
}

/**
Expand All @@ -251,6 +251,6 @@ public static function hasAppLegacySupport(string $feature): bool
{
$legacySupports = self::getShopifyConfig('app_legacy_supports') ?? [];

return (bool)Arr::get($legacySupports, $feature, true);
return (bool) Arr::get($legacySupports, $feature, true);
}
}
12 changes: 6 additions & 6 deletions src/resources/config/shopify-app.php
Original file line number Diff line number Diff line change
Expand Up @@ -539,26 +539,26 @@
*/

'theme_support' => [
/**
/*
* Specify the name of the template the app will integrate with
*/
'templates' => ['product', 'collection', 'index'],
/**
/*
* Interval for caching the request: minutes, seconds, hours, days, etc.
*/
'cache_interval' => 'hours',
/**
/*
* Cache duration
*/
'cache_duration' => '12',
/**
/*
* At which levels of theme support the use of "theme app extension" is not available
* and script tags will be installed.
* Available levels: FULL, PARTIAL, UNSUPPORTED.
*/
'unacceptable_levels' => [
Osiset\ShopifyApp\Objects\Enums\ThemeSupportLevel::UNSUPPORTED
]
Osiset\ShopifyApp\Objects\Enums\ThemeSupportLevel::UNSUPPORTED,
],
],

/*
Expand Down

0 comments on commit 6410733

Please sign in to comment.