<commit_before># Better Reflection

This package add 3 features:
 
- ignores missing functions without crashing
- `SmartClassReflector` always knows about file it's parsing thanks to `CurrentFileProvider` 

- add stub file to `/stub` directory


## Stub Files

Sometimes **we need reflection of class that is not here**.

To overcome this hard dependency on `/vendor`, we can prepare a stub file in format:

    /stubs/Namespace.SubNamespace.ClassName.stub
 
When class `Namespace\SubNamespace\ClassName` and is nowhere to be found, the stub file will be used to identify it.


### Add Metadata for Sure

Just copy original file from Github and use `y` to get absolute link to original file (in case of debug or anything).
Also refer Rector config with version this stub was used for.

**Add these 2 informations to the top of stub file**:

```php
<?php

# source: https://github.com/nette/application/blob/12ce71ebb7389d2c24fa6f1a57a4348cad228c5e/src/Application/UI/ITemplate.php
# for: nette24.yml

namespace Nette\...
```<commit_msg>README: details<commit_after># Better Reflection

This package add 3 features:
 
- ignores missing functions without crashing
- `SmartClassReflector` always knows about file it's parsing thanks to `CurrentFileProvider` 

- add stub file to `/stub` directory


## Stub Files

Sometimes **we need reflection of class that is not here**.

To overcome this hard dependency on `/vendor`, we can prepare a stub file in format:

```
/stubs/Namespace.ClassName.stub
```
 
When class `Namespace\ClassName` and is nowhere to be found, the stub file will be used to identify it.


### How to add Stub File?

- Copy original file from Github and use `y` to get absolute link to original file (in case of debug or anything).
- Also refer Rector config with version this stub was used for.
- **Add these 2 informations to the top of stub file**:

```php
<?php

# source: https://github.com/nette/application/blob/12ce71ebb7389d2c24fa6f1a57a4348cad228c5e/src/Application/UI/ITemplate.php
# for: nette24.yml

namespace Nette\...
```
{'fraction_non_alphanumeric': 0.08528265107212475, 'fraction_numerical': 0.02631578947368421, 'mean_word_length': 4.277634961439588, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3086484', 'n_tokens_mistral': 647, 'n_tokens_neox': 594, 'n_words': 261}