Skip to content

Commit 0686750

Browse files
committed
Add semicolumns to fix the bug fix with automated PHP downgrades
1 parent ff18ca0 commit 0686750

File tree

8 files changed

+38
-34
lines changed

8 files changed

+38
-34
lines changed

src/Settings/Blocks/CalloutBlock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function render(): void
1919
<div class="rounded-md bg-blue-50 p-4">
2020
<div class="flex">
2121
<div class="flex-shrink-0">
22-
<?php echo get_icon('info')->class('h-5 w-5 text-blue-400') ?>
22+
<?php echo get_icon('info')->class('h-5 w-5 text-blue-400'); ?>
2323
</div>
2424
<div class="ml-2.5 flex-1 md:flex md:justify-between">
2525
<p class="text-sm text-blue-700"><?php echo htmlspecialchars($this->text); ?></p>

src/Settings/Blocks/Fields/Checkbox.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,20 @@ public function render(): void
2929
<div class="relative flex gap-x-3">
3030
<div class="flex h-6 items-center">
3131
<input
32-
id="<?php echo esc_attr($this->getKey()) ?>"
33-
name="<?php echo esc_attr($this->getKey()) ?>"
32+
id="<?php echo esc_attr($this->getKey()); ?>"
33+
name="<?php echo esc_attr($this->getKey()); ?>"
3434
type="checkbox"
3535
value="1"
3636
class="h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"
37-
<?php if (Setting::get($this->getKey())) echo 'checked' ?>
37+
<?php if (Setting::get($this->getKey())) echo 'checked'; ?>
3838
>
3939
</div>
4040
<div class="text-sm leading-6">
41-
<?php (new LabelComponent(value: $this->getLabel(), docs: $this->docs, for: $this->getKey()))() ?>
41+
<?php (new LabelComponent(value: $this->getLabel(), docs: $this->docs, for: $this->getKey()))(); ?>
4242

4343
<?php if ($this->description): ?>
4444
<p class="text-gray-500">
45-
<?php echo esc_html($this->description) ?>
45+
<?php echo esc_html($this->description); ?>
4646
</p>
4747
<?php endif ?>
4848
</div>

src/Settings/Blocks/Fields/Checkboxes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function render(): void
4343
$currentValue = Setting::array($this->getKey());
4444
?>
4545
<fieldset>
46-
<?php (new LabelComponent(value: $this->getLabel(), docs: $this->docs, as: 'legend'))() ?>
46+
<?php (new LabelComponent(value: $this->getLabel(), docs: $this->docs, as: 'legend'))(); ?>
4747
<div class="mt-2 space-y-2">
4848
<?php foreach ($this->options as $value => $label): ?>
4949
<div class="relative flex items-start">
@@ -70,7 +70,7 @@ class="font-medium text-gray-900"
7070
</div>
7171
<?php if ($this->description): ?>
7272
<p class="mt-2 text-gray-500">
73-
<?php echo esc_html($this->description) ?>
73+
<?php echo esc_html($this->description); ?>
7474
</p>
7575
<?php endif ?>
7676
</fieldset>

src/Settings/Blocks/Fields/Input.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ public function getValueType(): string
3434
public function render(): void
3535
{
3636
?>
37-
<?php (new LabelComponent(value: $this->getLabel(), docs: $this->docs, for: $this->getKey()))() ?>
37+
<?php (new LabelComponent(value: $this->getLabel(), docs: $this->docs, for: $this->getKey()))(); ?>
3838
<input
39-
type="<?php echo esc_attr($this->type) ?>"
40-
name="<?php echo esc_attr($this->getKey()) ?>"
41-
id="<?php echo esc_attr($this->getKey()) ?>"
39+
type="<?php echo esc_attr($this->type); ?>"
40+
name="<?php echo esc_attr($this->getKey()); ?>"
41+
id="<?php echo esc_attr($this->getKey()); ?>"
4242
class="mt-2 block w-full rounded-md border-0 placeholder:text-gray-400 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 py-1.5 focus:ring-primary focus:ring-2 focus:ring-inset sm:max-w-md sm:text-sm sm:leading-6"
43-
placeholder="<?php echo esc_attr($this->placeholder) ?>"
44-
<?php if ($this->autofocus) echo "autofocus" ?>
45-
value="<?php echo esc_attr(Setting::get($this->getKey())) ?>"
43+
placeholder="<?php echo esc_attr($this->placeholder); ?>"
44+
<?php if ($this->autofocus) echo "autofocus"; ?>
45+
value="<?php echo esc_attr(Setting::get($this->getKey())); ?>"
4646
>
4747
<?php if ($this->description): ?>
4848
<p class="mt-2 text-sm text-gray-500">
49-
<?php echo esc_html($this->description) ?>
49+
<?php echo esc_html($this->description); ?>
5050
</p>
5151
<?php endif;
5252
}

src/Settings/Blocks/Fields/IpList.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,26 @@ public function render(): void
4343
$value = implode("\n", Setting::array($this->getKey()));
4444
$currentIp = $_SERVER['REMOTE_ADDR'];
4545
?>
46-
<?php (new LabelComponent(value: $this->getLabel(), docs: $this->docs, for: esc_attr($this->getKey())))() ?>
46+
<?php (new LabelComponent(
47+
value: $this->getLabel(),
48+
docs: $this->docs,
49+
for: esc_attr($this->getKey()))
50+
)(); ?>
4751
<div class="mt-2">
4852
<textarea
49-
name="<?php echo esc_attr($this->getKey()) ?>"
50-
id="<?php echo esc_attr($this->getKey()) ?>"
53+
name="<?php echo esc_attr($this->getKey()); ?>"
54+
id="<?php echo esc_attr($this->getKey()); ?>"
5155
rows="5"
5256
class="block w-full rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:py-1.5 sm:text-sm sm:leading-6"
5357
<?php if ($this->placeholder): ?>
54-
placeholder="<?php echo esc_attr($this->placeholder) ?>"
58+
placeholder="<?php echo esc_attr($this->placeholder); ?>"
5559
<?php endif ?>
56-
><?php echo esc_textarea($value) ?></textarea>
60+
><?php echo esc_textarea($value); ?></textarea>
5761
</div>
5862
<div class="mt-2">
5963
<button
6064
type="button"
61-
onclick="sa_textarea_add_value(this.form.elements['<?php echo esc_js($this->getKey()) ?>'], '<?php echo esc_js($currentIp) ?>')"
65+
onclick="sa_textarea_add_value(this.form.elements['<?php echo esc_js($this->getKey()); ?>'], '<?php echo esc_js($currentIp); ?>')"
6266
class="rounded bg-white px-2 py-1 text-xs font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50"
6367
>
6468
Add Current IP (<?php echo esc_html($currentIp); ?>)

src/Settings/Tab.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,24 +76,24 @@ public function render(): void
7676
<div class="sm:col-span-4">
7777
<?php if (isset($this->title)): ?>
7878
<h1 class="text-sm font-medium leading-6 text-gray-900">
79-
<?php echo esc_html($this->title) ?>
79+
<?php echo esc_html($this->title); ?>
8080
<?php if (isset($this->docs)): ?>
81-
<a href="<?php echo esc_url($this->docs) ?>" target="_blank"
81+
<a href="<?php echo esc_url($this->docs); ?>" target="_blank"
8282
class="text-primary">(docs)</a>
8383
<?php endif ?>
8484
</h1>
8585
<?php endif ?>
8686
<?php if (isset($this->description)): ?>
8787
<p class="mt-2 text-sm text-gray-500">
88-
<?php echo esc_html($this->description) ?>
88+
<?php echo esc_html($this->description); ?>
8989
</p>
9090
<?php endif ?>
9191
</div>
9292
<?php endif ?>
9393

9494
<?php foreach ($this->getBlocks() as $block): ?>
9595
<div class="sm:col-span-4">
96-
<?php $block->render() ?>
96+
<?php $block->render(); ?>
9797
</div>
9898
<?php endforeach ?>
9999
</div>

src/UI/PageLayoutComponent.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __invoke(): void
3030
<link rel="stylesheet" href="<?php echo PLUGIN_URL ?>build/css/settings.css">
3131
<form method="post" action="options.php">
3232
<!-- Hidden fields -->
33-
<?php settings_fields($this->page->getOptionGroup($currentTab)) ?>
33+
<?php settings_fields($this->page->getOptionGroup($currentTab)); ?>
3434

3535
<!-- Header / Nav -->
3636
<header class="pt-5 bg-primaryBg">
@@ -54,7 +54,7 @@ class="mr-2 inline-block h-10 w-auto text-primary"
5454
target="_blank"
5555
class="inline-flex items-center rounded bg-white px-2 py-1 text-xs font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50"
5656
>
57-
<?php echo get_icon('external')->class('w-3.5 h-3.5 mr-0.5') ?>
57+
<?php echo get_icon('external')->class('w-3.5 h-3.5 mr-0.5'); ?>
5858
Open Dashboard
5959
</a>
6060
</div>
@@ -65,15 +65,15 @@ class="inline-flex items-center rounded bg-white px-2 py-1 text-xs font-semibold
6565
pageSlug : $this->page->getSlug(),
6666
currentTab: $currentTab,
6767
tabs : $this->page->getTabs(),
68-
))() ?>
68+
))(); ?>
6969
</div>
7070
</div>
7171
</header>
7272

7373
<!-- Fields / Layout -->
7474
<div class="mx-auto max-w-3xl bg-white px-4 py-6 sm:px-4 lg:px-0">
7575
<div class="border-b border-gray-900/10 pb-7">
76-
<?php $currentTab->render() ?>
76+
<?php $currentTab->render(); ?>
7777
</div>
7878

7979
<div class="mt-6 flex items-center justify-start gap-x-6">

src/UI/TabListComponent.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public function __invoke(): void
2020
<nav class="-mb-px flex gap-5">
2121
<?php foreach ($this->tabs as $tab): ?>
2222
<a
23-
href="<?php echo $this->tabUrl($tab) ?>"
24-
class="<?php echo $this->tabClass($tab) ?>"
23+
href="<?php echo $this->tabUrl($tab); ?>"
24+
class="<?php echo $this->tabClass($tab); ?>"
2525
>
26-
<?php echo $this->tabIcon($tab) ?>
27-
<?php echo $tab->getName() ?>
26+
<?php echo $this->tabIcon($tab); ?>
27+
<?php echo $tab->getName(); ?>
2828
</a>
2929
<?php endforeach ?>
3030
</nav>

0 commit comments

Comments
 (0)