Download the PHP package bearsunday/rector-bearsunday without Composer
On this page you can find all versions of the php package bearsunday/rector-bearsunday. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bearsunday/rector-bearsunday
More information about bearsunday/rector-bearsunday
Files in bearsunday/rector-bearsunday
Package rector-bearsunday
Short Description Rector upgrades rules for BEAR.Sunday Framework
License MIT
Informations about the package rector-bearsunday
Rector Rules for BEAR.Sunday
Rector rules to migrate BEAR.Sunday and Ray.Di applications from annotations to PHP 8 attributes.
Requirements
- PHP 8.2+
- Rector 2.0+
Installation
Usage
Run Rector using the provided configuration file:
Rules
RayDiNamedAnnotationRector
Converts @Named annotations on methods to #[Named] attributes on constructor parameters.
Before:
After:
AnnotationToAttributeRector
Converts BEAR.Sunday and Ray.Di annotations to PHP 8 attributes.
The provided rector.php configuration includes rules for:
Ray.Di:
@Inject→#[Inject]@Named→#[Named]@PostConstruct→#[PostConstruct]@Assisted→#[Assisted]@Set→#[Set]@Qualifier→#[Qualifier]
Ray.AuraSqlModule:
@ReadOnlyConnection→#[ReadOnlyConnection]@WriteConnection→#[WriteConnection]@Transactional→#[Transactional]
Ray.PsrCacheModule:
@CacheNamespace→#[CacheNamespace]@Local→#[Local]@Shared→#[Shared]@CacheDir→#[CacheDir]
Ray.WebContextParam:
@CookieParam→#[CookieParam]@EnvParam→#[EnvParam]@FilesParam→#[FilesParam]@FormParam→#[FormParam]@QueryParam→#[QueryParam]@ServerParam→#[ServerParam]
Ray.QueryModule:
@Query→#[Query]
Ray.RoleModule:
@RequiresRoles→#[RequiresRoles]
BEAR.Resource:
@AppName→#[AppName]@ContextScheme→#[ContextScheme]@Embed→#[Embed]@ImportAppConfig→#[ImportAppConfig]@Link→#[Link]@OptionsBody→#[OptionsBody]@ResourceParam→#[ResourceParam]
BEAR.Package:
@ReturnCreatedResource→#[ReturnCreatedResource]
BEAR.QueryRepository:
@Cacheable→#[Cacheable]@Purge→#[Purge]@Refresh→#[Refresh]
BEAR.Accept:
@Available→#[Available]@Produces→#[Produces]
SetterToConstructorInjectionRector
Converts setter injection with #[Inject] to constructor injection.
Before:
After:
TraitToConstructorInjectionRector
Converts trait-based injection to constructor injection.
Supported traits:
BEAR\Resource\ResourceInject→ResourceInterface $resourceBEAR\Sunday\Inject\ResourceInject→ResourceInterface $resourceBEAR\Sunday\Inject\PsrLoggerInject→LoggerInterface $loggerRay\Di\InjectorInject→InjectorInterface $injector
Before:
After:
ResourceObjectReturnTypeRector
Converts ResourceObject and self return types to static in resource methods.
Before:
After:
See Also
All versions of rector-bearsunday with dependencies
rector/rector Version ^2.0
koriym/attributes Version ^1.0
ray/di Version ^2.14