Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Deprecated Using ${var} in strings is deprecated, use {$var} instead #6244

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion app/DoctrineMigrations/Version20210412073123.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function up(Schema $schema): void
$env = file_get_contents($envFile);

$env = StringUtil::replaceOrAddEnv($env, [
'ECCUBE_ADMIN_DENY_HOSTS' => "'${denyHosts}'",
'ECCUBE_ADMIN_DENY_HOSTS' => "'{$denyHosts}'",
]);

file_put_contents($envFile, $env);
Expand Down
2 changes: 1 addition & 1 deletion codeception/_support/AcceptanceTester.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public function dontSeeElements($arrayOfSelector)
$result = array_filter($arrayOfSelector, function ($element) use ($self) {
$id = $element['id'];

return $self->executeJS("return document.getElementById('${id}') != null;");
return $self->executeJS("return document.getElementById('{$id}') != null;");
});
$this->assertTrue(empty($result));
}
Expand Down
2 changes: 1 addition & 1 deletion codeception/_support/Page/AbstractPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(\AcceptanceTester $I)
protected function goPage($url, $pageTitle = '')
{
$this->tester->amOnPage($url);
$this->tester->waitForJS("return location.pathname + location.search == '${url}'", 30);
$this->tester->waitForJS("return location.pathname + location.search == '{$url}'", 30);

return $this;
}
Expand Down
6 changes: 3 additions & 3 deletions codeception/_support/Page/Admin/ApiOauthPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public function 新規登録()

public function 削除($i)
{
$this->tester->click(['xpath' => "//*[@id=\"page_admin_api_oauth\"]/div[1]//table/tbody/tr[${i}]/td[6]/div/div/div[1]/a"]);
$this->tester->waitForElementVisible(['xpath' => "//*[@id=\"page_admin_api_oauth\"]/div[1]//table/tbody/tr[${i}]/td[6]//a[contains(@class, 'btn-ec-delete')]"]);
$this->tester->click(['xpath' => "//*[@id=\"page_admin_api_oauth\"]/div[1]//table/tbody/tr[${i}]/td[6]//a[contains(@class, 'btn-ec-delete')]"]);
$this->tester->click(['xpath' => "//*[@id=\"page_admin_api_oauth\"]/div[1]//table/tbody/tr[{$i}]/td[6]/div/div/div[1]/a"]);
$this->tester->waitForElementVisible(['xpath' => "//*[@id=\"page_admin_api_oauth\"]/div[1]//table/tbody/tr[{$i}]/td[6]//a[contains(@class, 'btn-ec-delete')]"]);
$this->tester->click(['xpath' => "//*[@id=\"page_admin_api_oauth\"]/div[1]//table/tbody/tr[{$i}]/td[6]//a[contains(@class, 'btn-ec-delete')]"]);
return $this;
}

Expand Down
6 changes: 3 additions & 3 deletions codeception/_support/Page/Admin/ApiWebHookPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ public function 新規登録()

public function 編集($i)
{
$this->tester->click(['xpath' => "//*[@id=\"page_admin_api_webhook\"]/div[1]/div[3]/div[2]/div/div/div[2]/div/table/tbody/tr[${i}]/td[3]//a[1]"]);
$this->tester->click(['xpath' => "//*[@id=\"page_admin_api_webhook\"]/div[1]/div[3]/div[2]/div/div/div[2]/div/table/tbody/tr[{$i}]/td[3]//a[1]"]);
return $this;
}

public function 削除($i)
{
$this->tester->click(['xpath' => "//*[@id=\"page_admin_api_webhook\"]/div[1]/div[3]/div[2]/div/div/div[2]/div/table/tbody/tr[${i}]/td[3]/div/div[2]//a[contains(@class, 'action-delete')]"]);
$this->tester->waitForElementVisible(['xpath' => "//*[@id=\"page_admin_api_webhook\"]/div[1]/div[3]/div[2]/div/div/div[2]/div/table/tbody/tr[${i}]/td[3]/div/div[2]//a[contains(@class, 'btn-ec-delete')]"]);
$this->tester->click(['xpath' => "//*[@id=\"page_admin_api_webhook\"]/div[1]/div[3]/div[2]/div/div/div[2]/div/table/tbody/tr[{$i}]/td[3]/div/div[2]//a[contains(@class, 'action-delete')]"]);
$this->tester->waitForElementVisible(['xpath' => "//*[@id=\"page_admin_api_webhook\"]/div[1]/div[3]/div[2]/div/div/div[2]/div/table/tbody/tr[{$i}]/td[3]/div/div[2]//a[contains(@class, 'btn-ec-delete')]"]);
$this->tester->click(['xpath' => "//*[@id=\"page_admin_api_webhook\"]/div[1]/div[3]/div[2]/div/div/div[2]/div/table/tbody/tr[${i}]/td[3]/div/div[2]//a[contains(@class, 'btn-ec-delete')]"]);
return $this;
}
Expand Down
8 changes: 4 additions & 4 deletions codeception/_support/Page/Admin/FileManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,26 @@ public function フォルダ作成()

public function ファイル名($rowNum)
{
return "#fileList table > tbody > tr:nth-child(${rowNum}) > td:nth-child(2)";
return "#fileList table > tbody > tr:nth-child({$rowNum}) > td:nth-child(2)";
}

public function 一覧_ダウンロード($rowNum)
{
$this->tester->click("#fileList table > tbody > tr:nth-child(${rowNum}) > td:nth-child(5) a.action-download");
$this->tester->click("#fileList table > tbody > tr:nth-child({$rowNum}) > td:nth-child(5) a.action-download");

return $this;
}

public function 一覧_表示($rowNum)
{
$this->tester->click("#fileList table > tbody > tr:nth-child(${rowNum}) > td:nth-child(5) a.action-view");
$this->tester->click("#fileList table > tbody > tr:nth-child({$rowNum}) > td:nth-child(5) a.action-view");

return $this;
}

public function 一覧_パスをコピー($rowNum)
{
$this->tester->click("#fileList table > tbody > tr:nth-child(${rowNum}) > td:nth-child(5) a.action-copy");
$this->tester->click("#fileList table > tbody > tr:nth-child({$rowNum}) > td:nth-child(5) a.action-copy");

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion codeception/_support/Page/Admin/LayoutEditPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function 登録()

public function ブロックを移動($blockName, $dest, $timeout = 10)
{
$this->tester->waitForElementVisible(['xpath' => "//div[contains(@id, 'detail_box__layout_item')][div[div[1][span[text()='${blockName}']]]]"], $timeout);
$this->tester->waitForElementVisible(['xpath' => "//div[contains(@id, 'detail_box__layout_item')][div[div[1][span[text()='{$blockName}']]]]"], $timeout);
$this->tester->dragAndDrop(['xpath' => "//div[contains(@id, 'detail_box__layout_item')][div[div[1][span[text()='${blockName}']]]]"], $dest);

return $this;
Expand Down
2 changes: 1 addition & 1 deletion codeception/_support/Page/Admin/NewsManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function 新規登録()

public function 一覧_編集($rowNum)
{
$this->tester->click(".c-contentsArea .list-group > li:nth-child(${rowNum}) a[data-bs-original-title=編集]");
$this->tester->click(".c-contentsArea .list-group > li:nth-child({$rowNum}) a[data-bs-original-title=編集]");

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion codeception/_support/Page/Admin/OrderEditPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function 商品検索($value = '')
public function 商品検索結果_選択($rowNum)
{
$rowNum = $rowNum * 2;
$this->tester->click(['css' => "#searchProductModalList > table > tbody > tr:nth-child(${rowNum}) > td.text-end > button"]);
$this->tester->click(['css' => "#searchProductModalList > table > tbody > tr:nth-child({$rowNum}) > td.text-end > button"]);
$this->tester->waitForElementNotVisible(['id' => 'searchProductModalList']);

return $this;
Expand Down
4 changes: 2 additions & 2 deletions codeception/_support/Page/Admin/TaxManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ public function 個別税率設定_登録()

public function 一覧_編集($rowNum)
{
$this->tester->click("table tbody tr:nth-child(${rowNum}) .edit-button");
$this->tester->click("table tbody tr:nth-child({$rowNum}) .edit-button");

return $this;
}

public function 一覧_削除($rowNum)
{
$this->tester->click("table tbody tr:nth-child(${rowNum}) > td.align-middle.action > div > div > div:nth-child(2) > div.d-inline-block.me-3 > a");
$this->tester->click("table tbody tr:nth-child({$rowNum}) > td.align-middle.action > div > div > div:nth-child(2) > div.d-inline-block.me-3 > a");

// accept modal
$this->tester->waitForElementVisible("table tbody tr:nth-child(${rowNum}) > td.align-middle.action > div > div > div:nth-child(2) > div.modal");
Expand Down
26 changes: 13 additions & 13 deletions codeception/acceptance/EA03ProductCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ public function product_商品の一括削除_正常(AcceptanceTester $I)

$createProduct = Fixtures::get('createProduct');
foreach (range(1, 5) as $i) {
$createProduct("一括削除用_${i}");
$createProduct("一括削除用_{$i}");
}
$ProductManagePage = ProductManagePage::go($I)
->検索('一括削除用')
Expand All @@ -534,35 +534,35 @@ public function product_商品の一括削除_削除エラー(AcceptanceTester $
$timestamp = time();
// 受注に紐付いていない商品と紐付いている商品を作成
foreach (range(1, 5) as $i) {
$createProduct("一括削除用_${timestamp}_受注なし_${i}");
$createProduct("一括削除用_{$timestamp}_受注なし_{$i}");
}
$Customer = (Fixtures::get('createCustomer'))();
foreach (range(1, 5) as $i) {
$Product = $createProduct("一括削除用_${timestamp}_受注あり_${i}");
$Product = $createProduct("一括削除用_{$timestamp}_受注あり_{$i}");
$createOrders($Customer, 1, $Product->getProductClasses()->toArray());
}

$ProductManagePage = ProductManagePage::go($I)
->検索("一括削除用_${timestamp}")
->検索("一括削除用_{$timestamp}")
->すべて選択();

$I->see('検索結果:10件が該当しました', ProductManagePage::$検索結果_メッセージ);
$I->see("一括削除用_${timestamp}_受注あり", ProductManagePage::$検索結果_一覧);
$I->see("一括削除用_${timestamp}_受注なし", ProductManagePage::$検索結果_一覧);
$I->see("一括削除用_{$timestamp}_受注あり", ProductManagePage::$検索結果_一覧);
$I->see("一括削除用_{$timestamp}_受注なし", ProductManagePage::$検索結果_一覧);

$ProductManagePage->完全に削除();

$I->see("一括削除用_${timestamp}_受注あり_1", ProductManagePage::$一括削除エラー);
$I->see("一括削除用_${timestamp}_受注あり_2", ProductManagePage::$一括削除エラー);
$I->see("一括削除用_${timestamp}_受注あり_3", ProductManagePage::$一括削除エラー);
$I->see("一括削除用_${timestamp}_受注あり_4", ProductManagePage::$一括削除エラー);
$I->see("一括削除用_${timestamp}_受注あり_5", ProductManagePage::$一括削除エラー);
$I->see("一括削除用_{$timestamp}_受注あり_1", ProductManagePage::$一括削除エラー);
$I->see("一括削除用_{$timestamp}_受注あり_2", ProductManagePage::$一括削除エラー);
$I->see("一括削除用_{$timestamp}_受注あり_3", ProductManagePage::$一括削除エラー);
$I->see("一括削除用_{$timestamp}_受注あり_4", ProductManagePage::$一括削除エラー);
$I->see("一括削除用_{$timestamp}_受注あり_5", ProductManagePage::$一括削除エラー);

$ProductManagePage->一括削除完了();

$I->see('検索結果:5件が該当しました', ProductManagePage::$検索結果_メッセージ);
$I->see("一括削除用_${timestamp}_受注あり", ProductManagePage::$検索結果_一覧);
$I->dontSee("一括削除用_${timestamp}_受注なし", ProductManagePage::$検索結果_一覧);
$I->see("一括削除用_{$timestamp}_受注あり", ProductManagePage::$検索結果_一覧);
$I->dontSee("一括削除用_{$timestamp}_受注なし", ProductManagePage::$検索結果_一覧);
}

public function product_規格登録_(AcceptanceTester $I)
Expand Down
10 changes: 5 additions & 5 deletions codeception/acceptance/EA08SysteminfoCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function systeminfo_システム情報(AcceptanceTester $I)
if ($config['eccube_phpinfo_enabled'] == 1) {
$I->see('PHP情報', '#php_info_box__header > div > span');
}

$I->expect('session.save_path をチェックします');
$I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/system/phpinfo');
$I->scrollTo('a[name=module_session]');
Expand Down Expand Up @@ -392,7 +392,7 @@ public function systeminfo_権限管理登録(AcceptanceTester $I)

// URL直でもアクセスできないことを確認
$config = Fixtures::get('config');
$I->amOnPage("/${config['eccube_admin_route']}/setting/system/member");
$I->amOnPage("/{$config['eccube_admin_route']}/setting/system/member");
$I->seeInTitle('アクセスできません');

// 設定を削除
Expand All @@ -412,7 +412,7 @@ public function systeminfo_権限管理登録(AcceptanceTester $I)
$I->wait(1);
$I->see('システム設定', '#nav-setting');

$I->amOnPage("/${config['eccube_admin_route']}/setting/system/member");
$I->amOnPage("/{$config['eccube_admin_route']}/setting/system/member");
$I->seeInTitle('メンバー管理');
}

Expand All @@ -435,7 +435,7 @@ public function systeminfo_権限管理追加(AcceptanceTester $I)

// アクセスして確認
$config = Fixtures::get('config');
$I->amOnPage("/${config['eccube_admin_route']}/content/news");
$I->amOnPage("/{$config['eccube_admin_route']}/content/news");
$I->seeInTitle('アクセスできません');
}

Expand All @@ -457,7 +457,7 @@ public function systeminfo_権限管理削除(AcceptanceTester $I)

// アクセスして確認
$config = Fixtures::get('config');
$I->amOnPage("/${config['eccube_admin_route']}/content/news");
$I->amOnPage("/{$config['eccube_admin_route']}/content/news");
$I->seeInTitle('コンテンツ管理');
}

Expand Down
6 changes: 3 additions & 3 deletions codeception/acceptance/EA10PluginCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ public function columnExists()
{
foreach ($this->columns as $column) {
list($tableName, $columnName) = explode('.', $column);
$exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '${tableName}' AND column_name = '${columnName}';")->fetch()['count'] == 1;
$exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '{$tableName}' AND column_name = '{$columnName}';")->fetch()['count'] == 1;
$this->I->assertTrue($exists, 'カラムがあるはず '.$column);
}
}
Expand All @@ -559,7 +559,7 @@ public function columnNotExists()
{
foreach ($this->columns as $column) {
list($tableName, $columnName) = explode('.', $column);
$exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '${tableName}' AND column_name = '${columnName}';")->fetch()['count'] == 1;
$exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '{$tableName}' AND column_name = '{$columnName}';")->fetch()['count'] == 1;
$this->I->assertFalse($exists, 'カラムがないはず '.$column);
}
}
Expand Down Expand Up @@ -767,7 +767,7 @@ public function アップデート()
protected function publishPlugin($fileName)
{
$dirname = str_replace('.tgz', '', $fileName);
$this->I->assertTrue(!!$this->I->compressPlugin($dirname, codecept_root_dir().'repos'), "公開できた ${fileName}");
$this->I->assertTrue(!!$this->I->compressPlugin($dirname, codecept_root_dir().'repos'), "公開できた {$fileName}");
}
}

Expand Down
2 changes: 1 addition & 1 deletion codeception/acceptance/EF01TopCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private function clearDoctrineCache()
// キャッシュを削除して表示できるようにする
$fs = new Symfony\Component\Filesystem\Filesystem();
foreach (['prod', 'codeception'] as $env) {
$cacheDir = __DIR__."/../../var/cache/${env}/pools";
$cacheDir = __DIR__."/../../var/cache/{$env}/pools";
if ($fs->exists($cacheDir)) {
$fs->remove($cacheDir);
}
Expand Down
12 changes: 6 additions & 6 deletions codeception/acceptance/Plugin/PL08ApiCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ public function OAuth(AcceptanceTester $I)
->入力_クライアントID('testclient')
->入力_クライアントシークレット('testsecret')
->入力_スコープread()
->入力_リダイレクトURI("${baseUrl}/callback")
->入力_リダイレクトURI("{$baseUrl}/callback")
->登録();

$I->amOnPage("/admin/authorize?response_type=code&client_id=testclient&redirect_uri=${baseUrl}/callback&scope=read&state=test");
$I->amOnPage("/admin/authorize?response_type=code&client_id=testclient&redirect_uri={$baseUrl}/callback&scope=read&state=test");
$I->click(['id' => 'oauth_authorization_approve']);

$redirectUrl = $I->grabFromCurrentUrl();
Expand All @@ -59,17 +59,17 @@ public function OAuth(AcceptanceTester $I)
'grant_type=authorization_code' +
'&client_id=testclient' +
'&client_secret=testsecret' +
'&redirect_uri=${baseUrl}/callback' +
'&code=${code}'
'&redirect_uri={$baseUrl}/callback' +
'&code={$code}'
});
return await res.json();
");

$url = '/api?query={ product(id: 1) { id, name } }';
$data = $I->executeJS("
res = await fetch('${url}', {
res = await fetch('{$url}', {
headers: {
'Authorization': 'Bearer ${tokens['access_token']}'
'Authorization': 'Bearer {$tokens['access_token']}'
}
});
return await res.json();
Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Command/DeleteCartsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected function deleteCarts(\DateTime $dateTime)
$this->entityManager->flush();
$this->entityManager->commit();

$this->io->comment("Deleted ${deleteRows} carts.");
$this->io->comment("Deleted {$deleteRows} carts.");
} catch (\Exception $e) {
$this->io->error('Failed delete carts. Rollbacked.');
$this->entityManager->rollback();
Expand Down
Loading
Loading