Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better highlighting for code snippets in README.md #460

Merged
merged 1 commit into from
Feb 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ See [AST extraction documentation](https://github.com/Roave/BetterReflection/tre
These act in the same way as the core reflection API, except they return a
`\Roave\BetterReflection\Reflection\ReflectionType` instance (which does not extend `\ReflectionType`).

```
```php
$reflectionType = $parameterInfo->getType();
```

However, Better Reflection also gives the ability to change, and remove type declarations. Removing these types might
be useful if you want to make code written for PHP 7 work in PHP 5 for example, or setting new types to do the
opposite. For example, you might want to set the PHP 7 return type declaration to that defined in the PHP DocBlock.

```
```php
// Change a function to ensure it returns an integer
$functionInfo->setReturnType('int');

Expand All @@ -50,7 +50,7 @@ $functionInfo->removeReturnType();

You can do similar things with parameter types also:

```
```php
$parameterInfo->setType('int');
$parameterInfo->removeType();
```