Skip to content

Commit

Permalink
add psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
sergix44 committed Jun 27, 2023
1 parent 259e494 commit 9da8d30
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
},
"require-dev": {
"pestphp/pest": "^2.0",
"php-di/php-di": "^7.0"
"php-di/php-di": "^7.0",
"vimeo/psalm": "^5.13"
},
"license": "MIT",
"autoload": {
Expand Down
17 changes: 17 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<psalm
errorLevel="7"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
findUnusedBaselineEntry="true"
findUnusedCode="false"
>
<projectFiles>
<directory name="src"/>
<ignoreFiles>
<directory name="vendor"/>
</ignoreFiles>
</projectFiles>
</psalm>
4 changes: 2 additions & 2 deletions src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public function delegateTo(ContainerInterface $container): void
}

/**
* @param string $class
* @return object|string|null
* @param string $class
*
* @throws ContainerException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
Expand Down
4 changes: 2 additions & 2 deletions src/Definition.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct(
) {
}

public function singleton(): self
public function singleton(): static
{
$this->shared = true;
return $this;
Expand All @@ -29,7 +29,7 @@ public function hasInstance(): bool
return $this->instance !== null;
}

public function getInstance(): object
public function getInstance(): object|null
{
return $this->instance;
}
Expand Down

0 comments on commit 9da8d30

Please sign in to comment.