Skip to content

Commit

Permalink
Merge branch 'master' into issue/1064
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/Boot/src/BootloadManager/Initializer.php
#	src/Boot/tests/BootloadManager/AttributeBootloadConfigTest.php
#	src/Boot/tests/BootloadManager/BootloadConfigTest.php
#	src/Boot/tests/BootloadManager/BootloadManagerTest.php
#	src/Boot/tests/BootloadManager/BootloadersTest.php
#	src/Boot/tests/BootloadManager/MergeBootloadConfigTest.php
#	src/Boot/tests/Fixtures/BootloaderC.php
#	src/Boot/tests/Fixtures/SampleBootWithMethodBoot.php
#	src/Boot/tests/Fixtures/SampleClass.php
#	src/Boot/tests/TestCase.php
  • Loading branch information
roxblnfk committed Jan 27, 2025
2 parents b9e53b0 + a6853fe commit 59fd71c
Show file tree
Hide file tree
Showing 1,423 changed files with 8,563 additions and 9,336 deletions.
10 changes: 0 additions & 10 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

10 changes: 10 additions & 0 deletions .github/workflows/cs-fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
on:
push:
branches:
- master

name: Fix Code Style

jobs:
cs-fix:
uses: spiral/gh-actions/.github/workflows/cs-fix.yml@master
8 changes: 7 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
->include(__DIR__ . '/src')
->include(__DIR__ . '/tests')
->include(__FILE__)
->exclude(__DIR__ . '/src/Core/tests/Fixtures')
->exclude(__DIR__ . '/src/Tokenizer/tests')
->exclude(__DIR__ . '/src/Prototype/tests')
->exclude(__DIR__ . '/src/Snapshots/tests')
->exclude(__DIR__ . '/src/Core/tests/Internal/Proxy/ProxyClassRendererTest.php')
->exclude(__DIR__ . '/src/Core/tests/Exception/ClosureRendererTraitTest.php')
->cache('./runtime/php-cs-fixer.cache')
->allowRisky(false)
->allowRisky(true)
->build();
21 changes: 0 additions & 21 deletions .styleci.yml

This file was deleted.

44 changes: 42 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
# CHANGELOG

## 3.15.0 - 2025-01-24

- Core
- `AppEnvironment` enum: added aliases for `production` and `test` environments by @roxblnfk.
- Added a new option in the container to control default behavior when rebinding singletons.
In the future, the container will be stricter by default,
so it's recommended to set `allowSingletonsRebinding` to `false` right away.
- Fixed resolving of scoped Autowire objects.
- Cache
- Added events that are dispatched before cache operations like `KeyWriting`, `CacheRetrieving`, `KeyDeleting`
and failed operations like `KeyWriteFailed`, `KeyDeleteFailed`.
- Optimized operations with multiple cache records.
- Added an ability to set custom cache storage.
- Router
- The `ServerRequestInterface` object is now passed into the call context of interceptors
- Added a new middleware pipeline `LazyPipeline`.
The pipeline resolves middleware from the container right before execution to avoid ignoring container scopes.
- `\Spiral\Http\Pipeline` is deprecated now.
- Added strict mode for `UriHandler`. Strict mode ensures all required URI segments are validated.
If any are missing, an exception is thrown.
- Telemetry
- `AbstractTracer::runScope()` method does not open a container scope anymore.
- Spans are no longer created for each Middleware: the pipeline fills the list with called middlewares in one span.
The number of pipelines equals the number of spans.
- The `http.response_content_length` field is no longer filled.

## 3.14.10 - 2025-01-22

- **Bug Fixes**
- [spiral/telemetry] Improve types for `SpanInterface`
- [spiral/stempler] Fix parsing of `@` inside a string that is not a directive

## 3.14.9 - 2025-01-07

- **Bug Fixes**
- [spiral/core] Define Auth* middleware in `http` scope
- [spiral/auth-http] Fixed injectors binding via `Binder::bind` method
- [spiral/telemetry] Fixed returning type in TelemetryProcessor for Monolog
- [spiral/stempler] Fixed directory import in stempler component

## 3.14.8 - 2024-12-11

- Definitions of nullable parameters have been fixed according to PHP 8.4 deprecations.
Expand All @@ -14,8 +54,8 @@
## 3.14.6 - 2024-10-22

- **Bug Fixes**
- [spiral/core] `ServerRequestInterface` is always resolved into a Proxy in the `http` scope
- [spiral/cache] `EventDispatcher` is now injected into `CacheManager`
- [spiral/core] `ServerRequestInterface` is always resolved into a Proxy in the `http` scope
- [spiral/cache] `EventDispatcher` is now injected into `CacheManager`

## 3.14.4 - 2024-09-23

Expand Down
5 changes: 2 additions & 3 deletions builder/ProcessParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ final class ProcessParser implements TagParserInterface
private const COMMAND = ['git', 'tag', '-l', '--sort=committerdate'];

public function __construct(
private readonly ProcessRunner $processRunner
) {
}
private readonly ProcessRunner $processRunner,
) {}

/**
* Returns null, when there are no local tags yet
Expand Down
8 changes: 4 additions & 4 deletions builder/ValidateVersionReleaseWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class ValidateVersionReleaseWorker implements ReleaseWorkerInterface
{
public function __construct(
private readonly TagParserInterface $parser,
private ?string $gitDirectory = null
private ?string $gitDirectory = null,
) {
if ($gitDirectory === null) {
$this->gitDirectory = \dirname(__DIR__);
Expand All @@ -23,7 +23,7 @@ public function getDescription(Version $version): string
{
return \sprintf(
'Checking if the version [%s] is greater than the latest released version.',
$version->getVersionString()
$version->getVersionString(),
);
}

Expand All @@ -45,7 +45,7 @@ public function work(Version $version): void
throw new InvalidGitVersionException(\sprintf(
'Provided version "%s" must be greater than the last one: "%s"',
$version->getVersionString(),
$mostRecentVersion->getVersionString()
$mostRecentVersion->getVersionString(),
));
}

Expand All @@ -72,7 +72,7 @@ private function findMostRecentVersion(Version $version): ?string
return null;
}

\usort($tags, static fn (Version $a, Version $b) => $a->isGreaterThan($b) ? -1 : 1);
\usort($tags, static fn(Version $a, Version $b) => $a->isGreaterThan($b) ? -1 : 1);

return $tags[0]->getVersionString();
}
Expand Down
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"psr/http-server-middleware": "^1.0",
"psr/log": "1 - 3",
"psr/simple-cache": "2 - 3",
"ramsey/uuid": "^4.7",
"spiral/attributes": "^2.8|^3.0",
"spiral/composer-publish-plugin": "^1.0",
"symfony/console": "^6.1 || ^7.0",
Expand Down Expand Up @@ -91,8 +92,8 @@
"Spiral\\Distribution\\": "src/Distribution/src",
"Spiral\\DotEnv\\": "src/Bridge/Dotenv/src",
"Spiral\\Encrypter\\": "src/Encrypter/src",
"Spiral\\Exceptions\\": "src/Exceptions/src",
"Spiral\\Events\\": "src/Events/src",
"Spiral\\Exceptions\\": "src/Exceptions/src",
"Spiral\\Files\\": "src/Files/src",
"Spiral\\Filters\\": "src/Filters/src",
"Spiral\\Http\\": "src/Http/src",
Expand Down Expand Up @@ -138,13 +139,12 @@
"league/flysystem-async-aws-s3": "^2.0 || ^3.0",
"league/flysystem-aws-s3-v3": "^2.0 || ^3.0",
"mikey179/vfsstream": "^1.6",
"mockery/mockery": "^1.5",
"phpunit/phpunit": "10.5.3",
"mockery/mockery": "^1.6",
"phpunit/phpunit": "^10.5",
"ramsey/collection": "^1.2",
"ramsey/uuid": "^4.2.3",
"rector/rector": "~2.0.0",
"spiral/code-style": "^2.2",
"spiral/nyholm-bridge": "^1.2",
"spiral/code-style": "^2.2.2",
"spiral/nyholm-bridge": "^1.3",
"spiral/testing": "^2.8",
"spiral/validator": "^1.3",
"symplify/monorepo-builder": "^10.2.7",
Expand All @@ -158,8 +158,8 @@
"src/Auth/tests",
"src/AuthHttp/tests"
],
"Spiral\\Tests\\Broadcasting\\": "src/Broadcasting/tests",
"Spiral\\Tests\\Boot\\": "src/Boot/tests",
"Spiral\\Tests\\Broadcasting\\": "src/Broadcasting/tests",
"Spiral\\Tests\\Cache\\": "src/Cache/tests",
"Spiral\\Tests\\Config\\": "src/Config/tests",
"Spiral\\Tests\\Console\\": "src/Console/tests",
Expand All @@ -173,8 +173,8 @@
"Spiral\\Tests\\Distribution\\": "src/Distribution/tests",
"Spiral\\Tests\\DotEnv\\": "src/Bridge/Dotenv/tests",
"Spiral\\Tests\\Encrypter\\": "src/Encrypter/tests",
"Spiral\\Tests\\Exceptions\\": "src/Exceptions/tests",
"Spiral\\Tests\\Events\\": "src/Events/tests",
"Spiral\\Tests\\Exceptions\\": "src/Exceptions/tests",
"Spiral\\Tests\\Files\\": "src/Files/tests",
"Spiral\\Tests\\Filters\\": "src/Filters/tests",
"Spiral\\Tests\\Framework\\": "tests/Framework",
Expand Down Expand Up @@ -226,23 +226,23 @@
"spiral/debug": "self.version",
"spiral/distribution": "self.version",
"spiral/dotenv-bridge": "self.version",
"spiral/interceptors": "self.version",
"spiral/encrypter": "self.version",
"spiral/exceptions": "self.version",
"spiral/events": "self.version",
"spiral/exceptions": "self.version",
"spiral/files": "self.version",
"spiral/filters": "self.version",
"spiral/hmvc": "self.version",
"spiral/http": "self.version",
"spiral/interceptors": "self.version",
"spiral/logger": "self.version",
"spiral/mailer": "self.version",
"spiral/models": "self.version",
"spiral/monolog-bridge": "self.version",
"spiral/pagination": "self.version",
"spiral/prototype": "self.version",
"spiral/queue": "self.version",
"spiral/reactor": "self.version",
"spiral/router": "self.version",
"spiral/queue": "self.version",
"spiral/scaffolder": "self.version",
"spiral/security": "self.version",
"spiral/sendit": "self.version",
Expand Down
10 changes: 7 additions & 3 deletions monorepo-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,16 @@
],
],
'require-dev' => [
'phpunit/phpunit' => '^10.1',
'mockery/mockery' => '^1.5',
'spiral/code-style' => '^1.1',
'phpunit/phpunit' => '^10.5',
'mockery/mockery' => '^1.6',
'spiral/code-style' => '^2.2.2',
'symplify/monorepo-builder' => '^10.2.7',
'vimeo/psalm' => '^5.9',
],
'conflict' => [
"spiral/roadrunner-bridge" => "<3.7",
"spiral/sapi-bridge" => "<1.1"
],
]);

$services = $containerConfigurator->services();
Expand Down
10 changes: 10 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\Assign\RemoveDoubleAssignRector;
use Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector;
Expand All @@ -22,7 +23,9 @@
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitSelfCallRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\TypeDeclaration\Rector\Closure\AddClosureNeverReturnTypeRector;
use Rector\TypeDeclaration\Rector\Closure\ClosureReturnTypeRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictSetUpRector;

return RectorConfig::configure()
Expand Down Expand Up @@ -118,6 +121,10 @@
],

PreferPHPUnitThisCallRector::class,

MakeInheritedMethodVisibilitySameAsParentRector::class => [
__DIR__ . '/src/Models/tests/PublicEntity.php',
],
])
->withPhpSets(php81: true)
->withPreparedSets(deadCode: true, phpunitCodeQuality: true)
Expand All @@ -130,4 +137,7 @@
ClosureReturnTypeRector::class,
TypedPropertyFromStrictSetUpRector::class,
PreferPHPUnitSelfCallRector::class,
TypedPropertyFromAssignsRector::class,
AddClosureNeverReturnTypeRector::class,
MakeInheritedMethodVisibilitySameAsParentRector::class,
]);
8 changes: 4 additions & 4 deletions src/AnnotatedRoutes/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@
"require": {
"php": ">=8.1",
"spiral/attributes": "^2.8|^3.0",
"spiral/router": "^3.15"
"spiral/router": "^3.16"
},
"autoload": {
"psr-4": {
"Spiral\\Router\\": "src"
}
},
"require-dev": {
"mockery/mockery": "^1.5",
"phpunit/phpunit": "^10.1",
"mockery/mockery": "^1.6",
"phpunit/phpunit": "^10.5",
"spiral/framework": "^3.1",
"spiral/testing": "^2.8",
"spiral/nyholm-bridge": "^1.2",
"spiral/nyholm-bridge": "^1.3",
"vimeo/psalm": "^5.9"
},
"autoload-dev": {
Expand Down
5 changes: 2 additions & 3 deletions src/AnnotatedRoutes/src/Annotation/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public function __construct(
public readonly array $defaults = [],
public readonly ?string $group = null,
public readonly array $middleware = [],
public readonly int $priority = 0
) {
}
public readonly int $priority = 0,
) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class AnnotatedRoutesBootloader extends Bootloader

public function init(
TokenizerListenerRegistryInterface $listenerRegistry,
RouteLocatorListener $routeRegistrar
RouteLocatorListener $routeRegistrar,
): void {
$listenerRegistry->addListener($routeRegistrar);
}
Expand Down
Loading

0 comments on commit 59fd71c

Please sign in to comment.