Skip to content

Commit

Permalink
Merge pull request #58 from laminas/chore/remove-scanner-subsystem
Browse files Browse the repository at this point in the history
BC BREAK: removed `Scanner` component, removed `FileReflection`, removed `NameInformation` and made `DocBlockScanner` `@internal`
  • Loading branch information
Ocramius authored Dec 9, 2020
2 parents 1735224 + ab21223 commit 8e01f05
Show file tree
Hide file tree
Showing 60 changed files with 162 additions and 8,574 deletions.
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

0 comments on commit 8e01f05

Please sign in to comment.