承接 neos/rector 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

neos/rector

Composer 安装命令:

composer require neos/rector

包简介

README 文档

README

This package contains a Rector ruleset which is used for migrating from Neos 8.x to 9.0 (and lateron also further up).

Right now we focus especially on rules to migrate from the old Content Repository API (< Neos 9.0) to the Event Sourced Content Repository (>= 9.0).

PHP-only migrations

Earlier version of neos/rector also did the migration of Yaml and Fusion file. They have been moved into Neos core migrations starting version 9.0.8. Now neos/rector only contains PHP migrations.

See for more details: neos/neos-development-collection#5607

Installation

Please install the neos/rector package in your Distribution as a dev dependency with composer.
(This has changed to previous versions of this package)

# inside your Distribution folder
composer require --dev neos/rector:dev-main
cp Packages/Libraries/neos/rector/rector.template.php rector.php

Configuration

Now, open up the rector.php file copied above, and adjust the Rector Paths (these are the paths which shall be migrated). By default, all of ./DistributionPackages will be migrated.

Right now, we ship the following sets of Rector rules:

  • \Neos\Rector\NeosRectorSets::CONTENTREPOSITORY_9_0: all rules needed to migrate to the Event-Sourced Content Repository
$rectorConfig->sets([
    NeosRectorSets::CONTENTREPOSITORY_9_0,
]);

$rectorConfig->paths([
    // TODO: Start adding your paths here, like so:
    __DIR__ . '/DistributionPackages/'
]);

Running

Run the following command at the root of your distribution (i.e. where rector.php is located).

# for trying out what would be done
./bin/rector --dry-run

# for running the migrations
./bin/rector

Developing Rector Rules for Neos

(This section is not relevant for users, but for developers of the Neos Rector packages)

Running Rector after adjusting rules

Make sure to run Rector with the --clear-cache flag while developing rules, when you run them on a full codebase.

Otherwise, Rector might not re-run for unmodified source files.

Running Tests

We develop all Rector Rules completely test-driven.

The test setup runs completely self contained; does not need any Distribution set up.

# if inside a Neos Distribution, change to the Package's folder
cd Packages/Libraries/neos/rector

# install PHPunit 
composer install

# run PHPUnit
composer tests

Generating docs

composer run generate-docs

统计信息

  • 总下载量: 1.68k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 7
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2022-10-05