Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 40a674a

Browse files
committed
Merge branch 'hotfix/bookdown'
Proper bookdown and mkdocs toolchains
2 parents f23cda3 + 6563d59 commit 40a674a

File tree

9 files changed

+31
-26
lines changed

9 files changed

+31
-26
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
.*.sw*
77
.*.un~
88
nbproject
9-
tmp/
109

10+
doc/html/
11+
tmp/
1112
clover.xml
1213
composer.lock
1314
coveralls-upload.json

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ code. While the current implementation is limited to generating PHP code, you
99
can easily extend the base class in order to provide code generation for other
1010
tasks: JavaScript, configuration files, apache vhosts, etc.
1111

12-
1312
- File issues at https://github.com/zendframework/zend-code/issues
14-
- Documentation is at http://framework.zend.com/manual/current/en/index.html#zend-code
13+
- Documentation is at http://zend-code.rtfd.org
14+
- Migration documentation from v2 to v3 is at http://zend-code.rtfd.org/en/latest/book/migration/

doc/book/generator/bookdown.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"title": "zend-code Generator Component",
3+
"content": [
4+
{"Intro": "intro.md"},
5+
{"Examples": "examples.md"},
6+
{"Reference": "reference.md"}
7+
]
8+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

doc/book/zend.code.migrate.2.to.3.md renamed to doc/book/migration.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Migrating from `Zend\Code` `2.*` to `3.0.0`
1+
# Migrating from zend-code v2 to v3
22

3-
### `string`, `int`, `float`, `bool` are no longer ignored
3+
## `string`, `int`, `float`, `bool` are no longer ignored
44

55
In 2.x, a `Zend\Code\Generator\ParameterGenerator` with name `foo` and type
66
`string`, `int`, `float` or `bool` simply generated code `"$foo"`:
@@ -27,7 +27,7 @@ if (in_array($type, ['string', 'int', 'float', 'bool'])) {
2727
$generator->setType($type);
2828
```
2929

30-
### `Zend\Code\Reflection\ParameterReflection#getType()` changes
30+
## `Zend\Code\Reflection\ParameterReflection#getType()` changes
3131

3232
PHP 7 introduced [`ReflectionParameter#getType()`](http://php.net/manual/en/reflectionparameter.gettype.php).
3333

@@ -37,7 +37,7 @@ was renamed to `Zend\Code\Reflection\ParameterReflection#detectType()`.
3737
If you relied on `Zend\Code\Reflection\ParameterReflection#getType()`, you can
3838
simply replace the method calls in your code.
3939

40-
### DocBlock types ignored by `Zend\Code\Generator\ParameterGenerator::fromReflection()`
40+
## DocBlock types ignored by `Zend\Code\Generator\ParameterGenerator::fromReflection()`
4141

4242
As a direct consequence of the previous change, calls to
4343
`Zend\Code\Generator\ParameterGenerator::fromReflection()` will not mirror the
@@ -73,7 +73,7 @@ That also means that reflecting scalar type hints from DocBlocks into the
7373
signature of a generated method may lead to fatal errors (due to signature
7474
mismatch) at runtime.
7575

76-
### Type strings are validated
76+
## Type strings are validated
7777

7878
If you attempt to generate type-hints for parameters or return types, those types are
7979
now validated before the code is generated.
@@ -94,7 +94,7 @@ $parameterGenerator->setType('\\'); // invalid (throws exception)
9494
```
9595

9696

97-
### Generated type-hints are now prefixed by `"\"`
97+
## Generated type-hints are now prefixed by `"\"`
9898

9999
Generated type-hints are now prefixed with the `NAMESPACE_SEPARATOR`,
100100
`"\"`.
@@ -116,14 +116,13 @@ In version 3.x, it produces `public function foo(\baz $bar) : \tab {}`.
116116
In order to avoid migration problems, be sure to always pass fully qualified class
117117
names to `Zend\Code\Generator\MethodGenerator` and `Zend\Code\Generator\ParameterGenerator`.
118118

119-
120-
### `Zend\Code\Generator\ParameterGenerator::$simple` was removed
119+
## `Zend\Code\Generator\ParameterGenerator::$simple` was removed
121120

122121
If you extended `Zend\Code\Generator\ParameterGenerator`, be sure to check if you
123122
are accessing the protected static variable `$simple`: it was removed, and you should
124123
adapt your code by either copying it into your class or avoiding its usage.
125124

126-
### `Zend\Code\Generator\ParameterGenerator::$type` has changed
125+
## `Zend\Code\Generator\ParameterGenerator::$type` has changed
127126

128127
If you extended `Zend\Code\Generator\ParameterGenerator`, be sure to check if you
129128
are accessing the protected variable `$type`: its type has changed.

doc/bookdown.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
2-
"title": "Zend\\Code",
3-
"target": "html/",
4-
"content": [
5-
"book/zend.code.generator.introduction.md",
6-
"book/zend.code.generator.reference.md",
7-
"book/zend.code.generator.examples.md",
8-
"book/zend.code.migrate.2.to.3.md"
9-
]
10-
}
2+
"title": "zend-code: Tools for reflecting, scanning, and generating PHP code",
3+
"content": [
4+
{"Intro": "../README.md"},
5+
"book/generator/bookdown.json",
6+
{"Migration from v2 to v3": "book/migration.md"}
7+
],
8+
"target": "./html"
9+
}

mkdocs.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ docs_dir: doc/book
22
site_dir: doc/html
33
pages:
44
- index.md
5-
- zend.code.generator.introduction.md
6-
- zend.code.generator.reference.md
7-
- zend.code.generator.examples.md
8-
- zend.code.migrate.2.to.3.md
5+
- { 'zend-code Generator Component': [{ Intro: generator/intro.md }, { Examples: generator/examples.md }, { Reference: generator/reference.md }] }
6+
- { 'Migration from v2 to v3': migration.md }
97
site_name: zend-code
10-
site_description: Zend\Code
8+
site_description: 'zend-code: Tools for reflecting, scanning, and generating PHP code'
119
repo_url: 'https://github.com/zendframework/zend-code'
1210
copyright: 'Copyright (c) 2016 <a href="http://www.zend.com/">Zend Technologies USA Inc.</a>'

0 commit comments

Comments
 (0)