Skip to content

Commit

Permalink
chore: Apply rector changes
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnynotsolucky committed Sep 23, 2024
1 parent 546cf98 commit 9cff423
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/fields/ListField.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getInputHtml(mixed $value, ?ElementInterface $element = null): s
public function normalizeValue(mixed $value, ?ElementInterface $element = null): mixed
{
if ($value) {
$o = json_decode($value);
$o = json_decode((string) $value);
if ($o) {
$value = $o->id;
}
Expand Down
2 changes: 1 addition & 1 deletion src/fields/ListsField.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getInputHtml(mixed $value, ?ElementInterface $element = null): s
public function normalizeValue(mixed $value, ?ElementInterface $element = null): mixed
{
if ($value && ! is_array($value)) {
$o = json_decode($value, false, 512, JSON_THROW_ON_ERROR);
$o = json_decode((string) $value, false, 512, JSON_THROW_ON_ERROR);
$newValues = [];
if (is_array($o)) {
foreach ($o as $val) {
Expand Down
2 changes: 1 addition & 1 deletion src/services/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract class Base extends Component

protected function getSetting(string $name): mixed
{
if ($this->settings === null) {
if (! $this->settings instanceof Settings) {
/** @var Settings $settings */
$settings = Plugin::getInstance()->getSettings();
$this->settings = $settings;
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/KCUtilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static function id(): string
* @version v1.0.0 Monday, May 23rd, 2022.
* @access public static
*/
public static function iconPath(): string
public static function icon(): string
{
return Craft::getAlias('@fostercommerce/klaviyoconnect/icon-mask.svg');
}
Expand Down
2 changes: 1 addition & 1 deletion src/variables/Variable.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function lists(): mixed
} catch (RequestException $e) {
try {
$response = json_decode(
$e->getResponse()?->getBody()->getContents(),
(string) $e->getResponse()?->getBody()->getContents(),
false,
512, // default
JSON_THROW_ON_ERROR
Expand Down

0 comments on commit 9cff423

Please sign in to comment.