Skip to content

Commit 34e8f5d

Browse files
author
Oliver Stark
committed
2.2.0
1 parent 0f33194 commit 34e8f5d

File tree

12 files changed

+57
-27
lines changed

12 files changed

+57
-27
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [2.2.0] - 2021-02-05
6+
### Changed
7+
- Added support for `symfony/process:^5.0`
8+
- Updated `phpunit/phpunit`
9+
- Removed `version` from composer.json
10+
- Switched to `psalm` for static analysis
11+
512
## [2.1.1] - 2020-04-03
613
### Fix
714
- Catch Exception when trying to count reserved jobs

composer.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "ostark/craft-async-queue",
33
"description": "A queue handler that moves queue execution to a non-blocking background process",
44
"type": "craft-plugin",
5-
"version": "2.1.1",
65
"keywords": [
76
"craft",
87
"cms",
@@ -22,6 +21,7 @@
2221
}
2322
],
2423
"require": {
24+
"php": ">=7.1",
2525
"craftcms/cms": "^3.0.0",
2626
"symfony/process": "^4.2|^5.0"
2727
},
@@ -38,12 +38,11 @@
3838
"changelogUrl": "https://raw.githubusercontent.com/ostark/craft-async-queue/master/CHANGELOG.md"
3939
},
4040
"require-dev": {
41-
"phpstan/phpstan": "^0.11.1",
42-
"phpunit/phpunit": "^6.0"
41+
"phpunit/phpunit": "^7.0",
42+
"vimeo/psalm": "^4.4"
4343
},
4444
"scripts": {
45-
"ps": "vendor/bin/phpstan analyse src --level=3 -c phpstan.neon",
46-
"stan": "@ps",
45+
"ps": "vendor/bin/phpstan.phar analyse src --level=3 -c phpstan.neon",
4746
"tests": "vendor/bin/phpunit -v"
4847
}
4948
}

phpstan.neon

Lines changed: 0 additions & 7 deletions
This file was deleted.

psalm.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="4"
4+
resolveFromConfigFile="true"
5+
autoloader="tests/bootstrap.php"
6+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7+
xmlns="https://getpsalm.org/schema/config"
8+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
9+
>
10+
<projectFiles>
11+
<directory name="src"/>
12+
<ignoreFiles>
13+
<directory name="vendor"/>
14+
</ignoreFiles>
15+
</projectFiles>
16+
<issueHandlers>
17+
<InvalidNullableReturnType>
18+
<errorLevel type="suppress">
19+
<file name="./src/Plugin.php"/>
20+
</errorLevel>
21+
</InvalidNullableReturnType>
22+
<NullableReturnStatement>
23+
<errorLevel type="suppress">
24+
<file name="./src/Plugin.php"/>
25+
</errorLevel>
26+
</NullableReturnStatement>
27+
</issueHandlers>
28+
</psalm>

src/Exceptions/LogicException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class LogicException extends \LogicException implements ProcessException
66
{
77
protected $process;
88

9-
public function setProcess(Process $process)
9+
public function setProcess(Process $process): void
1010
{
1111
$this->process = $process;
1212
}

src/Exceptions/ProcessException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
interface ProcessException
66
{
7-
public function setProcess(Process $process);
7+
public function setProcess(Process $process): void;
88

99
public function getProcess(): Process;
1010

src/Exceptions/RuntimeException.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44

55
class RuntimeException extends \RuntimeException implements ProcessException
66
{
7+
8+
/**
9+
* @var Process
10+
*/
711
protected $process;
812

9-
public function setProcess(Process $process)
13+
public function setProcess(Process $process): void
1014
{
1115
$this->process = $process;
1216
}

src/Handlers/BackgroundQueueHandler.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,7 @@ public function __invoke(PushEvent $event)
6464
}
6565

6666

67-
/**
68-
* @param \yii\queue\PushEvent $event
69-
* @param bool $handled
70-
*/
71-
protected function logPushEvent(PushEvent $event, $handled = false)
67+
protected function logPushEvent(PushEvent $event, bool $handled = false): void
7268
{
7369
if (!YII_DEBUG) {
7470
return;

src/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Plugin extends BasePlugin
3030
/**
3131
* Init plugin
3232
*/
33-
public function init()
33+
public function init(): void
3434
{
3535
parent::init();
3636

src/RateLimiter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ public function canIUse(string $context = null): bool
4949
return ($currentUsage < $this->maxItems) ? true : false;
5050
}
5151

52-
public function increment()
52+
public function increment(): void
5353
{
5454
$this->internalCount++;
5555
}
5656

5757

58-
protected function logAttempt(int $currentUsage, string $context = null)
58+
protected function logAttempt(int $currentUsage, string $context = null): void
5959
{
6060

6161
\Craft::debug(

0 commit comments

Comments
 (0)