37 lines
988 B
Markdown
Raw Normal View History

2017-10-16 18:03:11 +02:00
# Better Reflection
This package add 3 features:
2017-10-16 18:03:11 +02:00
- ignores missing functions without crashing
- `SmartClassReflector` always knows about file it's parsing thanks to `CurrentFileProvider`
2017-10-20 14:13:31 +02:00
- add stub file to `/stubs` 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:
2017-10-20 14:13:16 +02:00
```
/stubs/Namespace.ClassName.stub
```
2017-10-20 14:13:16 +02:00
When class `Namespace\ClassName` and is nowhere to be found, the stub file will be used to identify it.
2017-10-20 14:13:16 +02:00
### How to add Stub File?
2017-10-20 14:13:16 +02:00
- 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\...
```