1. Go to this page and download the library: Download maarheeze/codegraph library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
maarheeze / codegraph example snippets
use Maarheeze\CodeGraph\CodeGraph;
// Initialize for current project
$codeGraph = CodeGraph::forProject();
// Get statistics
$stats = $codeGraph->stats();
echo "Symbols: " . $stats['symbols'];
// Index code
$indexStats = $codeGraph->index();
echo "Files indexed: " . $indexStats->getFilesChanged();
// Query the storage directly
$storage = $codeGraph->getStorage();
$symbols = $storage->findByName('User');
$callers = $storage->findEdgesTo('\App\Models\User::create');
$callees = $storage->findEdgesFrom('\App\Models\User::create');
$affected = $storage->blastRadius('\App\Models\User::create', depth: 3);
bash
composer in/codegraph init
php vendor/bin/codegraph index