Spiral Framework v3.0.0 Release Notes
Release Date: 2022-09-13 // over 1 year ago-
- High Impact Changes
- Component
spiral/data-grid-bridge
is removed fromspiral/framework
repository. Please, use standalone packagespiral/data-grid-bridge
instead. - Component
spiral/data-grid
is removed fromspiral/framework
repository. Please, use standalone packagespiral/data-grid
instead. Spiral\Boot\ExceptionHandler
has been eliminated. NewSpiral\Exceptions\ExceptionHandler
with interfacesSpiral\Exceptions\ExceptionHandlerInterface
,Spiral\Exceptions\ExceptionRendererInterface
andSpiral\Exceptions\ExceptionReporterInterface
have been added.- Console commands
Spiral\Command\Cycle\MigrateCommand
,Spiral\Command\Cycle\SyncCommand
,Spiral\Command\Cycle\UpdateCommand
,Spiral\Scaffolder\Command\MigrationCommand
,Spiral\Scaffolder\Command\Database\EntityCommand
,Spiral\Scaffolder\Command\Database\RepositoryCommand
,Spiral\Command\Database\ListCommand
,Spiral\Command\Database\TableCommand
,Spiral\Command\Migrate\InitCommand
,Spiral\Command\Migrate\MigrateCommand
,Spiral\Command\Migrate\ReplayCommand
,Spiral\Command\Migrate\RollbackCommand
,Spiral\Command\Migrate\StatusCommand
is removed. Use same console commands fromspiral/cycle-bridge
package. - Console commands
Spiral\Command\GRPC\ListCommand
,Spiral\Command\GRPC\GenerateCommand
is removed. Use same console commands fromspiral/roadrunner-bridge
package. - Classes
Spiral\Auth\Cycle\Token
,Spiral\Auth\Cycle\TokenStorage
,Spiral\Cycle\RepositoryInjector
,Spiral\Cycle\SchemaCompiler
,Spiral\Domain\CycleInterceptor
is removed. Use same classes fromspiral/cycle-bridge
instead. - Bootloaders
Spiral\Bootloader\Jobs\JobsBootloader
,Spiral\Bootloader\Server\LegacyRoadRunnerBootloader
,Spiral\Bootloader\Server\RoadRunnerBootloader
,Spiral\Bootloader\ServerBootloader
,Spiral\Bootloader\GRPC\GRPCBootloader
is removed. Usespiral/roadrunner-bridge
package. - Bootloaders
Spiral\Bootloader\Cycle\AnnotatedBootloader
,Spiral\Bootloader\Cycle\CycleBootloader
,Spiral\Bootloader\Cycle\ProxiesBootloader
,Spiral\Bootloader\Cycle\SchemaBootloader
,Spiral\Bootloader\Database\DatabaseBootloader
,Spiral\Bootloader\Database\DisconnectsBootloader
,Spiral\Bootloader\Database\MigrationsBootloader
is removed. Usespiral/cycle-bridge
package. - Bootloader
Spiral\Bootloader\Broadcast\BroadcastBootloader
is removed. Usespiral/roadrunner-broadcast
package instead. - Bootloader
Spiral\Bootloader\Http\WebsocketsBootloader
is removed. - Component
spiral/annotations
is removed. Usespiral/attributes
instead. - Added return type
void
to a methodspublish
,publishDirectory
,ensureDirectory
inSpiral\Module\PublisherInterface
interface. - Removed
Spiral\Http\SapiDispatcher
andSpiral\Http\Emitter\SapiEmitter
. Please, use packagespiral/sapi-bridge
instead. - Bootloader
Spiral\Bootloader\Http\DiactorosBootloader
is removed. You can use the bootloaderSpiral\Nyholm\Bootloader\NyholmBootloader
from the packagespiral/nyholm-bridge
to register PSR-7/PSR-17 factories. - Classes
Spiral\Http\Diactoros\ResponseFactory
,Spiral\Http\Diactoros\ServerRequestFactory
,Spiral\Http\Diactoros\StreamFactory
,Spiral\Http\Diactoros\UploadedFileFactory
,Spiral\Http\Diactoros\UriFactory
are removed. You can usespiral/nyholm-bridge
to define PSR-17 factories. - [spiral/exceptions] All handlers have been renamed into renderers.
HandlerInterface
has been deleted. - [spiral/exceptions] Added
Spiral\Exceptions\Verbosity
enum. - [spiral/router] Removed deprecated method
addRoute
in theSpiral\Router\RouterInterface
andSpiral\Router\Router
. Use methodsetRoute
instead. - [spiral/validation]
Spiral\Validation\Checker\EntityChecker
is removed. UseSpiral\Cycle\Bootloader\ValidationBootloader
withSpiral\Cycle\Validation\EntityChecker
from packagespiral/cycle-bridge
- [spiral/validation] Removed deprecated methods
datetime
andtimezone
in theSpiral\Validation\Checker\TypeChecker
class. UseSpiral\Validation\Checker\DatetimeChecker::valid()
andSpiral\Validation\Checker\DatetimeChecker::timezone()
instead. - [spiral/validation] Added return type
array|callable|string
to the methodparseCheck
inSpiral\Validation\ParserInterface
interface. - [spiral/validation] Added
array|string|\Closure
parameter type of$rules
to the methodgetRules
inSpiral\Validation\RulesInterface
interface. - [spiral/validation] Added
array|\ArrayAccess
parameter type of$data
to the methodvalidate
inSpiral\Validation\ValidationInterface
interface. - [spiral/validation] Added return type
mixed
to the methodgetValue
, addedmixed
parameter type of$default
to the methodgetValue
, addedmixed
parameter type of$context
to the methodwithContext
, added return typemixed
to the methodgetContext
inSpiral\Validation\ValidatorInterface
interface. - [spiral/filters] Added return type
void
andmixed
parameter type of$context
to the methodsetContext
, added return typemixed
to the methodgetContext
inSpiral\Filters\FilterInterface
interface. Added return typemixed
to the methodgetValue
inSpiral\Filters\InputInterface
. - [spiral/dumper] The
Dumper
Component has been removed from the Framework. - [spiral/http] Config
Spiral\Config\JsonPayloadConfig
moved to theSpiral\Bootloader\Http\JsonPayloadConfig
. - [spiral/reactor] Added return type
mixed
andarray|string
parameter type of$search
,array|string
parameter type of$replace
to the methodreplace
inSpiral\Reactor\ReplaceableInterface
. - [spiral/session] Added return type
void
to the methodresume
inSpiral\Session\SessionInterface
. - [spiral/session] Added return type
self
andmixed
parameter type of$value
to the methodset
inSpiral\Session\SessionSectionInterface
. - [spiral/session] Added return type
bool
to the methodhas
inSpiral\Session\SessionSectionInterface
. - [spiral/session] Added return type
mixed
andmixed
parameter type of$default
to the methodget
inSpiral\Session\SessionSectionInterface
. - [spiral/session] Added return type
mixed
andmixed
parameter type of$default
to the methodpull
inSpiral\Session\SessionSectionInterface
. - [spiral/session] Added return type
void
to the methoddelete
inSpiral\Session\SessionSectionInterface
. - [spiral/session] Added return type
void
to the methodclear
inSpiral\Session\SessionSectionInterface
. - [spiral/pagination] Added return type
self
to the methodlimit
, added return typeself
to the methodoffset
inSpiral\Pagination\PaginableInterface
- [spiral/prototype] Parameter
$printer
now is not nullable inSpiral\Prototype\Injector
constructor. - [spiral/models] Added return type
self
, addedmixed
parameter type of$value
to the methodsetField
, added return typemixed
, addedmixed
parameter type of$default
to the methodgetField
, added return typeself
to the methodsetFields
inSpiral\Models\EntityInterface
. - [spiral/models] Added return type
mixed
to the methodgetValue
inSpiral\Models\ValueInterface
. - [spiral/logger] Added return type
self
to the methodaddListener
, added return typevoid
to the methodremoveListener
inSpiral\Logger\ListenerRegistryInterface
interface. - [spiral/hmvc] Added return type
mixed
to the methodprocess
inSpiral\Core\CoreInterceptorInterface
interface. - [spiral/hmvc] Added return type
mixed
to the methodcallAction
inSpiral\Core\CoreInterface
interface. - [spiral/encrypter] Added return type
mixed
to the methoddecrypt
inSpiral\Encrypter\EncrypterInterface
interface. inSpiral\DataGrid\InputInterface
interface. - [spiral/http] Added return type
array
andmixed
parameter type of$filler
to the methodfetch
, added return typemixed
to the methodoffsetGet
, added return typemixed
andmixed
parameter type of$default
to the methodget
inSpiral\Http\Request\InputBag
class. - [spiral/config] Added return type
void
to the methodsetDefaults
inSpiral\Config\ConfiguratorInterface
interface. - [spiral/core] Comprehensive code refactoring. A lot of signatures from
Spiral\Core
namespace has been changed. New features: - Added supporting for PHP 8.0 Union types.
- Added supporting for variadic arguments:
- array passed by parameter name.
- with named arguments inside.
- with positional arguments inside.
- value passed by parameter name.
- positional trailed values.
- Support for default object value.
- Added supporting for referenced parameters in Resolver.
- The Factory now more strict: no more arguments type conversion.
- Added the
Spiral\Core\ResolverInterface::validateArguments
method for arguments validation. - Support for
WeakReference
bindings. - [spiral/boot] Method
starting
renamed tobooting
, methodstarted
renamed tobooted
in the classSpiral\Boot\AbstractKernel
. - [spiral/boot] Added return type
self
to the methodset
inSpiral\Boot\DirectoriesInterface
interface. - [spiral/boot] Added return type
mixed
andmixed
parameter type of$default
to the methodget
, added inSpiral\Boot\EnvironmentInterface
interface. - [spiral/boot] Added return type
static
to the methodaddFinalizer
, added return typevoid
to the methodfinalize
inSpiral\Boot\FinalizerInterface
interface. - [spiral/boot] Added return type
self
to the methodaddDispatcher
, added return typemixed
to the methodserve
inSpiral\Boot\KernelInterface
interface. - [spiral/boot] Added
exceptionHandler
parameter in theSpiral\Boot\AbstractKernel::create
method. - [spiral/boot]
Spiral\Boot\AbstractKernel
constructor is protected now. - [spiral/boot] Added return type
mixed
to the methodloadData
, added return typevoid
andmixed
parameter type of$data
to the methodsaveData
inSpiral\Boot\MemoryInterface
interface. - [spiral/boot] In
Bootloaders
, the name of the method has been changed fromboot
toinit
. In the code of custom Bootloaders, need to change the name of the method. - [spiral/console] Added return type
void
to the methodwriteHeader
, added return typevoid
to the methodexecute
, methodwhiteFooter
renamed towriteFooter
, added return typevoid
to the methodwriteFooter
inSpiral\Console\SequenceInterface
interface. - [spiral/files] Added return type
bool
to the methoddelete
, added return typebool
to the methoddeleteDirectory
, added return typebool
to the methodtouch
, added return typebool
to the methodsetPermissions
inSpiral\Files\FilesInterface
. - [spiral/views] Added return type
mixed
to the methodresolveValue
inSpiral\Views\ContextInterface
. - [spiral/views] Added return type
mixed
to the methodgetValue
inSpiral\Views\DependencyInterface
. - [spiral/translator] Added return type
void
to a methodssetLocales
,saveLocale
inSpiral\Translator\Catalogue\CacheInterface
. - [spiral/translator] Added return type
void
to the methodsave
inSpiral\Translator\CatalogueManagerInterface
. - [spiral/storage] Added
string|\Stringable
parameter type of$id
to a methodsgetContents
,getStream
,exists
,getLastModified
,getSize
,getMimeType
,getVisibility
inSpiral\Storage\Storage\ReadableInterface
. - [spiral/storage] Added
string|\Stringable
parameter type of$id
to a methodscreate
,setVisibility
,delete
. Addedstring|\Stringable
parameter type of$id
andmixed
parameter type of$content
to the methodwrite
, addedstring|\Stringable
parameter type of$source
and$destination
to a methodscopy
,move
inSpiral\Storage\Storage\WritableInterface
. - [spiral/stempler] Added return type
mixed
andmixed
parameter type of$default
to the methodgetAttribute
inSpiral\Stempler\Node\AttributedInterface
. - [spiral/stempler] Added return type
mixed
andmixed
parameter type of$node
to the methodenterNode
, added return typemixed
andmixed
parameter type of$node
to the methodleaveNode
inSpiral\Stempler\VisitorInterface
. - [spiral/sendit] Dropped support
pipeline
parameter inmailer
config. Please, use the parameterqueue
instead. - [spiral/security] Added return type
self
to a methodsaddRole
,removeRole
inSpiral\Security\PermissionsInterface
- [spiral/security] Added return type
self
to a methodsset
,remove
inSpiral\Security\RulesInterface
- [spiral/distribution] Bootloader
Spiral\Bootloader\Distribution\DistributionBootloader
moved to theSpiral\Distribution\Bootloader\DistributionBootloader
, configSpiral\Bootloader\Distribution\DistributionConfig
moved to theSpiral\Distribution\Config\DistributionConfig
. - [spiral/storage] Bootloader
Spiral\Bootloader\Storage\StorageBootloader
moved to theSpiral\Storage\Bootloader\StorageBootloader
, configSpiral\Bootloader\Storage\StorageConfig
moved to theSpiral\Storage\Config\StorageConfig
. - [spiral/validation] Bootloader
Spiral\Bootloader\Security\ValidationBootloader
moved to theSpiral\Validation\Bootloader\ValidationBootloader
. - [spiral/views] Bootloader
Spiral\Bootloader\Views\ViewsBootloader
moved to theSpiral\Views\Bootloader\ViewsBootloader
. - [spiral/boot] By default, overwriting of environment variable values is disabled, the default value for
$overwrite
changed fromtrue
tofalse
in theSpiral\Boot\Environment
. - [spiral/queue] Removed method
pushCallable
inSpiral\Queue\QueueTrait
. - [spiral/dotenv-bridge] Bootloader
Spiral\DotEnv\Bootloader\DotenvBootloader
must be moved from theLOAD
section to theSYSTEM
section in the applicationApp.php
file.
- Component
- Medium Impact Changes
- A minimal version of
PHP
increased to^8.1
- A minimal version of
symfony/finder
increased to^5.3
- A minimal version of
league/flysystem
increased to^2.3
- A minimal version of
symfony/console
increased to^6.0
Spiral\Snapshots\FileSnapshooter
usesVerbosity
enum instead of int flag.Spiral\Snapshots\FileSnapshooter
usesExceptionRendererInterface $renderer
instead ofHandlerInterface $handler
.Spiral\Snapshots\SnapshotterInterface
usage replaced withSpiral\Exceptions\ExceptionReporterInterface
in all classes.- Removed
bin/spiral
. Uses thespiral/roadrunner-cli
package instead.
- A minimal version of
- Other Features
- [spiral/queue] Added queue interceptors.
- [spiral/debug] Added
Spiral\Debug\StateConsumerInterface
. - [spiral/boot] Added new
boot
method inBootloaders
. It will be executed after theinit
method is executed in allBootloaders
. The oldboot
method has been renamed toinit
. See High Impact Changes section. - [spiral/boot] Added automatic booting of
Bootloaders
requested in theinit
andboot
methods. They no longer need to be specified explicitly inDEPENDENCIES
property or indefineDependencies
method. - [spiral/monolog-bridge] Added the ability to configure the default channel using the configuration file or
environment variable
MONOLOG_DEFAULT_CHANNEL
. - [spiral/serializer] Added a new spiral/serializer component. Contains an interface and a minimal implementation that can be extended by external serializers.
- [spiral/queue] Added the ability to configure serializers for different types of jobs.
- Added class
Spiral\Exceptions\Reporter\FileReporter
, which implementsSpiral\Exceptions\ExceptionReporterInterface
and can create text files with information about an exception.
- High Impact Changes