Skip to content

Commit

Permalink
Merge pull request #87 from spiral/fix-declaration-locator
Browse files Browse the repository at this point in the history
Fix `DeclarationLocator` to use Tokenizer cache
  • Loading branch information
butschster committed May 23, 2024
2 parents 6f54fea + 2c9ca28 commit 6251b2e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@
],
"require": {
"php": "^8.1",
"spiral/boot": "^3.0",
"spiral/boot": "^3.13",
"spiral/attributes": "^2.8 || ^3.0",
"spiral/tokenizer": "^3.0",
"spiral/scaffolder": "^3.0",
"spiral/roadrunner-bridge": "^2.0 || ^3.0",
"spiral/tokenizer": "^3.13",
"spiral/scaffolder": "^3.13",
"spiral/roadrunner-bridge": "^2.0 || ^3.5",
"temporal/sdk": "^2.7"
},
"require-dev": {
"spiral/framework": "^3.0",
"spiral/testing": "^2.6",
"vimeo/psalm": "^5.17"
"spiral/framework": "^3.13",
"spiral/testing": "^2.7",
"vimeo/psalm": "^5.23"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
</ignoreFiles>
</projectFiles>
<issueHandlers>
<MissingClassConstType errorLevel="suppress" />
<DeprecatedInterface>
<errorLevel type="suppress">
<file name="src/Commands/InfoCommand.php"/>
Expand Down
4 changes: 2 additions & 2 deletions src/DeclarationLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
use Temporal\Workflow\WorkflowInterface;

#[Singleton]
// #[TargetAttribute(WorkflowInterface::class)]
// #[TargetAttribute(ActivityInterface::class)]
#[TargetAttribute(WorkflowInterface::class, scanParents: true)]
#[TargetAttribute(ActivityInterface::class, scanParents: true)]
final class DeclarationLocator implements
DeclarationRegistryInterface,
TokenizationListenerInterface,
Expand Down
3 changes: 2 additions & 1 deletion src/DeclarationRegistryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ interface DeclarationRegistryInterface
/**
* Add a new declaration to the registry.
*
* @param \ReflectionClass|class-string $class Workflow or activity class name or reflection.
* @param DeclarationDto|\ReflectionClass|class-string $class Workflow or activity class name or reflection
* or full declaration dto.
*/
public function addDeclaration(DeclarationDto|\ReflectionClass|string $class): void;

Expand Down

0 comments on commit 6251b2e

Please sign in to comment.