johnrdorazio / mediawikistubs
Generate intelephense stubs for mediawiki/core
v1.0.0
2024-11-04 21:09 UTC
Requires
- nikic/php-parser: ^5.1
README
Mediawiki stubs with function and class signatures from Mediawiki Core, useful for completion, code inspection, type inference, doc popups, etc.
Generate stubs
Using composer
-
Install the package
mkdir mediawikistubs cd mediawikistubs composer require johnrdorazio/mediawikistubs
-
Ensure you have a local copy of
mediawiki/core
mkdir mediawiki-core cd mediawiki-core git clone --depth 1 https://gerrit.wikimedia.org/r/mediawiki/core.git .
-
Create a script to generate stubs
<?php // generate_stubs.php require 'vendor/autoload.php'; use Johnrdorazio\MediaWikiStubs\StubGenerator; $generator = new StubGenerator(); $generator->generateStubs('./mediawiki-core'); $generator->saveStubs('./stubs');
-
Run the script
php generate_stubs.php
You should now have an updated mediawiki-stubs.php
file in the stubs
subfolder.
Cloning this repo
-
Clone the repository
mkdir mediawikistubs cd mediawikistubs git clone https://github.com/JohnRDOrazio/mediawiki-stubs.git
-
Install the composer package
composer install
-
Ensure you have a local copy of
mediawiki/core
mkdir mediawiki-core cd mediawiki-core git clone --depth 1 https://gerrit.wikimedia.org/r/mediawiki/core.git .
-
Run the script
php generate_stubs.php
You should now have an updated mediawiki-stubs.php
file in the stubs
subfolder.