Skip to content

Commit

Permalink
fixed phpcs errors
Browse files Browse the repository at this point in the history
  • Loading branch information
BeycanDeveloper committed Apr 4, 2024
1 parent 614ca7e commit b52d6bb
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/PluginHero/Helpers/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ public static function getPluginData(string $file): object

$pluginData = (object) get_plugin_data($file);

if (!isset($pluginData->Slug)) {
$pluginData->Slug = self::getPluginSlug($file);
if (!isset($pluginData->Slug)) { // phpcs:ignore
$pluginData->Slug = self::getPluginSlug($file); // phpcs:ignore
}

return $pluginData;
Expand Down
4 changes: 2 additions & 2 deletions app/PluginHero/Helpers/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ public static function parseJson(string $jsonString, bool $array = false): objec
*/
public static function catchShortcode(string $content): string
{
global $shortcode_tags;
$tagNames = array_keys($shortcode_tags);
global $shortcode_tags; // phpcs:ignore
$tagNames = array_keys($shortcode_tags); // phpcs:ignore
$tagRegexp = join('|', array_map('preg_quote', $tagNames));

// WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcodes()
Expand Down
2 changes: 1 addition & 1 deletion app/PluginHero/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(array $properties)
'phDir' => $phDir,
'phVersion' => '0.6.0',
'pluginData' => $pluginData,
'pluginVersion' => $pluginData->Version,
'pluginVersion' => $pluginData->Version, // phpcs:ignore
'pluginUrl' => plugin_dir_url($properties['pluginFile']),
'pluginDir' => plugin_dir_path($properties['pluginFile']),
]);
Expand Down
4 changes: 3 additions & 1 deletion app/PluginHero/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ public static function has(string $key): bool
public static function remove(string $key): void
{
self::start();
unset($_SESSION[Helpers::getProp('pluginKey')][$key]);
if (self::has($key)) {
unset($_SESSION[Helpers::getProp('pluginKey')][$key]);
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions app/PluginHero/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ private function prepare(): void

$this->items = array_slice($this->dataList, 0, $this->perPage);

// phpcs:ignore
$this->_column_headers = [$this->columns, [], $this->sortableColumns];
}

Expand Down
1 change: 1 addition & 0 deletions app/Types/AbstractType.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public static function fromObject(?stdClass $obj): self
}
} elseif ('DateTime' == $propertyType) {
if (is_object($propertyValue)) {
// @phpcs:ignore
$propertyValue = $propertyValue->date ?? $propertyValue->date_time ?? null;
}
$property->setValue($instance, new \DateTime($propertyValue));
Expand Down
1 change: 1 addition & 0 deletions app/WooCommerce/Gateway/CryptoPay.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

// @phpcs:disable Squiz.NamingConventions.ValidVariableName
// @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
// @phpcs:disable SlevomatCodingStandard.TypeHints.ParameterTypeHint

Expand Down

0 comments on commit b52d6bb

Please sign in to comment.