Skip to content

Commit fd2f702

Browse files
committed
added X-ray page
1 parent 9b96a56 commit fd2f702

19 files changed

Lines changed: 197 additions & 0 deletions

tools/bg/@home.texy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- [Code Checker |code-checker] проверява изходните ви файлове за формални недостатъци като невидим BOM, контролни знаци, повредено кодиране или невалиден синтаксис на PHP, Latte, NEON, JSON и YAML файлове и може да ги поправи автоматично.
1717
- [Coding Standard |en:coding-standard] автоматично форматира вашия PHP код според Nette coding standard, от отстъпите и скобите до интервалите и подреждането на импортите.
1818
- [PHPStan Rules |en:phpstan-rules] учат PHPStan да разбира кода на Nette, така че статичният анализ извежда точни типове и докладва по-малко фалшиви сигнали.
19+
- [X-Ray |en:xray] показва ви точно как проектът ви използва екосистемата на Nette: кои методи, Latte филтри и конфигурационни ключове реално използвате.
1920

2021

2122
Изкуствен интелект

tools/cs/@home.texy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Kvalita kódu
1616
- [Code Checker |code-checker] zkontroluje vaše zdrojové soubory a najde v nich formální nedostatky, jako je neviditelný BOM, kontrolní znaky, chybné kódování nebo neplatná syntaxe souborů PHP, Latte, NEON, JSON a YAML, a umí je automaticky opravit.
1717
- [Coding Standard |coding-standard] automaticky naformátuje váš PHP kód podle Nette coding standardu, od odsazení a závorek až po mezery a řazení importů.
1818
- [PHPStan Rules |phpstan-rules] naučí PHPStan rozumět Nette kódu, takže statická analýza odvozuje přesné typy a hlásí méně falešných chyb.
19+
- [X-Ray |xray] vám ukáže, jak přesně váš projekt využívá ekosystém Nette: které metody, Latte filtry i konfigurační klíče doopravdy používáte.
1920

2021

2122
Umělá inteligence

tools/cs/xray.texy

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
Nette X-Ray
2+
***********
3+
4+
.[perex]
5+
[X-Ray |https://github.com/nette/xray] vám ukáže, jak přesně váš projekt využívá ekosystém Nette: které metody, Latte filtry i konfigurační klíče doopravdy používáte.
6+
7+
Přemýšleli jste někdy, které Nette metody voláte nejčastěji? Které Latte filtry vlastně používáte? Sahá ještě někdo na ten starý konfigurační klíč? X-Ray prohledá váš kód statickou analýzou a odpoví vám přehledným HTML reportem.
8+
9+
10+
Co se analyzuje
11+
===============
12+
13+
Místo regulárních výrazů a odhadů používá X-Ray statickou analýzu: rozliší typy skrz dědičnost, pozná deklarující třídy a sleduje vzory argumentů. Výsledkem je přesný obrázek o tom, jak váš projekt interaguje s Nette.
14+
15+
| PHP a PHPT | Latte šablony | NEON konfigurace |
16+
|------------|---------------|------------------|
17+
| volání metod a funkcí | značky a n:atributy | vzory DI služeb |
18+
| argumenty (poziční, pojmenované) | filtry a jejich argumenty | registrace rozšíření |
19+
| použití návratových hodnot | funkce a konstanty | použité sekce |
20+
| přístup k properties | varianty syntaxe | konfigurační klíče |
21+
| dědičnost tříd a traity | | |
22+
| přepisy metod | | |
23+
24+
25+
Instalace
26+
=========
27+
28+
Nainstalujte ho přes Composer jako vývojovou závislost:
29+
30+
```shell
31+
composer require --dev nette/xray
32+
```
33+
34+
Vyžaduje PHP 8.2 nebo vyšší a běží na PHPStanu 2.1. Funguje s libovolným projektem, který používá Nette, Latte, Tracy, Dibi nebo Texy.
35+
36+
37+
Použití
38+
=======
39+
40+
Spusťte ho nad svými zdrojovými adresáři:
41+
42+
```shell
43+
vendor/bin/xray app/ src/
44+
```
45+
46+
Během chvíle získáte interaktivní HTML report (`xray-report.html`), který stačí otevřít v prohlížeči, a strojově čitelná data (`xray-report.json`):
47+
48+
```
49+
50+
51+
Nette X-Ray
52+
===========
53+
54+
Scanning PHP files ... 142/142 done
55+
Scanning NEON files ... 4/4 done
56+
Scanning Latte files ... 87/87 done
57+
58+
Reports saved to:
59+
xray-report.json
60+
xray-report.html
61+
```
62+
63+
64+
Konfigurace
65+
===========
66+
67+
Chování upravíte souborem `nette-xray.neon` v kořeni projektu:
68+
69+
```neon
70+
# Výchozí cesty k analýze (použijí se, když neuvedete argumenty na příkazové řádce)
71+
paths:
72+
- app
73+
- src
74+
75+
# Další adresáře k vyloučení (vendor, temp, node_modules, .git jsou vyloučeny automaticky)
76+
excludeDirs:
77+
- generated
78+
79+
# Automatické odeslání bez ptaní
80+
upload: false
81+
```
82+
83+
/--comment
84+
85+
86+
Pomozte vývoji Nette
87+
====================
88+
89+
Po analýze můžete report dobrovolně odeslat a pomoct tak směřovat vývoj frameworku – reálná data o používání jsou spolehlivější než ankety. Odesílají se jen agregovaná čísla: kolikrát se které API zavolá a jaké vzory používáte. Žádný kód, žádné cesty k souborům, žádné hodnoty proměnných. Data se odešlou jen tehdy, když to výslovně potvrdíte, a JSON report se vždy nejdřív uloží lokálně, takže si ho můžete v klidu prohlédnout.
90+
\--

tools/de/@home.texy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Code-Qualität
1616
- [Code Checker |code-checker] überprüft Ihre Quelldateien auf formale Mängel wie ein unsichtbares BOM, Steuerzeichen, fehlerhafte Kodierung oder ungültige Syntax von PHP-, Latte-, NEON-, JSON- und YAML-Dateien und kann diese automatisch beheben.
1717
- [Coding Standard |en:coding-standard] formatiert Ihren PHP-Code automatisch gemäß dem Nette Coding Standard, von der Einrückung und den Klammern bis hin zu Abständen und der Reihenfolge der Imports.
1818
- [PHPStan Rules |en:phpstan-rules] bringen PHPStan bei, Nette-Code zu verstehen, sodass die statische Analyse präzise Typen ableitet und weniger Fehlalarme meldet.
19+
- [X-Ray |en:xray] zeigt Ihnen genau, wie Ihr Projekt das Nette-Ökosystem nutzt: welche Methoden, Latte-Filter und Konfigurationsschlüssel Sie tatsächlich verwenden.
1920

2021

2122
Künstliche Intelligenz

tools/el/@home.texy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- [Code Checker |code-checker] ελέγχει τα πηγαία αρχεία σας για τυπικά σφάλματα, όπως ένα αόρατο BOM, χαρακτήρες ελέγχου, κατεστραμμένη κωδικοποίηση ή μη έγκυρη σύνταξη αρχείων PHP, Latte, NEON, JSON και YAML, και μπορεί να τα διορθώσει αυτόματα.
1717
- [Coding Standard |en:coding-standard] μορφοποιεί αυτόματα τον κώδικα PHP σας σύμφωνα με το πρότυπο κωδικοποίησης του Nette, από τη στοίχιση και τα άγκιστρα μέχρι τα κενά και τη σειρά των imports.
1818
- [PHPStan Rules |en:phpstan-rules] μαθαίνουν στο PHPStan να κατανοεί τον κώδικα Nette, ώστε η στατική ανάλυση να συμπεραίνει ακριβείς τύπους και να αναφέρει λιγότερα ψευδώς θετικά.
19+
- [X-Ray |en:xray] σας δείχνει ακριβώς πώς το έργο σας χρησιμοποιεί το οικοσύστημα Nette: ποιες μεθόδους, φίλτρα Latte και κλειδιά ρυθμίσεων χρησιμοποιείτε πραγματικά.
1920

2021

2122
Τεχνητή νοημοσύνη

tools/en/@home.texy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Code Quality
1616
- [Code Checker |code-checker] checks your source files for formal flaws such as an invisible BOM, control characters, broken encoding, or invalid syntax of PHP, Latte, NEON, JSON and YAML files, and can fix them automatically.
1717
- [Coding Standard |coding-standard] automatically formats your PHP code according to the Nette coding standard, from indentation and braces to spacing and the ordering of imports.
1818
- [PHPStan Rules |phpstan-rules] teach PHPStan to understand Nette code, so static analysis infers precise types and reports fewer false positives.
19+
- [X-Ray |xray] shows you exactly how your project uses the Nette ecosystem: which methods, Latte filters and configuration keys you actually use.
1920

2021

2122
Artificial Intelligence

tools/en/xray.texy

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
Nette X-Ray
2+
***********
3+
4+
.[perex]
5+
[X-Ray |https://github.com/nette/xray] shows you exactly how your project uses the Nette ecosystem: which methods, Latte filters and configuration keys you actually use.
6+
7+
Ever wondered which Nette methods you call the most? Which Latte filters you actually use? Whether anyone still touches that old configuration key? X-Ray scans your code with static analysis and answers that with a clear HTML report.
8+
9+
10+
What Gets Analyzed
11+
==================
12+
13+
Instead of regex or guessing, X-Ray uses static analysis: it resolves types through inheritance, detects declaring classes and tracks argument patterns. The result is an accurate picture of how your project interacts with Nette.
14+
15+
| PHP and PHPT | Latte templates | NEON configuration |
16+
|--------------|-----------------|--------------------|
17+
| method & function calls | tags & n:attributes | DI service patterns |
18+
| arguments (positional, named) | filters & their arguments | extension registration |
19+
| return value usage | functions & constants | section usage |
20+
| property access | syntax variants | configuration keys |
21+
| class inheritance & traits | | |
22+
| method overrides | | |
23+
24+
25+
Installation
26+
============
27+
28+
Install it via Composer as a dev dependency:
29+
30+
```shell
31+
composer require --dev nette/xray
32+
```
33+
34+
It requires PHP 8.2 or higher and runs on PHPStan 2.1. It works with any project using Nette, Latte, Tracy, Dibi or Texy.
35+
36+
37+
Usage
38+
=====
39+
40+
Point it at your source directories:
41+
42+
```shell
43+
vendor/bin/xray app/ src/
44+
```
45+
46+
Within moments you get an interactive HTML report (`xray-report.html`) you can open in your browser, plus machine-readable data (`xray-report.json`):
47+
48+
```
49+
50+
51+
Nette X-Ray
52+
===========
53+
54+
Scanning PHP files ... 142/142 done
55+
Scanning NEON files ... 4/4 done
56+
Scanning Latte files ... 87/87 done
57+
58+
Reports saved to:
59+
xray-report.json
60+
xray-report.html
61+
```
62+
63+
64+
Configuration
65+
=============
66+
67+
Create a `nette-xray.neon` file in your project root to customize the behavior:
68+
69+
```neon
70+
# Default analysis paths (used when no CLI arguments are given)
71+
paths:
72+
- app
73+
- src
74+
75+
# Additional directories to exclude (vendor, temp, node_modules, .git are excluded by default)
76+
excludeDirs:
77+
- generated
78+
79+
# Auto-upload without asking
80+
upload: false
81+
```
82+
83+
/--comment
84+
85+
86+
Help Improve Nette
87+
==================
88+
89+
After the analysis, you can optionally send the report to help guide the framework's development – real usage data is far more reliable than surveys. Only aggregated numbers are sent: how many times each API is called and which patterns you use. No code, no file paths, no variable values. Data is sent only if you explicitly confirm, and the JSON report is always saved locally first, so you can review it at your leisure.
90+
\--

tools/es/@home.texy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Calidad del código
1616
- [Code Checker |code-checker] comprueba sus archivos fuente en busca de defectos formales como un BOM invisible, caracteres de control, codificación dañada o sintaxis inválida de archivos PHP, Latte, NEON, JSON y YAML, y puede corregirlos automáticamente.
1717
- [Coding Standard |en:coding-standard] formatea automáticamente su código PHP según el estándar de codificación de Nette, desde la sangría y las llaves hasta los espacios y la ordenación de las importaciones.
1818
- [PHPStan Rules |en:phpstan-rules] enseñan a PHPStan a entender el código de Nette, de modo que el análisis estático infiere tipos precisos y notifica menos falsos positivos.
19+
- [X-Ray |en:xray] le muestra exactamente cómo usa su proyecto el ecosistema de Nette: qué métodos, filtros de Latte y claves de configuración utiliza realmente.
1920

2021

2122
Inteligencia artificial

tools/fr/@home.texy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Qualité du code
1616
- [Code Checker |code-checker] vérifie vos fichiers sources et y détecte des défauts formels tels qu'un BOM invisible, des caractères de contrôle, un encodage incorrect ou une syntaxe invalide des fichiers PHP, Latte, NEON, JSON et YAML, et peut les corriger automatiquement.
1717
- [Coding Standard |en:coding-standard] formate automatiquement votre code PHP selon le standard de codage Nette, de l'indentation et des accolades jusqu'aux espaces et à l'ordre des imports.
1818
- [PHPStan Rules |en:phpstan-rules] apprennent à PHPStan à comprendre le code Nette, pour que l'analyse statique déduise des types précis et signale moins de faux positifs.
19+
- [X-Ray |en:xray] vous montre exactement comment votre projet utilise l'écosystème Nette : quelles méthodes, filtres Latte et clés de configuration vous utilisez réellement.
1920

2021

2122
Intelligence artificielle

tools/hu/@home.texy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Kódminőség
1616
- [Code Checker |code-checker] ellenőrzi a forrásfájljaidat, és olyan formai hibákat keres bennük, mint a láthatatlan BOM, a vezérlő karakterek, a hibás kódolás vagy a PHP, Latte, NEON, JSON és YAML fájlok érvénytelen szintaxisa, és képes automatikusan kijavítani őket.
1717
- [Coding Standard |en:coding-standard] automatikusan formázza a PHP kódodat a Nette coding standard szerint, a behúzástól és a zárójelektől kezdve a szóközökön át az importok rendezéséig.
1818
- [PHPStan Rules |en:phpstan-rules] megtanítják a PHPStan-t a Nette-kód megértésére, így a statikus elemzés pontos típusokat következtet ki és kevesebb téves riasztást jelez.
19+
- [X-Ray |en:xray] pontosan megmutatja, hogyan használja a projekted a Nette ökoszisztémát: mely metódusokat, Latte szűrőket és konfigurációs kulcsokat használsz ténylegesen.
1920

2021

2122
Mesterséges intelligencia

0 commit comments

Comments
 (0)