Pre-beta refactoring #792

Merged
merged 95 commits into from Apr 29, 2013

Projects

None yet

2 participants

@mvriel
phpDocumentor member

Goal

This refactoring has several goals:

  1. Change the structure file to a serialize object graph to enable:

    1. A better integration with twig
    2. Faster inheritance
    3. More flexible back-end
  2. Rewrite the default template in Twig and thus fix bugs related to the template

  3. Integrate Twig into Core
  4. Deprecate all XML related behaviour
  5. Add a router component to remove issues with changing URLs between templates
  6. Improve DIC Wiring in Application class to be able to improve DI handling

Tasks

This is not an exhaustive list as a lot of the refactoring has already been done before I discovered this feature in Github.

  • Write XML output Writer
  • Create compatibility layer
  • Allow smart selection of serialization type
  • Clean up code
  • Elements should be related to files
  • Deleted files are not yet removed from cache
  • Refactor XSL writer to have a dependency on the XML writer
  • Merge develop into branch
  • New twig template should link types in @param, etc to locations using router
  • Make cache path configurable / relative to target path
  • Verify that you can add your own transformation in the config without a template
  • Title does not appear to be set by default nor propagated; investigate
  • Write Changelog
  • Packages are not indexed and thus not shown
  • PHP Notice: Object of class phpDocumentor\Descriptor\PropertyDescriptor could not be converted to int in /vagrant/vendor/twig/twig/lib/Twig/Environment.php(321) : eval()'d code on line 664
  • Evaluate whether there is time to incorporate Monolog fully
  • Change ParentClass to Parent in ClassDescriptor
@joncave

The numbering has gone a bit wrong here.

mvriel added some commits Feb 2, 2013
@mvriel mvriel Create Descriptors and Serializer
The goal for this coding session was to have an 80% functional series of
descriptors and to implement 2 serializer, one for the default php version
and one for igbinary.

In addition was the code consuming the parser refactored to use the DIC
provided by pimple and extract dependencies away from the ParseCommand.
6d02606
@mvriel mvriel Merge branch 'develop' of github.com:phpDocumentor/phpDocumentor2 int…
…o serializing
cc7b9ba
@mvriel mvriel Replace XML references to ProjectDescriptor in Transformer
During this series of changes we have disabled the behaviours and started
refactoring the transformer objects to use the object model instead of the
xml output as it was before.

Some boyscouting was also executed in the sense of code cleanups
86ca6a1
@mvriel mvriel Introduced interfaces for the Descriptors
To enable forward compatibility and prevent future BC breaks we introduce interfaces for
descriptors. This will allow us or future third-parties to create their own descriptors, which
are injected using a custom builder, that may lazy-load properties from a database, for example.
4d3d56d
@mvriel mvriel Initial commit to include Twig in the Core 4b2ee24
@mvriel mvriel Refactor writers to use the new Object model
This commit contains the first refactoring for writers to support the new object model.
A lot of work needs to be done in this area as some of these are merely disabled and lean
on the old XML style.
54f2312
@mvriel mvriel Aesthetic refactoring 63e9cb1
@mvriel mvriel Update Application, Parser and Commands
This commit contains an update to move instantiation of dependencies to the DIC and update the
parser and commands to work with the new builder that enables the object model
2b28cf8
@mvriel mvriel Replace type's type to be Collection instead of String 8ef23ba
@mvriel mvriel Create documentation on archicture, improve descriptors and refactor …
…wiring
d797363
@mvriel mvriel Allowing translation component to be injected into plugins a56f05c
@mvriel mvriel Improved wiring between Template, Transformer and Application b7d8c51
@mvriel mvriel Update deps to latest version and add Monolog
During this refactoring run we will also slowly switch to Monolog. As such I have added it
and updated all dependencies. Due to a bug in ZF2 we need to temporarily switch to the
dev-master of zf2. After their next release we can switch back.
36dd311
@mvriel mvriel Rewiring transformer
The transformer is being changed to make better use of dependency injection. To this end
I have also updated the test for the transformer.
dbedc1f
@mvriel mvriel Refactor transformation process
* Loading of templates is done using JMS Serializer
* All dependencies have been re-arranged
* Processing of transformations have simplified
288a0ad
@mvriel mvriel Refactor layer superclass away
To improve the architecture of phpDocumentor I have removed the layer superclass for the Transformer.
0dd3831
@mvriel mvriel Replaced custom serializer with ZF2's Serializer object 8bcfd3e
@mvriel mvriel Refactored Graph Writer to use Object Graph 28387f7
@mvriel mvriel Add inheritance to the Descriptors
Serializing seems to take references into account and this means we can add indexes and
links to parent classes or interfaces by adding references to those indexes. This commit
will add those capabilities and refactor the Reflector builder to allow easy coupling.
286f97a
@mvriel mvriel Refactor checkstyle writer to new style.
The Checkstyle writer had to be converted to the new style architecture
16effec
@mvriel mvriel Refactor checkstyle writer to new style.
The Checkstyle writer had to be converted to the new style architecture
ab4e118
@mvriel mvriel Make Twig writer fully functional
The Twig writer was not capable of querying the Objetc Graph and correctly creating
artifacts. With this refactoring we introduced a Object Graph Walker that is capable of interpreting
a light version of the twig syntax to get the correct element from an object graph.
4a6358d
@mvriel mvriel Add Shared NFS to the Vagrant file to speed up NFS 9fc81f1
@mvriel mvriel Add routing
A crude routing implementation has been made so it will become possible to make the URL scheme
separate from the templates and so add more flexibility for creating and maintaining templates.
13f3aeb
@mvriel mvriel Improve twig support and descriptors 216a70e
@mvriel mvriel Continue work on the Descriptors to fill a new twig responsive template 143ad3f
@mvriel mvriel Removed definition layer and/or moved it to TagDescriptors f40e23c
@mvriel mvriel Add todo to remind me where I need to tackle #756 31ed341
@mvriel mvriel Added reference support for incremental processing
With incremental processing it is important to remove references to deleted code. Multiple
angles were investigated and currently we are adding 'real' references to objects in the code.
This means that if the value null is assigned to one of those references that the object is
destroyed rather than that reference being cut.

This allows us to remove the class from the index (and remove it's subreferences) and it will
be removed at all instances where it is used. Even though we do not know how many those are.
17a810f
@mvriel mvriel Remove unused use statement 8d9fc04
@mvriel mvriel Write tests for ArgumentDescriptor and ClassDescriptor
For the ArgumentDescriptor and ClassDescriptor classes should unit tests be written that
verify behaviour. During the writing of these tests was also the documentation updated and
some minor improvements made.
7a7c0bf
@mvriel mvriel Write unit tests for the Descriptors 96b71cd
@mvriel mvriel Write unit test for MethodDescriptor 2b47c14
@mvriel mvriel Add unit tests for the PropertyDescriptor class 74cf74c
@mvriel mvriel Fix error with setting a null ParentClass 5639c78
@mvriel mvriel Empty namespace should not result in empty subnamespace
An empty namespace means the root namespace and not a subnamespace.
9b1101d
@mvriel mvriel Reverted references implementation c338ddb
@mvriel mvriel Update plantuml to a new version b7812d4
@mvriel mvriel Replaced all directly linking elements with strings
The linker should add the relations between elements after
building has completed.
44faa4b
@mvriel mvriel Cleanup 6196883
@mvriel mvriel Add Compiler d726cf1
@mvriel mvriel Refactoring
During this refactoring session were the component specific initializations moved to
their own ServiceProvider and the application refactored as such, the events were
reenabled and some minor fixes and tweaks
a3fdc28
@mvriel mvriel Updated architecture documentation 12340b2
@mvriel mvriel Adding the research section and updating sphinx configuration 3217f65
@mvriel mvriel Started work on the compiler and the backwards compatibility plugin
After the refactoring is done will a significant part of the application be deprecated.
To give people time to migrate I will introduce a backwards compatibility plugin so that at
least until 2.1 all existing stuff will continue to work.
5f29249
@mvriel mvriel Writing more documentation 9e634d1
@mvriel mvriel Implement linker and add testing actions 093fb08
@mvriel mvriel Rewrite all parent classes and fixed a bug in the linker 773e9f8
@mvriel mvriel Added compiler pass to build namespace tree 04b3d8d
@mvriel mvriel Update element indexes and builder
Several new indexes were created to facilitate the generating of
documentation using Twig templates and some clean up was performed.
0978588
@mvriel mvriel was assigned Mar 27, 2013
@mvriel mvriel Enable caching using Zend\Cache
To persist the generated data we should cache the parsed file data to
a generic caching component, in this case Zend\Cache. By using this
future changes might allow for integration with redis or memcache,
which might increase performance even more.
486854f
@mvriel
phpDocumentor member

Instead of doing a plain serialize and deserialize of the entire tree will each file individually be stored in a cache. With these changes this is hardcoded to a file-based cache that stores data in the tmp folder. This needs refining later on to allow multiple projects on the same machine

mvriel added some commits Apr 2, 2013
@mvriel mvriel Clean up test suite
The test suite contains a series of tests that either do nothing (and thus
should not exist) contain tests that are broken due to refactoring, or
have become broken and obsolete.

Tests that could not be fixed within 10 minutes have been disabled and
should be fixed as part of the serialization refactoring.
0b98d49
@mvriel mvriel Add references to file descriptor and line numbers
Elements that are directly contained in a file (such as constants, functions, classes,
interfaces and traits) should have a back-reference to their respective file descriptor.
30b8947
@mvriel mvriel Fix numbering 0920eb1
@mvriel mvriel Add support for custom defined transformations e5c12e9
@mvriel mvriel Add AstXml writer
Previously phpDocumentor2 generated an XML file that was interpreted by the XSL based
templates to generate the HTML representation. With the current refactoring this has disappeared
and a new writer is introduced to still generate that XML for those who want it
2ddc7d7
@mvriel mvriel Moved commands to their respective components 26f7e6b
@mvriel mvriel Update config with new settings 4d6efb4
@mvriel mvriel Add i18n to ParseCommand and clean up
During this commit I have attempted to make the ParseCommand more readable and
at the same time add internationalization to the command. By moving all strings to
a messages table and addressing those using a code it is possible to reduce the size,
 and increase the readability, of the configure method.
e5c4793
@mvriel mvriel Fix missing messages and re-add target parameter
Due to the refactoring in the previous commit was an error introduced
that caused all messages in the core plugin not to be shown. This
was caused because Zend\I18n reindexes the arrays for messages when
you have multiple sources. Since the original codes were purel numeric
they were re-ordered as different integers.

In addition to the above the target option was re-added to the parse command
as a simpler version.
bf92e90
mvriel added some commits Apr 6, 2013
@mvriel mvriel Fix Behat Features 973c482
@mvriel mvriel Write test for Debug Compiler pass
Durign this coding session a test case was written for the Debug Compiler pass and
its contents extracted to a ProjectAnalyzer class.
d5f02ae
@mvriel mvriel Write test for Debug Compiler pass
Durign this coding session a test case was written for the Debug Compiler pass and
its contents extracted to a ProjectAnalyzer class.
3c017ec
@mvriel mvriel Add helper functions for inheritance
During the re-creation of the Responsive template in twig it became obvious that an easy
way needed to be added to retrieve the inherited methods, properties and constants. In addition
work was done on the routing component but this was not completed yet
9a80bca
@mvriel mvriel Remove exporter; all functionality has been moved to the XmlAst writer 27a73f3
@mvriel mvriel Move XSL writer back to the Core Plugin, it should remain to be suppo…
…rted
3be63a9
@mvriel mvriel Written the first draft of the changelog ae3c27e
@mvriel mvriel Fix namespace and initialization of Xsl writer after move 0b60127
@mvriel mvriel referenced this pull request Apr 11, 2013
Open

Re-add Doctrine support #796

mvriel added some commits Apr 11, 2013
@mvriel mvriel Implementing linker rules for parameters and responses 59ff861
@mvriel mvriel Fixing issues found while developing the new Twig based template e288b5a
@mvriel mvriel Improve support for titles 41dd618
@mvriel mvriel Rename AstXml writer to Xml writer a4b6b73
@mvriel mvriel Add support for packages
Packages are now aggregated in a compiler pass and exposed
using the descriptors.
00cc7ef
@mvriel mvriel Fix the XSL Writer dd0ce4e
@mvriel mvriel Send console output to logger 90c126b
@mvriel mvriel Improve output of TransformCommand and timing 24b9534
@mvriel mvriel Removed plugin architecture in favor of Service Providers e59d18b
@mvriel mvriel Removed custom log level class in favor of PSR-3 234c09c
@mvriel mvriel Moved validators to their individual parts and made them configurable 10ea464
@mvriel mvriel Change *etParentClass to *etParent 3c78494
@mvriel mvriel Fix issues with refactoring of *setParentClass to *etParent 7c26c85
@mvriel mvriel Fix issues with refactoring of *setParentClass to *etParent 572d536
@mvriel mvriel Improve DocBlocks edd082e
@mvriel mvriel Move behaviours to another location and add them to the XML Writer 2e9dd37
@mvriel mvriel Move version number to its own file
To make once-click deployment easier have I migrated the version number to its own file.
edd15e6
@mvriel mvriel Add tag handling and todo's for XML Writer 265b0f9
@mvriel mvriel Fix coding standard issues d38aab2
@mvriel mvriel Merge branch 'develop' of github.com:phpDocumentor/phpDocumentor2 int…
…o serializing

Conflicts:
	composer.json
	src/phpDocumentor/Command/Project/TransformCommand.php
	src/phpDocumentor/Plugin/Core/Transformer/Behaviour/AddLinkInformation.php
28f863a
@mvriel mvriel Updated composer with twig template and latest versions 9603ef4
@mvriel mvriel Fix error where traits index crashes app 0629b77
@mvriel mvriel Update changelog 949a762
@mvriel mvriel Updated contribution guide 171b2bf
@mvriel mvriel Moved Changelog to root 7259b83
@mvriel mvriel Write unit test for ArgvInput and update DocBlocks 3c74481
@mvriel mvriel merged commit b2bbf5a into phpDocumentor:develop Apr 29, 2013

1 check failed

Details default The Travis build could not complete due to an error
@mvriel mvriel deleted the mvriel:serializing branch May 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment