anchor.diff:          extensions: [css, sass, less, scss]
   ----
   
  +=== Clean up packages
  +
  +When you are migrating continuously, it is entirely possible that your local TYPO3 Flow instance already contains some of the packages that would be created during migration. This step, modelled by the class `Mw\Metamorph\Transformation\CleanupPackages`, will clean up each target package so that migration is easily possible:
  +
  +. If you are using a source control system like Git, Metamorph will checkout the `metamorph` branch before actually doing anything. When the migration was completed, Metamorph will try to merge the `metamorph` branch back into your `master` branch.
  +. Otherwise, Metamorph will delete the package and have the next transformation step re-create it.
  +
  +=== Create packages
  +
  +The `Mw\Metamorph\Transformation\CreatePackages` step will now create all TYPO3 Flow packages that are specified in the _package mapping_. For this, Metamorph will use TYPO3 Flow's http://typo3.org/api/flow/TYPO3/Flow/Package/class-PackageManager.html[APIs for package management]:
  +
  +[source,php]
  +----
  +foreach ($packageMappingContainer->getPackageMappings() as $packageMapping) {
  +    if (FALSE === $this->packageManager->isPackageAvailable($packageMapping->getPackageKey())) {
  +        $this->packageManager->createPackage(
  +            $packageMapping->getPackageKey(),
  +            $this->createPackageMetaData($packageMapping),
  +            NULL,
  +            'typo3-flow-package'
  +        );
  +    }
  +}
  +----
  +
  +The package meta data (description, authors) will be migrated from the source extension.
  +
  +=== Migrate classes and resources
  +
  +These are actually two steps: `Mw\Metamorph\Transformation\CreateClasses` and `Mw\Metamorph\Transformation\CreatePackages`. Each of these steps walks the _class mapping_ (or _resource mapping_, respectively) and copies each file to the target location in the new TYPO3 Flow site.
  +
  +Classes are stored in the target package's _Classes/_ directory according to their class name (this is required, because they need to be auto-loadable). Resource files are simply placed in the target directory that is specified in the _resource mapping_.
  +
   === Analyzing the class definitions
  +
  +The `Mw\Metamorph\Transformation\AnalyzeClasses` step will iterate over each class from the _class mapping_ and analyze the class' inheritance structure and properties. This information is then stored in the _class definition container_. See <<Using the class definition container>> for more information on the _class definition container_.
  +
  +== Using the class definition container
  +
  +You have access to the class definitions after the _class analyzation step_ has been run. You can then inject an instance of the `Mw\Metamorph\Domain\Model\Definition\ClassDefinitionContainer` class into your own class and use this class to find class definitions that match certain constraints.
  +
  +The following code example gets all class definitions that inherit from one of Extbase's _FrontendUser_ classes:
  +
  +[source,php]
  +----
  +use Mw\Metamorph\Transformation\AbstractTransformation;
  +use Mw\Metamorph\Domain\Model\Definition\ClassDefinitionContainer;
  +use TYPO3\Flow\Annotations as Flow;
  +
  +class MyTransformation extends AbstractTransformation {
  +
  +    /**
  +     * @var ClassDefinitionContainer
  +     * @Flow\Inject
  +     */
  +    protected $container;
  +
  +    public function execute(MorphConfiguration $configuration, MorphExecutionState $state) {
  +        $userClasses = $this->container->findByFilter(function(ClassDefinition $c) {
  +            return
  +                $c->doesInherit('Tx_Extbase_Domain_Model_FrontendUser') ||
  +                $c->doesInherit('TYPO3\\CMS\\Extbase\\Domain\\Model\\FrontendUser');
  +        }); // <1>
  +
  +        foreach ($userClasses as $userClass) {
  +            $classMapping = $userClass->getClassMapping(); // <2>
  +
  +            foreach ($userClass->getProperties() as $property) { // <3>
  +                // Do some magic.
  +            }
  +        }
  +    }
  +}
  +----
  +<1> Use the `findByFilter` function with a callback to execute arbitrary queries.
  +<2> Each class definition is associated to the respective class mapping.
  +<3> Each class definition is associated to property definitions.
   
   == Modifying source code inside transformations
   
  
positive.code:     transformations:
        extensionInventory:
          name: ExtensionInventory # <1>
          position: 10 # <2>
        classInventory:
          name: ClassInventory
          position: 20
          settings: # <3>
            visitors: []
        resourceInventory:
          name: ResourceInventory
          position: after classInventory # <2>
  ----
  <1> This is a class name. If you specify an unqualified class name, Metamorph will assume the namespace `Mw\Metamorph\Transformation` for this class.
  <2> You can position elements using FLOW's _positional array sorter_.
  <3> Some transformations allow you to pass custom settings. These will be passed into the `setSettings` method of the transformation class.
  
  As you may have guessed, you are free to add additional transformation steps to this list in the settings of your own packages. This allows you to extend and modify Metamorph's default transformation process according to your own custom requirements.
  
negative.code: use Mw\Metamorph\Domain\Service\MorphExecutionState;
  use Symfony\Component\Console\Output\OutputInterface;
  
  interface Transformation {
      public function setSettings(array $settings);
      public function execute(
          MorphConfiguration $configuration,
  