Skip to content

Commit f99fbe7

Browse files
author
Oliver Stark
committed
tuned phpstan & fixed possible logging bug
1 parent a68d909 commit f99fbe7

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

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

5+
## [1.3.2] - 2018-04-06
6+
### Fixed
7+
- Delegate Exception::getMessage() instead of Exception to error log
8+
9+
### Changed
10+
- Increased phpstan analyse level from 1 to 5
11+
- Excluded expected errors from phpstan
12+
- Use `Craft::debug()` instead of deprecated `Craft::trace()`
13+
514
## [1.3.1] - 2018-04-05
615
### Changed
716
- Changed version constraint to `craftcms/cms: ^3.0.0`
@@ -37,7 +46,6 @@ All notable changes to this project will be documented in this file.
3746

3847

3948
## [1.1.0] - 2017-10-13
40-
4149
### Changed
4250
- Added AFTER_PUSH listener
4351
- Removed custom Queue class

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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": "1.3.1",
5+
"version": "1.3.2",
66
"keywords": [
77
"craft",
88
"cms",
@@ -40,7 +40,7 @@
4040
"phpstan/phpstan": "^0.9.2"
4141
},
4242
"scripts": {
43-
"ps": "vendor/bin/phpstan analyse src --level=1 -c phpstan.neon",
43+
"ps": "vendor/bin/phpstan analyse src --level=5 -c phpstan.neon",
4444
"stan": "@ps"
4545
}
4646
}

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ parameters:
44
- %currentWorkingDirectory%/vendor/craftcms/cms/src/Craft.php
55
ignoreErrors:
66
- '#Constant CRAFT_BASE_PATH not found#'
7+
- '#Method ostark\AsyncQueue\\Plugin::getHandler() should return ostark\\AsyncQueue\\QueueHandler but returns object|null#'

src/Plugin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function (ActionEvent $event) {
8989
*/
9090
public function getHandler(): QueueHandler
9191
{
92+
9293
return $this->get('async_handler');
9394
}
9495

src/QueueHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ public function startBackgroundProcess()
2828
try {
2929
$process->run();
3030
} catch (\Exception $e) {
31-
Craft::error($e, __METHOD__);
31+
Craft::error($e->getMessage(), __METHOD__);
3232
}
3333

34-
Craft::trace(
34+
Craft::debug(
3535
Craft::t(
3636
'async-queue',
3737
'Job status: {status}. Exit code: {code}', ['status' => $process->getStatus(), 'code' => $process->getExitCodeText()]

0 commit comments

Comments
 (0)