Skip to content

Commit

Permalink
fix: license display
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubmikita committed Nov 7, 2024
1 parent 6adfccc commit d57f760
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ Yes! We're offering a [custom plugin development](https://bracketspace.com/custo

== Changelog ==

= [Next] =
* [Fixed] No license activated in v8 being displayed in the admin.

= 9.0.2 =
* [Fixed] WP CLI add command function is not giving warnings anymore.
* [Fixed] Comment author email and display name merge tags.
Expand Down
13 changes: 9 additions & 4 deletions src/Core/License.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,21 @@ public function getLicenses()
*/
public function get()
{
$driver = new CacheDriver\ObjectCache('notification_license');
$driver = new CacheDriver\ObjectCache('notification_license/v2');
$cache = new Cache($driver, $this->extension['slug']);

return $cache->collect(
function () {
$licenses = $this->getLicenses();
$license = false;
$license = new \stdClass();

if ( ! isset($licenses[$this->extension['slug']])) {
return false;
}

if (isset($licenses[$this->extension['slug']])) {
$license = $licenses[$this->extension['slug']];
foreach ($licenses[$this->extension['slug']] as $key => $value) {

Check failure on line 80 in src/Core/License.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3)

Argument of an invalid type mixed supplied for foreach, only iterables are supported.

Check failure on line 80 in src/Core/License.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1)

Argument of an invalid type mixed supplied for foreach, only iterables are supported.

Check failure on line 80 in src/Core/License.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2)

Argument of an invalid type mixed supplied for foreach, only iterables are supported.

Check failure on line 80 in src/Core/License.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0)

Argument of an invalid type mixed supplied for foreach, only iterables are supported.

Check failure on line 80 in src/Core/License.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4)

Argument of an invalid type mixed supplied for foreach, only iterables are supported.
$keyMapped = lcfirst(str_replace('_', '', ucwords($key, '_')));

Check failure on line 81 in src/Core/License.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3)

Parameter #1 $string of function ucwords expects string, mixed given.

Check failure on line 81 in src/Core/License.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1)

Parameter #1 $string of function ucwords expects string, mixed given.

Check failure on line 81 in src/Core/License.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.2)

Parameter #1 $string of function ucwords expects string, mixed given.

Check failure on line 81 in src/Core/License.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.0)

Parameter #1 $string of function ucwords expects string, mixed given.

Check failure on line 81 in src/Core/License.php

View workflow job for this annotation

GitHub Actions / PHPStan (7.4)

Parameter #1 $str of function ucwords expects string, mixed given.
$license->$keyMapped = $value;
}

return $license;
Expand Down

0 comments on commit d57f760

Please sign in to comment.