PHPackages                             nette/xray - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. nette/xray

ActiveLibrary

nette/xray
==========

🔬 Nette X-Ray - see exactly how your project uses the Nette ecosystem

51PHPCI failing

Since Mar 6Pushed 2w ago1 watchersCompare

[ Source](https://github.com/nette/xray)[ Packagist](https://packagist.org/packages/nette/xray)[ RSS](/packages/nette-xray/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Nette X-Ray
===========

[](#nette-x-ray)

[![Nette X-Ray](https://private-user-images.githubusercontent.com/194960/559530819-8d3d9fb8-81a9-45a0-8a6b-96d9aafa03cb.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQxNDM2NTksIm5iZiI6MTc3NDE0MzM1OSwicGF0aCI6Ii8xOTQ5NjAvNTU5NTMwODE5LThkM2Q5ZmI4LTgxYTktNDVhMC04YTZiLTk2ZDlhYWZhMDNjYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzIyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMyMlQwMTM1NTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zODNhYmE1N2M5MDFlY2ExZTExNTc5OTExMjJkN2I1ZWU4ZjUxZjBkZThkMDgxMmNiNzU2YzdmMjBiNDM3NjVhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.SLheUmVvHlS0WzDWLR0bXkQ3UwettPgTwadT3KRG_34)](https://private-user-images.githubusercontent.com/194960/559530819-8d3d9fb8-81a9-45a0-8a6b-96d9aafa03cb.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQxNDM2NTksIm5iZiI6MTc3NDE0MzM1OSwicGF0aCI6Ii8xOTQ5NjAvNTU5NTMwODE5LThkM2Q5ZmI4LTgxYTktNDVhMC04YTZiLTk2ZDlhYWZhMDNjYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzIyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMyMlQwMTM1NTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zODNhYmE1N2M5MDFlY2ExZTExNTc5OTExMjJkN2I1ZWU4ZjUxZjBkZThkMDgxMmNiNzU2YzdmMjBiNDM3NjVhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.SLheUmVvHlS0WzDWLR0bXkQ3UwettPgTwadT3KRG_34)

[![Downloads this Month](https://camo.githubusercontent.com/878f7ca086f5cbc5f7358ece116e6eb7dd7cc20eb43bbd123d907e513772e529/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6e657474652f787261792e737667)](https://packagist.org/packages/nette/xray)[![Tests](https://github.com/nette/xray/workflows/Tests/badge.svg?branch=master)](https://github.com/nette/xray/actions)[![Latest Stable Version](https://camo.githubusercontent.com/f80593bfc108f5381c6f214b7a2e55ed08a15fa6a36ef6bed9de41fcf52ad3c4/68747470733a2f2f706f7365722e707567782e6f72672f6e657474652f787261792f762f737461626c65)](https://github.com/nette/xray/releases)[![License](https://camo.githubusercontent.com/fa7d5fcf2c84b580327af52da95dd751703af65f079dc3c5a0081beac0789718/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4e65772532304253442d626c75652e737667)](https://github.com/nette/xray/blob/master/license.md)

### See exactly how your project uses the Nette ecosystem

[](#see-exactly-how-your-project-uses-the-nette-ecosystem)

Ever wondered which Nette methods you call the most? Which Latte filters you actually use? Whether anyone still touches that old configuration key?

Nette X-Ray scans your codebase and gives you a detailed, visual breakdown of your Nette API usage - every method call, every template filter, every config pattern.

✅ deep PHP analysis powered by PHPStan's type system
✅ Latte template analysis - tags, filters, n:attributes
✅ NEON configuration analysis - services, extensions, settings
✅ beautiful standalone HTML report you can explore
✅ completely anonymized - no code, no names, just numbers

How It Works
============

[](#how-it-works)

Nette X-Ray uses static analysis to understand your code precisely - not regex, not guessing. It resolves types through inheritance, detects declaring classes, and tracks argument patterns. The result is an accurate picture of how your project interacts with the Nette ecosystem.

**What gets analyzed:**

PHP / PHPTLatte templatesNEON configmethod &amp; function callstags &amp; n:attributesDI service patternsarguments (positional, named)filters &amp; their argumentsextension registrationreturn value usagefunctions &amp; constantssection usageproperty accesssyntax variantsconfiguration keysclass inheritance &amp; traitsdynamic elementsdatabase keysmethod overridesself-closing tagsconstants &amp; instantiationcallable referencesInstallation
============

[](#installation)

```
composer require --dev nette/xray
```

Requires PHP 8.2 or higher. Runs on PHPStan 2.1. Works with any project using Nette, Latte, Tracy, Dibi, or Texy.

Usage
=====

[](#usage)

Point it at your source directories:

```
vendor/bin/xray app/ src/
```

That's it. Within moments you get:

1. **HTML report** (`xray-report.html`) - an interactive visual breakdown you can open in your browser
2. **JSON data** (`xray-report.json`) - structured data for further processing

```
Nette X-Ray
==========

Scanning PHP files ... 142/142 done
Scanning NEON files ... 4/4 done
Scanning Latte files ... 87/87 done

Reports saved to:
  xray-report.json
  xray-report.html

```

The HTML Report
---------------

[](#the-html-report)

The HTML report is a standalone file - no server needed, just open it in your browser. It gives you a complete picture:

- Which Nette APIs your project depends on most
- How you pass arguments - positionally or by name
- Which methods you override from Nette base classes
- Which Latte filters and tags dominate your templates
- How your DI configuration is structured

It's your project's X-Ray.

Configuration
-------------

[](#configuration)

Create a `nette-xray.neon` file in your project root to customize behavior:

```
# Default analysis paths (used when no CLI arguments given)
paths:
    - app
    - src

# Additional directories to exclude (vendor, temp, node_modules, .git excluded by default)
excludeDirs:
    - generated

# Auto-upload without asking (default: false)
upload: true
```

Help Shape the Future of Nette
==============================

[](#help-shape-the-future-of-nette)

When you run Nette X-Ray, you can optionally send the anonymized report to help guide Nette's development:

```
Share anonymized data with Nette? [y/N] y
Data sent. Thank you!

```

**What gets sent:** only aggregated numbers - how many times each API is called, which patterns are used. No file paths, no variable names, no business logic. Just statistics.

**Why it matters:** real usage data helps prioritize what to improve, what to keep, and what can safely evolve. It's far more reliable than surveys.

Privacy
=======

[](#privacy)

Nette X-Ray is designed with privacy as a core principle:

- **No code is collected** - only counts and patterns
- **No file paths** - you can't tell what the project does
- **No string values** - argument values are never captured
- **Completely optional** - data is only sent if you explicitly confirm
- **Open source** - you can read exactly what gets collected

The JSON report is saved locally first. You can inspect it before deciding to share.

[Support Me](https://github.com/sponsors/dg)
============================================

[](#support-me)

Do you like Nette X-Ray? Are you looking forward to the new features?

[![Buy me a coffee](https://camo.githubusercontent.com/afa7c20ccaac10ac4f1f51669bafb212856b932e0c8b276cb290336cf08624b8/68747470733a2f2f66696c65732e6e657474652e6f72672f69636f6e732f646f6e6174696f6e2d332e737667)](https://github.com/sponsors/dg)

Thank you!

###  Health Score

23

—

LowBetter than 30% of packages

Maintenance63

Regular maintenance activity

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/17f266513a3ca97500ec3d85d562b9279c7a6346358fe2b8d90390ece717a027?d=identicon)[david@grudl.com](/maintainers/david@grudl.com)

---

Top Contributors

[![dg](https://avatars.githubusercontent.com/u/194960?v=4)](https://github.com/dg "dg (6 commits)")[![ondrejmirtes](https://avatars.githubusercontent.com/u/104888?v=4)](https://github.com/ondrejmirtes "ondrejmirtes (1 commits)")

### Embed Badge

![Health badge](/badges/nette-xray/health.svg)

```
[![Health](https://phpackages.com/badges/nette-xray/health.svg)](https://phpackages.com/packages/nette-xray)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
