Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: introduce rector rules 🎉 #544

Merged
merged 1 commit into from
Jan 7, 2024
Merged

Conversation

nikophil
Copy link
Member

@nikophil nikophil commented Dec 28, 2023

Hi!

here is my present for christmas 🎁 🎅

I really felt this migration path was too much pain, so I decided to try to work on rector rules!

When my project is updated with the last 1.x-bc version (actually, the one which has ObjectFactory, still not merged), I have these results:

BEFORE using rector:

PhpUnit: Remaining direct deprecation notices (19782)
PhpStan: Found 85 errors

AFTER using rector (and polishing some stuff):

PhpUnit: Remaining direct deprecation notices (8)
PhpStan: Found 0 errors

(of course in both cases, tests are green.)

Actually the only deprecation left is:

Calling instance method "Zenstruck\Foundry\Object\Instantiator::withoutConstructor()"

There is no way with Rector to make it 100% accurate (or I haven't found how 😅)

The rector rules decide automatically if it must use ObjectFactory or PersistentProxyObjectFactory based on if the target class is final and if it is persisted.
Based on that, it automatically removes ->object() calls. Actually, I've introduced in my code a method unproxify(), and the only thing I have to do to make the tests pass is to remove by hand these calls, impossible to automatize this.

I think the way I've incorporated to Foundry is a bit clumsy, I followed their guide and applied the structure they suggest, I'll have to work on this. I don't even know if we should ship this in this repo, but I really think we should ship it somehow, I'm pretty happy with the result 😁

There are some things that are still needed:

  • create a rector "set" with the list of the rules.
  • And add an "how to" in the upgrade docs
  • add a way to read Symfony's config to be able to detect doctrine's mapping which have not been create with attributes
  • I don't think I'll bother to create a rector for the bundle's configuration: it's not so boring to do by hand in userland

merry christmas!

@nikophil nikophil changed the base branch from 1.x to 1.x-bc December 28, 2023 19:25
@nikophil nikophil changed the title rector feat: introduce rector rules Dec 28, 2023
@nikophil nikophil changed the title feat: introduce rector rules feat: introduce rector rules 🎉 Dec 28, 2023
@OskarStark
Copy link
Contributor

I am for shipping it in the repo 👍🏻

@nikophil
Copy link
Member Author

nikophil commented Dec 29, 2023

Hey @OskarStark

I'd be okay to ship it in this repo, but I'm wondering how it should be split from the main library: for now I've totally decoupled it in order not to mess with dependencies: we need rector/rector and phpstan/phpstan-doctrine (both of them require phpstan/phpstan).

It raises some issues:

  • currently in Foundry, we're using bamarni/composer-bin-plugin in order to separate "tools" dependencies (symfony doc, phpstan, psalm) from our main dependencies. But rector (and phpstan) will need to be at least in require-dev section (in order to run the tests), which kinda remove the benefit from bamarni/composer-bin-plugin.
  • if we ship this directly with Foundry, since we won't add rector/rector and phpstan/phpstan-doctrine in the main require section in composer.json, we'd need to ask users to install by themselves rector. Moreover my rules need rector ^0.18.

@nikophil nikophil force-pushed the rector branch 2 times, most recently from 3c9d20d to b7e42ac Compare December 29, 2023 15:30
@OskarStark
Copy link
Contributor

Faker does not require rector, but just ship the rules:
https://github.com/FakerPHP/Faker/blob/2.0/rector-migrate.php

thecodingmachine/safe does the same:
https://github.com/thecodingmachine/safe/blob/master/rector-migrate.php

So I would just ship the "rule set" which can then be included like:

<?php

declare(strict_types=1);
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodingStyle\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector;
use Rector\Config\RectorConfig;
use Rector\Core\ValueObject\PhpVersion;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\CodeQuality\Rector\ClassMethod\ReplaceTestAnnotationWithPrefixedFunctionRector;
use Rector\PHPUnit\PHPUnit100\Rector\Class_\StaticDataProviderClassMethodRector;
use Rector\PHPUnit\Rector\Class_\PreferPHPUnitSelfCallRector;
use Rector\PHPUnit\Set\PHPUnitLevelSetList;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Symfony\Set\SymfonyLevelSetList;
use Rector\Symfony\Set\SymfonySetList;
use Rector\Symfony\Set\TwigLevelSetList;
use function Safe\getcwd;

return static function (RectorConfig $rectorConfig): void {
    $rectorConfig->parallel();
    $rectorConfig->paths([
        __DIR__.'/.php-cs-fixer.dist.php',
        __DIR__.'/composer-unused.php',
        __DIR__.'/rector.php',
        __DIR__.'/phparkitect.php',
        __DIR__.'/src',
        __DIR__.'/migrations',
        __DIR__.'/tests',
    ]);

    $rectorConfig->skip([
        __DIR__.'/src/KnowledgeTools/InstanceConfig/Instances',
    ]);

    $rectorConfig->cacheClass(FileCacheStorage::class);
    $rectorConfig->cacheDirectory('./var/cache/rector');
    $rectorConfig->phpVersion(PhpVersion::PHP_83);
    $rectorConfig->importNames();
    $rectorConfig->importShortClasses(false);
    $rectorConfig->phpstanConfigs([
        getcwd().'/phpstan.neon.dist',
        'vendor/phpstan/phpstan-doctrine/extension.neon',
        'vendor/phpstan/phpstan-phpunit/extension.neon',
        'vendor/phpstan/phpstan-symfony/extension.neon',
        'vendor/phpstan/phpstan-webmozart-assert/extension.neon',
    ]);

    $rectorConfig->sets([
        SetList::PHP_83,
        LevelSetList::UP_TO_PHP_83,
        PHPUnitLevelSetList::UP_TO_PHPUNIT_90,
        PHPUnitSetList::PHPUNIT_91,
        PHPUnitSetList::PHPUNIT_CODE_QUALITY,
        SymfonyLevelSetList::UP_TO_SYMFONY_63,
        SymfonySetList::SYMFONY_CODE_QUALITY,
        DoctrineSetList::DOCTRINE_CODE_QUALITY,
        TwigLevelSetList::UP_TO_TWIG_240,
    ]);

    $rectorConfig->import(__DIR__.'/vendor/fakerphp/faker/rector-migrate.php');
    $rectorConfig->import(__DIR__.'/vendor/thecodingmachine/safe/rector-migrate.php');
};

@nikophil
Copy link
Member Author

cool, this sounds good, I think we can go in this direction, but there is a difference: they don't ship custom rules. So they don't need to test it... Currently I've added all the rules and their tests in a separate /utils directory, with its specific composer.json file and vendor directory. But I'm not really sure this split is needed.

Another thing : our rules need rector ^0.18 and phpstan-doctrine, I think I'll throw an exception if those requirements are not respected.

@OskarStark
Copy link
Contributor

cool, this sounds good, I think we can go in this direction, but there is a difference: they don't ship custom rules. So they don't need to test it... Currently I've added all the rules and their tests in a separate /utils directory, with its specific composer.json file and vendor directory. But I'm not really sure this split is needed.

That's another story, I am just talking about the end user, and how this can be consumed.

Another thing : our rules need rector ^0.18 and phpstan-doctrine, I think I'll throw an exception if those requirements are not respected.

Makes sense, or there is another way, that I am not aware of. @TomasVotruba can a rule define a rector version as minimum?


// $rectorConfig->when(ObjectMetadataResolver::class)
// ->needs('$objectManagerLoader')
// ->giveConfig('%doctrine.objectManagerLoader%'); // this does not work
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually it is more complex from user's POV to leverage phpstan's configuration than to override the service definition

see https://github.com/zenstruck/foundry/pull/544/files#diff-57df83b36e5e3d69ad38354b8047370ad4841d60ce901ee2d5020a3a28784a02


/**
* This is a totally dummy file, which is only helpful for autoloader:
* when this file exist, this class exists, and fixtures files using same class name will be considered as existing
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 28 to 27
// todo: add a parameter "prefer_proxy" ?
final class ChangeFactoryBaseClass extends AbstractRector
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this rector currently only transforms ModelFactory into ObjectFactory or PersistentProxyObjectFactory

I'm wondering how it would be useful to allow to transform intro PersistentObjectFactory

@nikophil nikophil force-pushed the rector branch 4 times, most recently from 52c8aac to 583a852 Compare December 31, 2023 09:36
@nikophil
Copy link
Member Author

I just added a RuleRequirementChecker using \Composer\InstalledVersions

@kbond
Copy link
Member

kbond commented Jan 3, 2024

This is great, thanks for this Christmas present @nikophil! I'm not concerned about all the extra code, we can remove it all in 2.x, right?

@nikophil
Copy link
Member Author

nikophil commented Jan 7, 2024

I'm not concerned about all the extra code, we can remove it all in 2.x, right?

I think we could do this, we'll have to advertise about the lastest 1.x version which will be part of the migration process

@nikophil nikophil force-pushed the rector branch 6 times, most recently from 2f25ba3 to eaac66b Compare January 7, 2024 14:31
@nikophil nikophil merged commit d51f2f1 into zenstruck:1.x-bc Jan 7, 2024
22 checks passed
@nikophil nikophil deleted the rector branch January 7, 2024 15:05
nikophil added a commit that referenced this pull request Jan 7, 2024
nikophil added a commit that referenced this pull request Feb 11, 2024
refactor: Foundry 2 BC layer

refactor: deprecate ModelFactory

refactor: deprecate ModelFactory::getDefaults()

refactor: deprecate ModelFactory::getClass()

refactor: add #[\ReturnTypeWillChange] to PersistentProxyObjectFactory::initialize()

refactor: deprecate proxy class

refactor: deprecate stuff in functions.php

refactor: deprecate RepositoryProxy

refactor: deprecate stuff in Instantiator

bot: fix cs [skip ci]

minor: deprecate more stuff

* refactor: deprecate passing callable to sequence

* refactor: deprecate usage of disable/enable_persisting without doctrine

* refactor: deprecate TestState for UnitTestConfig

bot: fix cs [skip ci]

refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final (#518)

* refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final

* refactor: introduce persistent_factory()

bot: fix cs [skip ci]

refactor: deprecate config database_resetter (#523)

* refactor: deprecate config database_resetter.orm in favor of orm.reset

* refactor: deprecate config database_resetter.odm in favor of mongo.reset

bot: fix cs [skip ci]

refactor: deprecate config instantiator.without_constructor (#522)

bot: fix cs [skip ci]

refactor: add BC layer for methods in Instantiator (#535)

refactor: change phpstan FactoryCollection return type (#530)

bot: fix cs [skip ci]

refactor: remove not working BC layer on Factory::__construct() (#529)

refactor(bc layer): introduce Proxy interface (#528)

bot: fix cs [skip ci]

refactor: deprecate config auto_refresh_proxies (#524)

bot: fix cs [skip ci]

refactor: better deprecations (#541)

bot: sync with template [skip ci]

bot: fix cs [skip ci]

feat: introduce ObjectFactory (#543)

bot: fix cs [skip ci]

feat: introduce rector rules 🎉 (#544)

refactor: create ObjectFactory with make:factory --no-persistence (#546)

refactor: more deprecations (#547)

* refactor: deprecate Factory::faker() outisde of a factory

* refactor: deprecate FactoryCollection::set()

bot: fix cs [skip ci]

fix: remove directory utils/rector/vendor from git

fix: rename Proxy::get() into Proxy::forceGet()

fix: rollback BC layer on sequence() attributes

fix(rector): handle extending user-defined factory class

fix(rector): proxify create() and instantiate() transformation (#549)

fix(rector): don't remove ->object() call for create() or instantiate()

refctor: deprecate FactoryCollection::factory() (#550)

refactor: deprecate using proxy with anonymous class

bot: fix cs [skip ci]

docs(bc layer): document known BC breaks (#554)

refactor: deprecate $orderBy argument in RepositoryDecorator::findOneBy() (#551)

fix(rector): bump rector/rector 1.0
nikophil added a commit that referenced this pull request Feb 13, 2024
refactor: Foundry 2 BC layer

refactor: deprecate ModelFactory

refactor: deprecate ModelFactory::getDefaults()

refactor: deprecate ModelFactory::getClass()

refactor: add #[\ReturnTypeWillChange] to PersistentProxyObjectFactory::initialize()

refactor: deprecate proxy class

refactor: deprecate stuff in functions.php

refactor: deprecate RepositoryProxy

refactor: deprecate stuff in Instantiator

bot: fix cs [skip ci]

minor: deprecate more stuff

* refactor: deprecate passing callable to sequence

* refactor: deprecate usage of disable/enable_persisting without doctrine

* refactor: deprecate TestState for UnitTestConfig

bot: fix cs [skip ci]

refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final (#518)

* refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final

* refactor: introduce persistent_factory()

bot: fix cs [skip ci]

refactor: deprecate config database_resetter (#523)

* refactor: deprecate config database_resetter.orm in favor of orm.reset

* refactor: deprecate config database_resetter.odm in favor of mongo.reset

bot: fix cs [skip ci]

refactor: deprecate config instantiator.without_constructor (#522)

bot: fix cs [skip ci]

refactor: add BC layer for methods in Instantiator (#535)

refactor: change phpstan FactoryCollection return type (#530)

bot: fix cs [skip ci]

refactor: remove not working BC layer on Factory::__construct() (#529)

refactor(bc layer): introduce Proxy interface (#528)

bot: fix cs [skip ci]

refactor: deprecate config auto_refresh_proxies (#524)

bot: fix cs [skip ci]

refactor: better deprecations (#541)

bot: sync with template [skip ci]

bot: fix cs [skip ci]

feat: introduce ObjectFactory (#543)

bot: fix cs [skip ci]

feat: introduce rector rules 🎉 (#544)

refactor: create ObjectFactory with make:factory --no-persistence (#546)

refactor: more deprecations (#547)

* refactor: deprecate Factory::faker() outisde of a factory

* refactor: deprecate FactoryCollection::set()

bot: fix cs [skip ci]

fix: remove directory utils/rector/vendor from git

fix: rename Proxy::get() into Proxy::forceGet()

fix: rollback BC layer on sequence() attributes

fix(rector): handle extending user-defined factory class

fix(rector): proxify create() and instantiate() transformation (#549)

fix(rector): don't remove ->object() call for create() or instantiate()

refctor: deprecate FactoryCollection::factory() (#550)

refactor: deprecate using proxy with anonymous class

bot: fix cs [skip ci]

docs(bc layer): document known BC breaks (#554)

refactor: deprecate $orderBy argument in RepositoryDecorator::findOneBy() (#551)

fix(rector): bump rector/rector 1.0

fix(bc layer): install php cs fixer for maker bundle (#560)
nikophil added a commit that referenced this pull request Mar 15, 2024
refactor: Foundry 2 BC layer

refactor: deprecate ModelFactory

refactor: deprecate ModelFactory::getDefaults()

refactor: deprecate ModelFactory::getClass()

refactor: add #[\ReturnTypeWillChange] to PersistentProxyObjectFactory::initialize()

refactor: deprecate proxy class

refactor: deprecate stuff in functions.php

refactor: deprecate RepositoryProxy

refactor: deprecate stuff in Instantiator

bot: fix cs [skip ci]

minor: deprecate more stuff

* refactor: deprecate passing callable to sequence

* refactor: deprecate usage of disable/enable_persisting without doctrine

* refactor: deprecate TestState for UnitTestConfig

bot: fix cs [skip ci]

refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final (#518)

* refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final

* refactor: introduce persistent_factory()

bot: fix cs [skip ci]

refactor: deprecate config database_resetter (#523)

* refactor: deprecate config database_resetter.orm in favor of orm.reset

* refactor: deprecate config database_resetter.odm in favor of mongo.reset

bot: fix cs [skip ci]

refactor: deprecate config instantiator.without_constructor (#522)

bot: fix cs [skip ci]

refactor: add BC layer for methods in Instantiator (#535)

refactor: change phpstan FactoryCollection return type (#530)

bot: fix cs [skip ci]

refactor: remove not working BC layer on Factory::__construct() (#529)

refactor(bc layer): introduce Proxy interface (#528)

bot: fix cs [skip ci]

refactor: deprecate config auto_refresh_proxies (#524)

bot: fix cs [skip ci]

refactor: better deprecations (#541)

bot: sync with template [skip ci]

bot: fix cs [skip ci]

feat: introduce ObjectFactory (#543)

bot: fix cs [skip ci]

feat: introduce rector rules 🎉 (#544)

refactor: create ObjectFactory with make:factory --no-persistence (#546)

refactor: more deprecations (#547)

* refactor: deprecate Factory::faker() outisde of a factory

* refactor: deprecate FactoryCollection::set()

bot: fix cs [skip ci]

fix: remove directory utils/rector/vendor from git

fix: rename Proxy::get() into Proxy::forceGet()

fix: rollback BC layer on sequence() attributes

fix(rector): handle extending user-defined factory class

fix(rector): proxify create() and instantiate() transformation (#549)

fix(rector): don't remove ->object() call for create() or instantiate()

refctor: deprecate FactoryCollection::factory() (#550)

refactor: deprecate using proxy with anonymous class

bot: fix cs [skip ci]

docs(bc layer): document known BC breaks (#554)

refactor: deprecate $orderBy argument in RepositoryDecorator::findOneBy() (#551)

fix(rector): bump rector/rector 1.0

fix(bc layer): install php cs fixer for maker bundle (#560)
nikophil added a commit that referenced this pull request Mar 21, 2024
refactor: Foundry 2 BC layer

refactor: deprecate ModelFactory

refactor: deprecate ModelFactory::getDefaults()

refactor: deprecate ModelFactory::getClass()

refactor: add #[\ReturnTypeWillChange] to PersistentProxyObjectFactory::initialize()

refactor: deprecate proxy class

refactor: deprecate stuff in functions.php

refactor: deprecate RepositoryProxy

refactor: deprecate stuff in Instantiator

bot: fix cs [skip ci]

minor: deprecate more stuff

* refactor: deprecate passing callable to sequence

* refactor: deprecate usage of disable/enable_persisting without doctrine

* refactor: deprecate TestState for UnitTestConfig

bot: fix cs [skip ci]

refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final (#518)

* refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final

* refactor: introduce persistent_factory()

bot: fix cs [skip ci]

refactor: deprecate config database_resetter (#523)

* refactor: deprecate config database_resetter.orm in favor of orm.reset

* refactor: deprecate config database_resetter.odm in favor of mongo.reset

bot: fix cs [skip ci]

refactor: deprecate config instantiator.without_constructor (#522)

bot: fix cs [skip ci]

refactor: add BC layer for methods in Instantiator (#535)

refactor: change phpstan FactoryCollection return type (#530)

bot: fix cs [skip ci]

refactor: remove not working BC layer on Factory::__construct() (#529)

refactor(bc layer): introduce Proxy interface (#528)

bot: fix cs [skip ci]

refactor: deprecate config auto_refresh_proxies (#524)

bot: fix cs [skip ci]

refactor: better deprecations (#541)

bot: sync with template [skip ci]

bot: fix cs [skip ci]

feat: introduce ObjectFactory (#543)

bot: fix cs [skip ci]

feat: introduce rector rules 🎉 (#544)

refactor: create ObjectFactory with make:factory --no-persistence (#546)

refactor: more deprecations (#547)

* refactor: deprecate Factory::faker() outisde of a factory

* refactor: deprecate FactoryCollection::set()

bot: fix cs [skip ci]

fix: remove directory utils/rector/vendor from git

fix: rename Proxy::get() into Proxy::forceGet()

fix: rollback BC layer on sequence() attributes

fix(rector): handle extending user-defined factory class

fix(rector): proxify create() and instantiate() transformation (#549)

fix(rector): don't remove ->object() call for create() or instantiate()

refctor: deprecate FactoryCollection::factory() (#550)

refactor: deprecate using proxy with anonymous class

bot: fix cs [skip ci]

docs(bc layer): document known BC breaks (#554)

refactor: deprecate $orderBy argument in RepositoryDecorator::findOneBy() (#551)

fix(rector): bump rector/rector 1.0

fix(bc layer): install php cs fixer for maker bundle (#560)

refactor(bc layer): deprecate passing states as string to Factory::new() (#559)

bot: fix cs [skip ci]

minor: fix some types for sca

rector: remove un-needed Factory<Proxy<>> php docs

rector: migrate old proxy phpdoc to generic ones

rector: use getName() instead of cast to string nodes

rector: fix @method parameters rendering

bc: deprecate config auto_refresh_proxies

bc: introduce ProxyRepositoryDecorator

bot: fix cs [skip ci]

fix(proxy): assert object is not scheduled for insert before throwing in _refresh

minor(rector): change doc to comply to rector 1.0

bc: throw deprecation when calling Configuration::disableDefaultProxyAutoRefresh()

bot: fix cs [skip ci]

bc: throw deprecation when calling Configuration::disableDefaultProxyAutoRefresh()

bc: add repo class in ProxyRepositoryDecorator @methods in rector + maker

bot: fix cs [skip ci]

bc: fix Proxy sca problem in ModelFactory

bot: fix cs [skip ci]

bc: fix Proxy sca problem in ModelFactory

bot: fix cs [skip ci]

bc: fix PersistentObjectFactory @methods

fix(bc): add missing import

bc(rector): remove useless "unproxify" array_map

bc(rector): fix factories @method phpdoc

bc(rector): clean rector

bot: fix cs [skip ci]
nikophil added a commit that referenced this pull request Mar 21, 2024
refactor: Foundry 2 BC layer

refactor: deprecate ModelFactory

refactor: deprecate ModelFactory::getDefaults()

refactor: deprecate ModelFactory::getClass()

refactor: add #[\ReturnTypeWillChange] to PersistentProxyObjectFactory::initialize()

refactor: deprecate proxy class

refactor: deprecate stuff in functions.php

refactor: deprecate RepositoryProxy

refactor: deprecate stuff in Instantiator

bot: fix cs [skip ci]

minor: deprecate more stuff

* refactor: deprecate passing callable to sequence

* refactor: deprecate usage of disable/enable_persisting without doctrine

* refactor: deprecate TestState for UnitTestConfig

bot: fix cs [skip ci]

refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final (#518)

* refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final

* refactor: introduce persistent_factory()

bot: fix cs [skip ci]

refactor: deprecate config database_resetter (#523)

* refactor: deprecate config database_resetter.orm in favor of orm.reset

* refactor: deprecate config database_resetter.odm in favor of mongo.reset

bot: fix cs [skip ci]

refactor: deprecate config instantiator.without_constructor (#522)

bot: fix cs [skip ci]

refactor: add BC layer for methods in Instantiator (#535)

refactor: change phpstan FactoryCollection return type (#530)

bot: fix cs [skip ci]

refactor: remove not working BC layer on Factory::__construct() (#529)

refactor(bc layer): introduce Proxy interface (#528)

bot: fix cs [skip ci]

refactor: deprecate config auto_refresh_proxies (#524)

bot: fix cs [skip ci]

refactor: better deprecations (#541)

bot: sync with template [skip ci]

bot: fix cs [skip ci]

feat: introduce ObjectFactory (#543)

bot: fix cs [skip ci]

feat: introduce rector rules 🎉 (#544)

refactor: create ObjectFactory with make:factory --no-persistence (#546)

refactor: more deprecations (#547)

* refactor: deprecate Factory::faker() outisde of a factory

* refactor: deprecate FactoryCollection::set()

bot: fix cs [skip ci]

fix: remove directory utils/rector/vendor from git

fix: rename Proxy::get() into Proxy::forceGet()

fix: rollback BC layer on sequence() attributes

fix(rector): handle extending user-defined factory class

fix(rector): proxify create() and instantiate() transformation (#549)

fix(rector): don't remove ->object() call for create() or instantiate()

refctor: deprecate FactoryCollection::factory() (#550)

refactor: deprecate using proxy with anonymous class

bot: fix cs [skip ci]

docs(bc layer): document known BC breaks (#554)

refactor: deprecate $orderBy argument in RepositoryDecorator::findOneBy() (#551)

fix(rector): bump rector/rector 1.0

fix(bc layer): install php cs fixer for maker bundle (#560)

refactor(bc layer): deprecate passing states as string to Factory::new() (#559)

bot: fix cs [skip ci]

minor: fix some types for sca

rector: remove un-needed Factory<Proxy<>> php docs

rector: migrate old proxy phpdoc to generic ones

rector: use getName() instead of cast to string nodes

rector: fix @method parameters rendering

bc: deprecate config auto_refresh_proxies

bc: introduce ProxyRepositoryDecorator

bot: fix cs [skip ci]

fix(proxy): assert object is not scheduled for insert before throwing in _refresh

minor(rector): change doc to comply to rector 1.0

bc: throw deprecation when calling Configuration::disableDefaultProxyAutoRefresh()

bot: fix cs [skip ci]

bc: throw deprecation when calling Configuration::disableDefaultProxyAutoRefresh()

bc: add repo class in ProxyRepositoryDecorator @methods in rector + maker

bot: fix cs [skip ci]

bc: fix Proxy sca problem in ModelFactory

bot: fix cs [skip ci]

bc: fix Proxy sca problem in ModelFactory

bot: fix cs [skip ci]

bc: fix PersistentObjectFactory @methods

fix(bc): add missing import

bc(rector): remove useless "unproxify" array_map

bc(rector): fix factories @method phpdoc

bc(rector): clean rector

bot: fix cs [skip ci]
nikophil added a commit that referenced this pull request Mar 21, 2024
refactor: Foundry 2 BC layer

refactor: deprecate ModelFactory

refactor: deprecate ModelFactory::getDefaults()

refactor: deprecate ModelFactory::getClass()

refactor: add #[\ReturnTypeWillChange] to PersistentProxyObjectFactory::initialize()

refactor: deprecate proxy class

refactor: deprecate stuff in functions.php

refactor: deprecate RepositoryProxy

refactor: deprecate stuff in Instantiator

bot: fix cs [skip ci]

minor: deprecate more stuff

* refactor: deprecate passing callable to sequence

* refactor: deprecate usage of disable/enable_persisting without doctrine

* refactor: deprecate TestState for UnitTestConfig

bot: fix cs [skip ci]

refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final (#518)

* refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final

* refactor: introduce persistent_factory()

bot: fix cs [skip ci]

refactor: deprecate config database_resetter (#523)

* refactor: deprecate config database_resetter.orm in favor of orm.reset

* refactor: deprecate config database_resetter.odm in favor of mongo.reset

bot: fix cs [skip ci]

refactor: deprecate config instantiator.without_constructor (#522)

bot: fix cs [skip ci]

refactor: add BC layer for methods in Instantiator (#535)

refactor: change phpstan FactoryCollection return type (#530)

bot: fix cs [skip ci]

refactor: remove not working BC layer on Factory::__construct() (#529)

refactor(bc layer): introduce Proxy interface (#528)

bot: fix cs [skip ci]

refactor: deprecate config auto_refresh_proxies (#524)

bot: fix cs [skip ci]

refactor: better deprecations (#541)

bot: sync with template [skip ci]

bot: fix cs [skip ci]

feat: introduce ObjectFactory (#543)

bot: fix cs [skip ci]

feat: introduce rector rules 🎉 (#544)

refactor: create ObjectFactory with make:factory --no-persistence (#546)

refactor: more deprecations (#547)

* refactor: deprecate Factory::faker() outisde of a factory

* refactor: deprecate FactoryCollection::set()

bot: fix cs [skip ci]

fix: remove directory utils/rector/vendor from git

fix: rename Proxy::get() into Proxy::forceGet()

fix: rollback BC layer on sequence() attributes

fix(rector): handle extending user-defined factory class

fix(rector): proxify create() and instantiate() transformation (#549)

fix(rector): don't remove ->object() call for create() or instantiate()

refctor: deprecate FactoryCollection::factory() (#550)

refactor: deprecate using proxy with anonymous class

bot: fix cs [skip ci]

docs(bc layer): document known BC breaks (#554)

refactor: deprecate $orderBy argument in RepositoryDecorator::findOneBy() (#551)

fix(rector): bump rector/rector 1.0

fix(bc layer): install php cs fixer for maker bundle (#560)

refactor(bc layer): deprecate passing states as string to Factory::new() (#559)

bot: fix cs [skip ci]

minor: fix some types for sca

rector: remove un-needed Factory<Proxy<>> php docs

rector: migrate old proxy phpdoc to generic ones

rector: use getName() instead of cast to string nodes

rector: fix @method parameters rendering

bc: deprecate config auto_refresh_proxies

bc: introduce ProxyRepositoryDecorator

bot: fix cs [skip ci]

fix(proxy): assert object is not scheduled for insert before throwing in _refresh

minor(rector): change doc to comply to rector 1.0

bc: throw deprecation when calling Configuration::disableDefaultProxyAutoRefresh()

bot: fix cs [skip ci]

bc: throw deprecation when calling Configuration::disableDefaultProxyAutoRefresh()

bc: add repo class in ProxyRepositoryDecorator @methods in rector + maker

bot: fix cs [skip ci]

bc: fix Proxy sca problem in ModelFactory

bot: fix cs [skip ci]

bc: fix Proxy sca problem in ModelFactory

bot: fix cs [skip ci]

bc: fix PersistentObjectFactory @methods

fix(bc): add missing import

bc(rector): remove useless "unproxify" array_map

bc(rector): fix factories @method phpdoc

bc(rector): clean rector

bot: fix cs [skip ci]
nikophil added a commit that referenced this pull request Mar 21, 2024
refactor: Foundry 2 BC layer

refactor: deprecate ModelFactory

refactor: deprecate ModelFactory::getDefaults()

refactor: deprecate ModelFactory::getClass()

refactor: add #[\ReturnTypeWillChange] to PersistentProxyObjectFactory::initialize()

refactor: deprecate proxy class

refactor: deprecate stuff in functions.php

refactor: deprecate RepositoryProxy

refactor: deprecate stuff in Instantiator

bot: fix cs [skip ci]

minor: deprecate more stuff

* refactor: deprecate passing callable to sequence

* refactor: deprecate usage of disable/enable_persisting without doctrine

* refactor: deprecate TestState for UnitTestConfig

bot: fix cs [skip ci]

refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final (#518)

* refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final

* refactor: introduce persistent_factory()

bot: fix cs [skip ci]

refactor: deprecate config database_resetter (#523)

* refactor: deprecate config database_resetter.orm in favor of orm.reset

* refactor: deprecate config database_resetter.odm in favor of mongo.reset

bot: fix cs [skip ci]

refactor: deprecate config instantiator.without_constructor (#522)

bot: fix cs [skip ci]

refactor: add BC layer for methods in Instantiator (#535)

refactor: change phpstan FactoryCollection return type (#530)

bot: fix cs [skip ci]

refactor: remove not working BC layer on Factory::__construct() (#529)

refactor(bc layer): introduce Proxy interface (#528)

bot: fix cs [skip ci]

refactor: deprecate config auto_refresh_proxies (#524)

bot: fix cs [skip ci]

refactor: better deprecations (#541)

bot: sync with template [skip ci]

bot: fix cs [skip ci]

feat: introduce ObjectFactory (#543)

bot: fix cs [skip ci]

feat: introduce rector rules 🎉 (#544)

refactor: create ObjectFactory with make:factory --no-persistence (#546)

refactor: more deprecations (#547)

* refactor: deprecate Factory::faker() outisde of a factory

* refactor: deprecate FactoryCollection::set()

bot: fix cs [skip ci]

fix: remove directory utils/rector/vendor from git

fix: rename Proxy::get() into Proxy::forceGet()

fix: rollback BC layer on sequence() attributes

fix(rector): handle extending user-defined factory class

fix(rector): proxify create() and instantiate() transformation (#549)

fix(rector): don't remove ->object() call for create() or instantiate()

refctor: deprecate FactoryCollection::factory() (#550)

refactor: deprecate using proxy with anonymous class

bot: fix cs [skip ci]

docs(bc layer): document known BC breaks (#554)

refactor: deprecate $orderBy argument in RepositoryDecorator::findOneBy() (#551)

fix(rector): bump rector/rector 1.0

fix(bc layer): install php cs fixer for maker bundle (#560)

refactor(bc layer): deprecate passing states as string to Factory::new() (#559)

bot: fix cs [skip ci]

minor: fix some types for sca

rector: remove un-needed Factory<Proxy<>> php docs

rector: migrate old proxy phpdoc to generic ones

rector: use getName() instead of cast to string nodes

rector: fix @method parameters rendering

bc: deprecate config auto_refresh_proxies

bc: introduce ProxyRepositoryDecorator

bot: fix cs [skip ci]

fix(proxy): assert object is not scheduled for insert before throwing in _refresh

minor(rector): change doc to comply to rector 1.0

bc: throw deprecation when calling Configuration::disableDefaultProxyAutoRefresh()

bot: fix cs [skip ci]

bc: throw deprecation when calling Configuration::disableDefaultProxyAutoRefresh()

bc: add repo class in ProxyRepositoryDecorator @methods in rector + maker

bot: fix cs [skip ci]

bc: fix Proxy sca problem in ModelFactory

bot: fix cs [skip ci]

bc: fix Proxy sca problem in ModelFactory

bot: fix cs [skip ci]

bc: fix PersistentObjectFactory @methods

fix(bc): add missing import

bc(rector): remove useless "unproxify" array_map

bc(rector): fix factories @method phpdoc

bc(rector): clean rector

bot: fix cs [skip ci]
nikophil added a commit that referenced this pull request Mar 25, 2024
* refactor: Foundry 2 BC layer

refactor: Foundry 2 BC layer

refactor: deprecate ModelFactory

refactor: deprecate ModelFactory::getDefaults()

refactor: deprecate ModelFactory::getClass()

refactor: add #[\ReturnTypeWillChange] to PersistentProxyObjectFactory::initialize()

refactor: deprecate proxy class

refactor: deprecate stuff in functions.php

refactor: deprecate RepositoryProxy

refactor: deprecate stuff in Instantiator

bot: fix cs [skip ci]

minor: deprecate more stuff

* refactor: deprecate passing callable to sequence

* refactor: deprecate usage of disable/enable_persisting without doctrine

* refactor: deprecate TestState for UnitTestConfig

bot: fix cs [skip ci]

refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final (#518)

* refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final

* refactor: introduce persistent_factory()

bot: fix cs [skip ci]

refactor: deprecate config database_resetter (#523)

* refactor: deprecate config database_resetter.orm in favor of orm.reset

* refactor: deprecate config database_resetter.odm in favor of mongo.reset

bot: fix cs [skip ci]

refactor: deprecate config instantiator.without_constructor (#522)

bot: fix cs [skip ci]

refactor: add BC layer for methods in Instantiator (#535)

refactor: change phpstan FactoryCollection return type (#530)

bot: fix cs [skip ci]

refactor: remove not working BC layer on Factory::__construct() (#529)

refactor(bc layer): introduce Proxy interface (#528)

bot: fix cs [skip ci]

refactor: deprecate config auto_refresh_proxies (#524)

bot: fix cs [skip ci]

refactor: better deprecations (#541)

bot: sync with template [skip ci]

bot: fix cs [skip ci]

feat: introduce ObjectFactory (#543)

bot: fix cs [skip ci]

feat: introduce rector rules 🎉 (#544)

refactor: create ObjectFactory with make:factory --no-persistence (#546)

refactor: more deprecations (#547)

* refactor: deprecate Factory::faker() outisde of a factory

* refactor: deprecate FactoryCollection::set()

bot: fix cs [skip ci]

fix: remove directory utils/rector/vendor from git

fix: rename Proxy::get() into Proxy::forceGet()

fix: rollback BC layer on sequence() attributes

fix(rector): handle extending user-defined factory class

fix(rector): proxify create() and instantiate() transformation (#549)

fix(rector): don't remove ->object() call for create() or instantiate()

refctor: deprecate FactoryCollection::factory() (#550)

refactor: deprecate using proxy with anonymous class

bot: fix cs [skip ci]

docs(bc layer): document known BC breaks (#554)

refactor: deprecate $orderBy argument in RepositoryDecorator::findOneBy() (#551)

fix(rector): bump rector/rector 1.0

fix(bc layer): install php cs fixer for maker bundle (#560)

refactor(bc layer): deprecate passing states as string to Factory::new() (#559)

bot: fix cs [skip ci]

minor: fix some types for sca

rector: remove un-needed Factory<Proxy<>> php docs

rector: migrate old proxy phpdoc to generic ones

rector: use getName() instead of cast to string nodes

rector: fix @method parameters rendering

bc: deprecate config auto_refresh_proxies

bc: introduce ProxyRepositoryDecorator

bot: fix cs [skip ci]

fix(proxy): assert object is not scheduled for insert before throwing in _refresh

minor(rector): change doc to comply to rector 1.0

bc: throw deprecation when calling Configuration::disableDefaultProxyAutoRefresh()

bot: fix cs [skip ci]

bc: throw deprecation when calling Configuration::disableDefaultProxyAutoRefresh()

bc: add repo class in ProxyRepositoryDecorator @methods in rector + maker

bot: fix cs [skip ci]

bc: fix Proxy sca problem in ModelFactory

bot: fix cs [skip ci]

bc: fix Proxy sca problem in ModelFactory

bot: fix cs [skip ci]

bc: fix PersistentObjectFactory @methods

fix(bc): add missing import

bc(rector): remove useless "unproxify" array_map

bc(rector): fix factories @method phpdoc

bc(rector): clean rector

bot: fix cs [skip ci]

* rector: rewrite phpdoc (#571)

* fix(rector): repository method is static

* fix(rector) second argument for many() is optional
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants