@flarum/cli 3.0.9 → 3.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/steps/monorepo/split.js +12 -4
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/php-subsystem/src/NodeUtil.php +5 -0
- package/php-subsystem/src/NodeVisitors/ChangeSignatures.php +2 -2
- package/php-subsystem/src/Upgrade/TwoPointOh/EmailViews.php +3 -2
- package/php-subsystem/src/Upgrade/TwoPointOh/InterventionImage.php +5 -4
- package/php-subsystem/src/Upgrade/TwoPointOh/JsonApi.php +2 -2
- package/php-subsystem/src/Upgrade/TwoPointOh/Search.php +4 -4
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ $ npm install -g @flarum/cli
|
|
|
49
49
|
$ flarum-cli COMMAND
|
|
50
50
|
running command...
|
|
51
51
|
$ flarum-cli (-v|--version|version)
|
|
52
|
-
@flarum/cli/3.0.
|
|
52
|
+
@flarum/cli/3.0.11 linux-x64 node-v18.19.1
|
|
53
53
|
$ flarum-cli --help [COMMAND]
|
|
54
54
|
USAGE
|
|
55
55
|
$ flarum-cli COMMAND
|
|
@@ -9,17 +9,25 @@ const monorepo_1 = require("../../utils/monorepo");
|
|
|
9
9
|
async function addRemote(cwd, name, remote) {
|
|
10
10
|
try {
|
|
11
11
|
await (0, simple_git_1.default)(cwd).addRemote(name, remote);
|
|
12
|
-
await (0, simple_git_1.default)(cwd).fetch(name);
|
|
12
|
+
await (0, simple_git_1.default)(cwd).fetch(name, ['--all']);
|
|
13
13
|
}
|
|
14
14
|
catch (_a) {
|
|
15
15
|
// ignore, remote already exists.
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
async function splitAndPush(cwd, splitExecPath, splitPath, remoteName, remoteBranch, force = false) {
|
|
19
|
+
var _a;
|
|
19
20
|
const currBranch = (0, child_process_1.execSync)('git rev-parse --abbrev-ref HEAD', { cwd }).toString().trim();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
.
|
|
21
|
+
let sha1;
|
|
22
|
+
try {
|
|
23
|
+
sha1 = (0, child_process_1.execSync)(`${splitExecPath} --prefix=${splitPath}`, { cwd, stdio: ['pipe', 'pipe', 'ignore'] })
|
|
24
|
+
.toString()
|
|
25
|
+
.trim();
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error((_a = error.output) === null || _a === void 0 ? void 0 : _a.toString());
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
23
31
|
const branch = remoteBranch || 'main';
|
|
24
32
|
const pushArgs = `${remoteName} "${sha1}:refs/heads/${branch}"`;
|
|
25
33
|
if (force) {
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"3.0.9","commands":{"infra":{"id":"infra","description":"Add/Update infrastructure to the latest scaffolding for some module in an extension. For example, you can use this to add/update TypeScript, backend testing, GitHub Actions, and other features.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"monorepo":{"name":"monorepo","type":"boolean","char":"m","allowNo":false},"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"module","description":"The name of the module to enable/update.","required":true,"options":["core","icon","admin","forum","js","jsCommon","css","locale","gitConf","githubActions","prettier","typescript","bundlewatch","frontendTesting","backendTesting","phpstan","editorConfig","styleci"]},{"name":"path","description":"Where should this command be executed?"}]},"init":{"id":"init","description":"Create a new Flarum extension","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"audit:infra":{"id":"audit:infra","description":"Check for outdated config files, infrastructure, setup, etc.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"fix":{"name":"fix","type":"boolean","char":"f","allowNo":false},"monorepo":{"name":"monorepo","type":"boolean","char":"m","allowNo":false},"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"flarum:change":{"id":"flarum:change","description":"Related Flarum version information.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"flarum:info":{"id":"flarum:info","description":"Related Flarum version information.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"make:locale":{"id":"make:locale","description":"Generate new locale key value pair.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"key","description":"The nested key of the locale (e.g. `forum.custom_modal.title`).","required":false},{"name":"value","description":"The value of the locale.","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:model":{"id":"make:model","description":"Generate a model class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:notification":{"id":"make:notification","description":"Generate a new notification","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:post-type":{"id":"make:post-type","description":"Generate a new post type","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"monorepo:create":{"id":"monorepo:create","description":"Create a monorepo of Flarum extensions.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"config":{"name":"config","type":"option","char":"c","required":false},"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"monorepo:split":{"id":"monorepo:split","description":"Split monorepo changes into subrepos.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","required":false,"allowNo":false},"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"update:js-imports":{"id":"update:js-imports","description":"Updates JS imports from core to use proper namespaces","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"upgrade:2.0":{"id":"upgrade:2.0","description":"Upgrade an extension to Flarum 2.0","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"step":{"name":"step","type":"option","description":"Optionally specify a specific step to run","required":false},"force-steps":{"name":"force-steps","type":"boolean","description":"Force run steps even if already ran","required":false,"allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:api-resource":{"id":"make:backend:api-resource","description":"Generate an API resource class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:command":{"id":"make:backend:command","description":"Generate a console command class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:controller":{"id":"make:backend:controller","description":"Generate a controller class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:event-listener":{"id":"make:backend:event-listener","description":"Generate an event listener class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:filter":{"id":"make:backend:filter","description":"Generate a filter class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:handler":{"id":"make:backend:handler","description":"Generate a domain logic handler class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:integration-test":{"id":"make:backend:integration-test","description":"Generate an integration test class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:job":{"id":"make:backend:job","description":"Generate a job class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:mail-driver":{"id":"make:backend:mail-driver","description":"Generate a mail driver class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:middleware":{"id":"make:backend:middleware","description":"Generate a middleware","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:migration":{"id":"make:backend:migration","description":"Generate a migration","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"name","description":"The name of the migration","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:model":{"id":"make:backend:model","description":"Generate a model class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:notification-blueprint":{"id":"make:backend:notification-blueprint","description":"Generate a notification blueprint class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:notification-driver":{"id":"make:backend:notification-driver","description":"Generate a notification driver class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:policy":{"id":"make:backend:policy","description":"Generate a policy class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:post-type":{"id":"make:backend:post-type","description":"Generate a new backend post type class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:repository":{"id":"make:backend:repository","description":"Generate a repository class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:route":{"id":"make:backend:route","description":"Generate a routes extender","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:search-driver":{"id":"make:backend:search-driver","description":"Generate a search driver","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:service-provider":{"id":"make:backend:service-provider","description":"Generate a service provider class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:validator":{"id":"make:backend:validator","description":"Generate a validator class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:component":{"id":"make:frontend:component","description":"Generate a frontend component","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"frontend","description":"The frontend name","required":false},{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:forum-page":{"id":"make:frontend:forum-page","description":"Generate a forum page class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"routeName","description":"Route name (unique)","required":false},{"name":"routePath","description":"Route path","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:gambit":{"id":"make:frontend:gambit","description":"Generate a frontend gambit class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:modal":{"id":"make:frontend:modal","description":"Generate a modal component","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"frontend","description":"The frontend name","required":false},{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:model":{"id":"make:frontend:model","description":"Generate a model class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:notification":{"id":"make:frontend:notification","description":"Generate a frontend notification class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:post-type":{"id":"make:frontend:post-type","description":"Generate a frontend post type class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]}}}
|
|
1
|
+
{"version":"3.0.11","commands":{"infra":{"id":"infra","description":"Add/Update infrastructure to the latest scaffolding for some module in an extension. For example, you can use this to add/update TypeScript, backend testing, GitHub Actions, and other features.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"monorepo":{"name":"monorepo","type":"boolean","char":"m","allowNo":false},"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"module","description":"The name of the module to enable/update.","required":true,"options":["core","icon","admin","forum","js","jsCommon","css","locale","gitConf","githubActions","prettier","typescript","bundlewatch","frontendTesting","backendTesting","phpstan","editorConfig","styleci"]},{"name":"path","description":"Where should this command be executed?"}]},"init":{"id":"init","description":"Create a new Flarum extension","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"audit:infra":{"id":"audit:infra","description":"Check for outdated config files, infrastructure, setup, etc.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"fix":{"name":"fix","type":"boolean","char":"f","allowNo":false},"monorepo":{"name":"monorepo","type":"boolean","char":"m","allowNo":false},"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"flarum:change":{"id":"flarum:change","description":"Related Flarum version information.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"flarum:info":{"id":"flarum:info","description":"Related Flarum version information.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"make:locale":{"id":"make:locale","description":"Generate new locale key value pair.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"key","description":"The nested key of the locale (e.g. `forum.custom_modal.title`).","required":false},{"name":"value","description":"The value of the locale.","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:model":{"id":"make:model","description":"Generate a model class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:notification":{"id":"make:notification","description":"Generate a new notification","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:post-type":{"id":"make:post-type","description":"Generate a new post type","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"monorepo:create":{"id":"monorepo:create","description":"Create a monorepo of Flarum extensions.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"config":{"name":"config","type":"option","char":"c","required":false},"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"monorepo:split":{"id":"monorepo:split","description":"Split monorepo changes into subrepos.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","required":false,"allowNo":false},"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"update:js-imports":{"id":"update:js-imports","description":"Updates JS imports from core to use proper namespaces","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"upgrade:2.0":{"id":"upgrade:2.0","description":"Upgrade an extension to Flarum 2.0","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"step":{"name":"step","type":"option","description":"Optionally specify a specific step to run","required":false},"force-steps":{"name":"force-steps","type":"boolean","description":"Force run steps even if already ran","required":false,"allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:api-resource":{"id":"make:backend:api-resource","description":"Generate an API resource class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:command":{"id":"make:backend:command","description":"Generate a console command class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:controller":{"id":"make:backend:controller","description":"Generate a controller class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:event-listener":{"id":"make:backend:event-listener","description":"Generate an event listener class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:filter":{"id":"make:backend:filter","description":"Generate a filter class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:handler":{"id":"make:backend:handler","description":"Generate a domain logic handler class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:integration-test":{"id":"make:backend:integration-test","description":"Generate an integration test class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:job":{"id":"make:backend:job","description":"Generate a job class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:mail-driver":{"id":"make:backend:mail-driver","description":"Generate a mail driver class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:middleware":{"id":"make:backend:middleware","description":"Generate a middleware","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:migration":{"id":"make:backend:migration","description":"Generate a migration","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"name","description":"The name of the migration","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:model":{"id":"make:backend:model","description":"Generate a model class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:notification-blueprint":{"id":"make:backend:notification-blueprint","description":"Generate a notification blueprint class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:notification-driver":{"id":"make:backend:notification-driver","description":"Generate a notification driver class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:policy":{"id":"make:backend:policy","description":"Generate a policy class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:post-type":{"id":"make:backend:post-type","description":"Generate a new backend post type class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:repository":{"id":"make:backend:repository","description":"Generate a repository class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:route":{"id":"make:backend:route","description":"Generate a routes extender","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:search-driver":{"id":"make:backend:search-driver","description":"Generate a search driver","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:service-provider":{"id":"make:backend:service-provider","description":"Generate a service provider class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:backend:validator":{"id":"make:backend:validator","description":"Generate a validator class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:component":{"id":"make:frontend:component","description":"Generate a frontend component","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"frontend","description":"The frontend name","required":false},{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:forum-page":{"id":"make:frontend:forum-page","description":"Generate a forum page class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"routeName","description":"Route name (unique)","required":false},{"name":"routePath","description":"Route path","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:gambit":{"id":"make:frontend:gambit","description":"Generate a frontend gambit class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:modal":{"id":"make:frontend:modal","description":"Generate a modal component","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"frontend","description":"The frontend name","required":false},{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:model":{"id":"make:frontend:model","description":"Generate a model class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:notification":{"id":"make:frontend:notification","description":"Generate a frontend notification class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:post-type":{"id":"make:frontend:post-type","description":"Generate a frontend post type class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"className","description":"The name of the class to generate","required":false},{"name":"path","description":"Where should this command be executed?"}]}}}
|
package/package.json
CHANGED
|
@@ -31,10 +31,10 @@ class ChangeSignatures extends NodeVisitorAbstract
|
|
|
31
31
|
|
|
32
32
|
if (! $this->valid && $node instanceof Class_) {
|
|
33
33
|
$implements = array_map(function (Node\Name $interface) {
|
|
34
|
-
return $interface
|
|
34
|
+
return NodeUtil::className($interface);
|
|
35
35
|
}, $node->implements);
|
|
36
36
|
|
|
37
|
-
$extends = $node->extends ? $node->extends
|
|
37
|
+
$extends = $node->extends ? NodeUtil::className($node->extends) : null;
|
|
38
38
|
|
|
39
39
|
if ($extends && isset($this->changes[$extends])) {
|
|
40
40
|
$this->valid = true;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
namespace Flarum\CliPhpSubsystem\Upgrade\TwoPointOh;
|
|
4
4
|
|
|
5
|
+
use Flarum\CliPhpSubsystem\NodeUtil;
|
|
5
6
|
use Flarum\CliPhpSubsystem\NodeVisitors\ChangeSignatures;
|
|
6
7
|
use Flarum\CliPhpSubsystem\Upgrade\Replacement;
|
|
7
8
|
use Flarum\CliPhpSubsystem\Upgrade\ReplacementResult;
|
|
@@ -37,7 +38,7 @@ class EmailViews extends Replacement
|
|
|
37
38
|
|
|
38
39
|
public function enterNode(\PhpParser\Node $node)
|
|
39
40
|
{
|
|
40
|
-
if ($node instanceof \PhpParser\Node\Stmt\Class_ && (!$node->implements || ! in_array($this->interface, array_map(function ($interface) { return $interface
|
|
41
|
+
if ($node instanceof \PhpParser\Node\Stmt\Class_ && (!$node->implements || ! in_array($this->interface, array_map(function ($interface) { return NodeUtil::className($interface); }, $node->implements)))) {
|
|
41
42
|
return NodeVisitor::DONT_TRAVERSE_CHILDREN;
|
|
42
43
|
}
|
|
43
44
|
|
|
@@ -53,7 +54,7 @@ class EmailViews extends Replacement
|
|
|
53
54
|
|
|
54
55
|
public function leaveNode(Node $node)
|
|
55
56
|
{
|
|
56
|
-
if ($node instanceof \PhpParser\Node\Stmt\Class_ && (!$node->implements || ! in_array($this->interface, array_map(function ($interface) { return $interface
|
|
57
|
+
if ($node instanceof \PhpParser\Node\Stmt\Class_ && (!$node->implements || ! in_array($this->interface, array_map(function ($interface) { return NodeUtil::className($interface); }, $node->implements)))) {
|
|
57
58
|
return NodeVisitor::STOP_TRAVERSAL;
|
|
58
59
|
}
|
|
59
60
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
namespace Flarum\CliPhpSubsystem\Upgrade\TwoPointOh;
|
|
4
4
|
|
|
5
|
+
use Flarum\CliPhpSubsystem\NodeUtil;
|
|
5
6
|
use Flarum\CliPhpSubsystem\NodeVisitors\ReplaceUses;
|
|
6
7
|
use Flarum\CliPhpSubsystem\Upgrade\Replacement;
|
|
7
8
|
use Flarum\CliPhpSubsystem\Upgrade\ReplacementResult;
|
|
@@ -35,9 +36,9 @@ class InterventionImage extends Replacement
|
|
|
35
36
|
if ($node instanceof Node\Stmt\Property
|
|
36
37
|
&& $node->type
|
|
37
38
|
&& $node->type->hasAttribute('resolvedName')
|
|
38
|
-
&& strpos($node->type
|
|
39
|
+
&& strpos(NodeUtil::className($node->type), 'Intervention\\Image\\') === 0
|
|
39
40
|
) {
|
|
40
|
-
$this->propertyTypes[$node->props[0]->name->name] = $node->type
|
|
41
|
+
$this->propertyTypes[$node->props[0]->name->name] = NodeUtil::className($node->type);
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
if ($node instanceof Node\Stmt\ClassMethod && $node->name->name === '__construct') {
|
|
@@ -46,12 +47,12 @@ class InterventionImage extends Replacement
|
|
|
46
47
|
|| ! $param->type
|
|
47
48
|
|| ! $param->type->hasAttribute('resolvedName')
|
|
48
49
|
|| ! is_string($param->var->name)
|
|
49
|
-
|| strpos($param->type
|
|
50
|
+
|| strpos(NodeUtil::className($param->type), 'Intervention\\Image\\') !== 0
|
|
50
51
|
) {
|
|
51
52
|
continue;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
$this->propertyTypes[$param->var->name] = $param->type
|
|
55
|
+
$this->propertyTypes[$param->var->name] = NodeUtil::className($param->type);
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
}
|
|
@@ -48,7 +48,7 @@ class JsonApi extends Replacement
|
|
|
48
48
|
public function enterNode(\PhpParser\Node $node)
|
|
49
49
|
{
|
|
50
50
|
if ($node instanceof \PhpParser\Node\Stmt\Class_ && $node->extends) {
|
|
51
|
-
if (in_array($node->extends
|
|
51
|
+
if (in_array(NodeUtil::className($node->extends), self::STALE)) {
|
|
52
52
|
$node->setAttribute('comments', [new \PhpParser\Comment\Doc(<<<PHPDOC
|
|
53
53
|
/**
|
|
54
54
|
* @TODO: Remove this in favor of one of the API resource classes that were added.
|
|
@@ -145,7 +145,7 @@ class JsonApi extends Replacement
|
|
|
145
145
|
{
|
|
146
146
|
if ($node instanceof \PhpParser\Node\Expr\New_) {
|
|
147
147
|
if ($node->class instanceof \PhpParser\Node\Name) {
|
|
148
|
-
$class = $node->class
|
|
148
|
+
$class = NodeUtil::className($node->class);
|
|
149
149
|
|
|
150
150
|
if (in_array($class, ['Flarum\Extend\ApiSerializer', 'Flarum\Extend\ApiController', 'Flarum\Foundation\AbstractValidator'])) {
|
|
151
151
|
$parent = $node->getAttribute('parent');
|
|
@@ -146,7 +146,7 @@ class Search extends Replacement
|
|
|
146
146
|
$expr = $node->stmts[0]->expr;
|
|
147
147
|
|
|
148
148
|
if ($expr instanceof Node\Expr\StaticCall) {
|
|
149
|
-
$model = $expr->class
|
|
149
|
+
$model = NodeUtil::className($expr->class);
|
|
150
150
|
$this->data['repositories'][$class]['model'] = $model;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
@@ -173,7 +173,7 @@ class Search extends Replacement
|
|
|
173
173
|
if ($expr instanceof Node\Expr\MethodCall && $expr->var instanceof Node\Expr\PropertyFetch && isset($this->map[$expr->var->name->name])) {
|
|
174
174
|
$this->data['searchers'][$fqnClass]['repository'] = $this->map[$expr->var->name->name];
|
|
175
175
|
} elseif ($expr instanceof Node\Expr\MethodCall && $expr->var instanceof Node\Expr\StaticCall) {
|
|
176
|
-
$model = $expr->var->class
|
|
176
|
+
$model = NodeUtil::className($expr->var->class);
|
|
177
177
|
$this->data['searchers'][$fqnClass]['model'] = $model;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
@@ -271,7 +271,7 @@ class Search extends Replacement
|
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
if ($class === 'Flarum\Extend\Filter') {
|
|
274
|
-
$filterer = $new->args[0]->value->class
|
|
274
|
+
$filterer = NodeUtil::className($new->args[0]->value->class);
|
|
275
275
|
|
|
276
276
|
if ($filterer === 'Flarum\\Discussion\\Filter\\DiscussionFilterer') {
|
|
277
277
|
$searcher = 'Flarum\\Discussion\\Search\\DiscussionSearcher';
|
|
@@ -297,7 +297,7 @@ class Search extends Replacement
|
|
|
297
297
|
$this->data['searchers'][$searcher]['mutators'][] = $arg->value;
|
|
298
298
|
}
|
|
299
299
|
} elseif ($class === 'Flarum\Extend\SimpleFlarumSearch') {
|
|
300
|
-
$searcher = $new->args[0]->value->class
|
|
300
|
+
$searcher = NodeUtil::className($new->args[0]->value->class);
|
|
301
301
|
|
|
302
302
|
$arg = $node->args[0];
|
|
303
303
|
|