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

BC BREAK: removed Scanner component, removed FileReflection, removed NameInformation and made DocBlockScanner @internal #58

Merged
merged 3 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
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
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,44 @@ All notable changes to this project will be documented in this file, in reverse
`laminas/laminas-zendframework-bridge` has been removed, and is instead to be installed optionally
by consumers of the library. If you are still migrating from `zendframework/zend-code`, you will
need to add it to your `composer.json` yourself, or directly use to `Laminas\Code` symbols.
- BC BREAK [laminas/laminas-code#58](https://github.com/laminas/laminas-code/pull/58) the `Scanner`
and `Annotation` components have been removed, and with it all API that interacted with it:
* `Laminas\Code\Generator\FileGeneratorRegistry` has been deleted
* `Laminas\Code\Generator\FileGenerator::fromReflectedFileName()` was removed
* `Laminas\Code\Generator\FileGenerator::fromReflection()` was removed
* `Laminas\Code\NameInformation` has been deleted
* `Laminas\Code\Reflection\ReflectionInterface` was marked `@internal`
* `Laminas\Code\Reflection\FileReflection` has been deleted
* `Laminas\Code\Generic\Prototype\PrototypeInterface` was marked `@internal`
* `Laminas\Code\Generic\Prototype\PrototypeClassFactory` was marked `@internal`
* `Laminas\Code\Generic\Prototype\PrototypeGenericInterface` was marked `@internal`
* `Laminas\Code\Annotation\AnnotationInterface` has been deleted
* `Laminas\Code\Annotation\Parser\GenericAnnotationParser` has been deleted
* `Laminas\Code\Annotation\Parser\ParserInterface` has been deleted
* `Laminas\Code\Annotation\Parser\DoctrineAnnotationParser` has been deleted
* `Laminas\Code\Annotation\AnnotationManager` has been deleted
* `Laminas\Code\Annotation\AnnotationCollection` has been deleted
* `Laminas\Code\Scanner\ValueScanner` has been deleted
* `Laminas\Code\Scanner\DirectoryScanner` has been deleted
* `Laminas\Code\Scanner\DocBlockScanner#$nameInformation` was removed
* `Laminas\Code\Scanner\DocBlockScanner#$annotationManager` was removed
* `Laminas\Code\Scanner\DocBlockScanner#$annotations` was removed
* `Laminas\Code\Scanner\DocBlockScanner#getAnnotations()` was removed
* `Laminas\Code\Scanner\DocBlockScanner` was marked `@internal`
* `Laminas\Code\Scanner\ConstantScanner` has been deleted
* `Laminas\Code\Scanner\FunctionScanner` has been deleted
* `Laminas\Code\Scanner\AnnotationScanner` has been deleted
* `Laminas\Code\Scanner\DerivedClassScanner` has been deleted
* `Laminas\Code\Scanner\ClassScanner` has been deleted
* `Laminas\Code\Scanner\AggregateDirectoryScanner` has been deleted
* `Laminas\Code\Scanner\TokenArrayScanner` has been deleted
* `Laminas\Code\Scanner\ParameterScanner` has been deleted
* `Laminas\Code\Scanner\FileScanner` has been deleted
* `Laminas\Code\Scanner\PropertyScanner` has been deleted
* `Laminas\Code\Scanner\CachingFileScanner` has been deleted
* `Laminas\Code\Scanner\ScannerInterface` has been deleted
* `Laminas\Code\Scanner\MethodScanner` has been deleted
* `Laminas\Code\Scanner\Util` has been deleted

### Fixed

Expand Down
11 changes: 0 additions & 11 deletions docs/book/generator/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,17 +322,6 @@ define('APPLICATION_ENV', 'testing');

## Add code to existing PHP files and classes

### Seeding PHP file code generation via reflection

You can add *PHP* code to an existing *PHP* file using the code generator. To do so, you need to
first do reflection on it. The static method `fromReflectedFileName()` allows you to do this.

```php
$generator = Laminas\Code\Generator\FileGenerator::fromReflectedFileName($path);
$generator->setBody("\$foo->bar();");
file_put_contents($path, $generator->generate());
```

### Seeding PHP class generation via reflection

You may add code to an existing class. To do so, first use the static `fromReflection()` method to
Expand Down
1 change: 0 additions & 1 deletion docs/book/generator/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ class Laminas\Code\Generator\FileGenerator extends Laminas\Code\Generator\Abstra
$filePath,
$usePreviousCodeGeneratorIfItExists = true,
$includeIfNotAlreadyIncluded = true)
public static function fromReflection(Laminas\Code\Reflection\FileReflection $reflectionFile)
public function setDocblock(Laminas\Code\Generator\DocBlockGenerator $docblock)
public function getDocblock()
public function setRequiredFiles($requiredFiles)
Expand Down
Loading