Skip to content
Open
Show file tree
Hide file tree
Changes from 9 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ src/node_modules/
# Ignore cache files from code quality tools
.php-cs-fixer.cache
.phpstan-cache/
.phpunit.result.cache


# -----------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion .phpunit.result.cache

This file was deleted.

122 changes: 62 additions & 60 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions src/StarUserEnv.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
private static ?array $snapshot_cache = null;

// -------------------------------------------------------------------------
// I. IDENTITY HELPERS (MODERN MODEL)

Check failure on line 76 in src/StarUserEnv.php

View workflow job for this annotation

GitHub Actions / PHP Code Quality

Property Starisian\SparxstarUEC\StarUserEnv::$snapshot_cache type has no value type specified in iterable type array.
// -------------------------------------------------------------------------

/**
Expand Down Expand Up @@ -746,15 +746,18 @@
public static function getUserOS(): string
{
$user_agent = strtolower(self::getUserAgent());
// More-specific patterns must appear before any pattern that is a
// substring of them (e.g. 'android' before 'linux', 'iphone' before
// 'mac os x', 'windows phone' before 'windows').
$map = [
'windows phone' => 'Windows Phone',
'ipad|ipod|iphone' => 'iOS',
'android' => 'Android',
'windows' => 'Windows',
'macintosh|mac os x|macos' => 'Mac',
'linux' => 'Linux',
'ipad|ipod|iphone' => 'iOS',
'android' => 'Android',
'blackberry' => 'BlackBerry',
'webos' => 'webOS',
'windows phone' => 'Windows Phone',
];

foreach ($map as $needle => $label) {
Expand Down Expand Up @@ -784,7 +787,7 @@
if (preg_match('/Chrome/i', $user_agent)) {
return 'Chrome';
}

Check failure on line 790 in src/StarUserEnv.php

View workflow job for this annotation

GitHub Actions / PHP Code Quality

Method Starisian\SparxstarUEC\StarUserEnv::getEnvironmentSnapshot() return type has no value type specified in iterable type array.
if (preg_match('/Safari/i', $user_agent)) {
return 'Safari';
}
Expand Down Expand Up @@ -860,7 +863,7 @@
/**
* Retrieve the current HTTP method (GET, POST, etc.).
*/
public static function getRequestMethod(): string

Check failure on line 866 in src/StarUserEnv.php

View workflow job for this annotation

GitHub Actions / PHP Code Quality

Constant SPX_ENV_CHECK_TEXT_DOMAIN not found.
{
return sanitize_text_field(self::get_server_value('REQUEST_METHOD'));
}
Expand All @@ -883,7 +886,7 @@
* Get the current WordPress environment type.
*/
public static function getWpEnvironmentType(): string
{

Check failure on line 889 in src/StarUserEnv.php

View workflow job for this annotation

GitHub Actions / PHP Code Quality

Constant SPX_ENV_CHECK_TEXT_DOMAIN not found.
if (function_exists('wp_get_environment_type')) {
return wp_get_environment_type();
}
Expand Down
Loading
Loading