-
Notifications
You must be signed in to change notification settings - Fork 0
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| .DS_Store | ||
| ._.DS_Store | ||
| .php-cs-fixer.cache | ||
| /vendor | ||
| vendor |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/bash | ||
|
|
||
| composer --working-dir src/usr/local/php/unraid-tailscale-utils/ "$@" |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,3 +5,5 @@ parameters: | |
| - page | ||
| paths: | ||
| - src | ||
| excludePaths: | ||
| - */vendor/* | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,13 @@ | |
| ?> | ||
| <?php | ||
|
|
||
| $tr = $tr ?? new Tailscale\Translator(); | ||
| use EDACerton\PluginUtils\Translator; | ||
|
|
||
| if ( ! defined('Tailscale\PLUGIN_ROOT') || ! defined('Tailscale\PLUGIN_NAME')) { | ||
| throw new \RuntimeException("Common file not loaded."); | ||
| } | ||
|
|
||
| $tr = $tr ?? new Translator(Tailscale\PLUGIN_ROOT); | ||
|
Comment on lines
+15
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainConsistent migration pattern to external library. The migration from local However, PHPStan indicates the external class is not found, which suggests:
🏁 Script executed: #!/bin/bash
# Check if composer dependencies are installed
ls -la src/usr/local/php/unraid-tailscale-utils/vendor/
# Verify the external Translator class exists
fd -name "Translator.php" src/usr/local/php/unraid-tailscale-utils/vendor/Length of output: 459 #!/bin/bash Locate all vendor directories in the repofd -t d vendor Search for any PHP file named Translator.phpfd -t f Translator.php Check for a composer.json in the plugin rootfd -t f composer.json src/usr/local/emhttp/plugins/tailscale 🏁 Script executed: #!/bin/bash
set -e
echo "Finding all vendor directories in the repo:"
fd --type d vendor
echo
echo "Locating any Translator.php files in the repo:"
fd --type f Translator.php
echo
echo "Searching for composer.json files in the repo:"
fd --type f composer.jsonLength of output: 460 Ensure external Translator dependency is installed and autoloaded by PHPStan The migration to
After these steps, re-run PHPStan to confirm the 🧰 Tools🪛 PHPStan (2.1.15)21-21: Instantiated class EDACerton\PluginUtils\Translator not found. (class.notFound) 🤖 Prompt for AI Agents |
||
|
|
||
| $log = '/var/log/tailscale.log'; | ||
| $prev = '/var/log/tailscale-utils.log'; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,8 +2,15 @@ | |
|
|
||
| namespace Tailscale; | ||
|
|
||
| use EDACerton\PluginUtils\Translator; | ||
|
|
||
| if ( ! defined(__NAMESPACE__ . '\PLUGIN_ROOT') || ! defined(__NAMESPACE__ . '\PLUGIN_NAME')) { | ||
| throw new \RuntimeException("Common file not loaded."); | ||
| } | ||
|
|
||
| $tr = $tr ?? new Translator(PLUGIN_ROOT); | ||
|
Comment on lines
+7
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainExcellent runtime validation and proper translator instantiation. The runtime checks ensure that required constants are defined before proceeding, and the translator is properly instantiated with the However, static analysis indicates the 🏁 Script executed: #!/bin/bash
# Check if the dependency is properly defined in composer.json
find . -name "composer.json" -exec cat {} \; | jq '.require["edacerton/plugin-utils"]'
# Verify composer.lock exists and contains the dependency
if [ -f "composer.lock" ]; then
jq '.packages[] | select(.name == "edacerton/plugin-utils")' composer.lock
fiLength of output: 123 Install missing edacerton/plugin-utils dependency
Please run 🧰 Tools🪛 PHPStan (2.1.15)11-11: Instantiated class EDACerton\PluginUtils\Translator not found. (class.notFound) 🤖 Prompt for AI Agents |
||
|
|
||
| $tailscaleConfig = $tailscaleConfig ?? new Config(); | ||
| $tr = $tr ?? new Translator(); | ||
|
|
||
| if (( ! isset($var)) || ( ! isset($display))) { | ||
| echo("Missing required WebGUI variables"); | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify external dependency availability.
The translator initialization correctly uses
PLUGIN_ROOTas a constructor argument. However, static analysis reports thatEDACerton\PluginUtils\Translatorclass is not found, which suggests the external library may not be properly installed or available in the analysis environment.Please verify that the
EDACerton\PluginUtilspackage is properly defined and available:🏁 Script executed:
Length of output: 965
Ensure the
EDACerton\PluginUtils\Translatorclass is actually installed and autoloadedIt looks like your
composer.jsondoes declare"edacerton/plugin-utils": "^1.0", but novendor/autoload.phporTranslator.phpfile was found in the repo scan—so the package isn’t installed or pulled into your plugin. Please:src/usr/local/emhttp/plugins/tailscale):composer.jsonthat requires"edacerton/plugin-utils": "^1.0".composer installto generatevendor/andvendor/autoload.php.vendor/edacerton/plugin-utils/src/Translator.phpexists.require_once PLUGIN_ROOT . '/vendor/autoload.php';(or otherwise points to the correct autoloader).Once the package is installed and autoloaded, the
Translatorclass will be found and the static-analysis error will disappear.🧰 Tools
🪛 PHPStan (2.1.15)
11-11: Instantiated class EDACerton\PluginUtils\Translator not found.
Learn more at https://phpstan.org/user-guide/discovering-symbols
(class.notFound)
🤖 Prompt for AI Agents