davidrjenni / scip-php
SCIP Code Intelligence Protocol (SCIP) indexer for PHP
Installs: 659
Dependents: 0
Suggesters: 0
Security: 0
Stars: 12
Watchers: 4
Forks: 3
Open Issues: 3
pkg:composer/davidrjenni/scip-php
Requires
- php: ^8.2
- composer-runtime-api: ^2.2
- ext-json: *
- composer/class-map-generator: ^1.0
- google/protobuf: ^3.22
- jetbrains/phpstorm-stubs: ^2022.3
- nikic/php-parser: ^4.15
Requires (Dev)
- phpstan/extension-installer: ^1.2
- phpstan/phpstan: ^1.10
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-php-parser: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- phpstan/phpstan-strict-rules: ^1.5
- phpunit/phpunit: ^10.0
- squizlabs/php_codesniffer: ^3.7
This package is auto-updated.
Last update: 2025-10-22 11:09:12 UTC
README
SCIP Code Intelligence Protocol (SCIP) indexer for PHP
This repository is indexed using itself and available on Sourcegraph.
And here is a Sourcegraph notebook with a demo and additional explanations.
Requirements
scip-phpmust be run in the root directory of the project you want to index.- It needs the
composer.jsonandcomposer.lockfiles in the current working directory. - Also,
scip-phpneeds an up-to-date autoloader and the dependencies must be installed in the vendor directory.
Usage
Manual
Install scip-php
with composer and the
src binary. Then generate
the SCIP index and upload it:
composer require --dev davidrjenni/scip-php vendor/bin/scip-php src code-intel upload
Private Sourcegraph Instance
To use a private Sourcegraph instance, set the
SRC_ENDPOINT and SRC_ACCESS_TOKEN environment
variables first.
Contributing
See the contributing guidelines.
Development
- Run
composer lintto run all linters. - Run
composer testto run the unit tests. - Run
composer coverto generate a coverage report.
Inspecting the Output
- Install the
scipcli from github.com/sourcegraph/scip. - Run
bin/scip-phpto generate the SCIP index. - Run
scip snapshotto generate snapshot files which can be used for inspecting the output of the index. - See the documentation for further functionality.
Bindings
The directory src/Bindings contains auto-generated
bindings for SCIP. To update the bindings, download the protobuf schema
for SCIP and regenerate the bindings:
wget -O src/Bindings/scip.proto https://raw.githubusercontent.com/sourcegraph/scip/main/scip.proto composer gen-bindings
The protobuf compiler protoc must be present to generate the bindings.
See github.com/sourcegraph/scip for further information.