Skip to content

Commit f0e4aac

Browse files
committed
Hotfixes from 3.15.8 (#1226)
(cherry picked from commit bc58ee7)
1 parent c3afe74 commit f0e4aac

File tree

6 files changed

+63
-4
lines changed

6 files changed

+63
-4
lines changed

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# CHANGELOG
22

3+
## 3.15.8 - 2025-04-22
4+
5+
- **Bug Fixes**
6+
- [spiral/telemetry] Fixed `SpanInterface` singleton rebinding
7+
- [spiral/prototype] Fixed working of Prototype in container scopes
8+
9+
## 3.15.7 - 2025-03-31
10+
11+
- **Bug Fixes**
12+
- [spiral/core] Fixed proxy class generator failure when the proxied interface contains static return type
13+
- [spiral/core] Added resolving trace to Resolver exceptions
14+
15+
## 3.15.6 - 2025-03-29
16+
17+
- **Bug Fixes**
18+
- [spiral/core] Invoker::invoke() does not try to instantiate class to call a static function.
19+
- [spiral/core] Reworked resolving traces in container exceptions
20+
21+
## 3.15.5 - 2025-03-12
22+
23+
- **Bug Fixes**
24+
- [spiral/router] Fix issue when group prefix is not applied to routes
25+
26+
## 3.15.4 - 2025-02-17
27+
28+
- **Bug Fixes**
29+
- [spiral/telemetry] Removed ID from a Queue consumed job span
30+
It allows proper grouping of traces by job name
31+
332
## 3.15.3 - 2025-02-11
433

534
- **Bug Fixes**

psalm-baseline.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="6.9.6@61488aa2849793acfb72411829d114b4aa670941">
2+
<files psalm-version="6.10.1@f9fd6bc117e9ce1e854c2ed6777e7135aaa4966b">
33
<file src="src/Core/src/Internal/Actor.php">
44
<InvalidReturnStatement>
55
<code><![CDATA[$actor->registerInstance($ctx, $instance)]]></code>

src/Prototype/src/ClassNode/Type.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,26 @@
44

55
namespace Spiral\Prototype\ClassNode;
66

7+
use phpDocumentor\Reflection\Types\ClassString;
78
use Spiral\Prototype\Utils;
89

910
final class Type
1011
{
12+
/** @var non-empty-string|null */
1113
public ?string $alias = null;
1214

15+
/**
16+
* @param non-empty-string $shortName
17+
* @param non-empty-string|null $fullName
18+
*/
1319
private function __construct(
1420
public readonly string $shortName,
1521
public readonly ?string $fullName = null,
1622
) {}
1723

24+
/**
25+
* @param non-empty-string $name
26+
*/
1827
public static function create(string $name): Type
1928
{
2029
$fullName = null;
@@ -26,11 +35,17 @@ public static function create(string $name): Type
2635
return new self($name, $fullName);
2736
}
2837

38+
/**
39+
* @return non-empty-string
40+
*/
2941
public function getAliasOrShortName(): string
3042
{
3143
return $this->alias ?: $this->shortName;
3244
}
3345

46+
/**
47+
* @return non-empty-string
48+
*/
3449
public function getSlashedShortName(bool $builtIn): string
3550
{
3651
$type = $this->shortName;
@@ -41,6 +56,9 @@ public function getSlashedShortName(bool $builtIn): string
4156
return $type;
4257
}
4358

59+
/**
60+
* @return non-empty-string
61+
*/
4462
public function name(): string
4563
{
4664
return $this->fullName ?? $this->shortName;

src/Prototype/src/Dependency.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ final class Dependency
1414

1515
private function __construct() {}
1616

17+
/**
18+
* @param non-empty-string $name
19+
* @param non-empty-string $type
20+
*/
1721
public static function create(string $name, string $type): Dependency
1822
{
1923
$dependency = new self();

src/Prototype/src/PrototypeRegistry.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Psr\Container\ContainerExceptionInterface;
88
use Psr\Container\ContainerInterface;
9+
use Spiral\Core\Attribute\Proxy;
910
use Spiral\Core\Attribute\Singleton;
1011

1112
/**
@@ -14,23 +15,27 @@
1415
#[Singleton]
1516
final class PrototypeRegistry
1617
{
17-
/** @var Dependency[] */
18+
/** @var array<non-empty-string, Dependency> */
1819
private array $dependencies = [];
1920

2021
public function __construct(
22+
#[Proxy]
2123
private readonly ContainerInterface $container,
2224
) {}
2325

2426
/**
2527
* Assign class to prototype property.
28+
*
29+
* @param non-empty-string $property
30+
* @param non-empty-string $type
2631
*/
2732
public function bindProperty(string $property, string $type): void
2833
{
2934
$this->dependencies[$property] = Dependency::create($property, $type);
3035
}
3136

3237
/**
33-
* @return Dependency[]
38+
* @return array<non-empty-string, Dependency>
3439
*/
3540
public function getPropertyBindings(): array
3641
{
@@ -39,6 +44,8 @@ public function getPropertyBindings(): array
3944

4045
/**
4146
* Resolves the name of prototype dependency into target class name.
47+
*
48+
* @param non-empty-string $name
4249
*/
4350
public function resolveProperty(string $name): Dependency|ContainerExceptionInterface|null
4451
{

src/Telemetry/src/AbstractTracer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ final protected function runScope(SpanInterface $span, callable $callback): mixe
7070
)
7171
: $invoker->invoke($callback);
7272
} finally {
73+
/** @psalm-suppress TooManyArguments */
7374
$prevSpan === null
7475
? $binder->removeBinding(SpanInterface::class)
75-
: $binder->bindSingleton(SpanInterface::class, $prevSpan);
76+
: $binder->bindSingleton(SpanInterface::class, $prevSpan, true);
7677
}
7778
}
7879
}

0 commit comments

Comments
 (0)