Skip to content

Commit

Permalink
Remove broken result provider
Browse files Browse the repository at this point in the history
  • Loading branch information
veewee committed Feb 7, 2022
1 parent 418dc84 commit 2308a0e
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 31 deletions.
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "phpro/grumphp",
"type": "composer-plugin",
"description": "A composer plugin that enables source code quality checks.",
"license": "MIT",
"type": "composer-plugin",
"authors": [
{
"name": "Toon Verwerft",
Expand Down Expand Up @@ -81,12 +81,6 @@
"symplify/easy-coding-standard": "Lets GrumPHP check coding standard.",
"vimeo/psalm": "Lets GrumPHP discover errors in your code without running it."
},
"config": {
"sort-packages": true
},
"extra": {
"class": "GrumPHP\\Composer\\GrumPHPPlugin"
},
"autoload": {
"psr-4": {
"GrumPHP\\": "src"
Expand All @@ -100,6 +94,12 @@
"bin": [
"bin/grumphp"
],
"config": {
"sort-packages": true
},
"extra": {
"class": "GrumPHP\\Composer\\GrumPHPPlugin"
},
"scripts": {
"post-install-cmd": [
"GrumPHP\\Composer\\DevelopmentIntegrator::integrate"
Expand Down
8 changes: 4 additions & 4 deletions phive.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="psalm" version="^4.13.1" installed="4.13.1" location="./tools/psalm" copy="true"/>
<phar name="phpcs" version="^3.6.1" installed="3.6.1" location="./tools/phpcs" copy="true"/>
<phar name="phpcbf" version="^3.6.1" installed="3.6.1" location="./tools/phpcbf" copy="true"/>
<phar name="composer-normalize" version="^2.16.0" installed="2.16.0" location="./tools/composer-normalize" copy="true"/>
<phar name="psalm" version="^4.13.1" installed="4.20.0" location="./tools/psalm" copy="true"/>
<phar name="phpcs" version="^3.6.1" installed="3.6.2" location="./tools/phpcs" copy="true"/>
<phar name="phpcbf" version="^3.6.1" installed="3.6.2" location="./tools/phpcbf" copy="true"/>
<phar name="composer-normalize" version="^2.16.0" installed="2.23.1" location="./tools/composer-normalize" copy="true"/>
</phive>
1 change: 1 addition & 0 deletions src/Configuration/Environment/DotEnvRegistrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static function register(EnvConfig $config): void
$env = new Dotenv();

if ($config->hasFiles()) {
/** @psalm-suppress InvalidArgument - Psalm types in Dotenv class are not valid currently */
$env->overload(...$config->getFiles());
}

Expand Down
1 change: 0 additions & 1 deletion src/Fixer/Provider/FixableProcessProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
class FixableProcessProvider
{
/**
* @param Process $process
* @param int[] $successExitCodes
*
* @return callable(): FixResult
Expand Down
3 changes: 0 additions & 3 deletions src/Runner/MiddlewareStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
use GrumPHP\Collection\TaskResultCollection;
use GrumPHP\Runner\Middleware\RunnerMiddlewareInterface;

/**
* @psalm-immutable
*/
class MiddlewareStack
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace GrumPHP\Runner\TaskHandler\Middleware;

use Amp\Parallel\Worker\TaskFailureException;
use function Amp\call;
use Amp\Promise;
use GrumPHP\Exception\PlatformException;
Expand Down
16 changes: 3 additions & 13 deletions src/Runner/TaskHandler/Middleware/ParallelProcessingMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use GrumPHP\Runner\TaskResultInterface;
use GrumPHP\Runner\TaskRunnerContext;
use GrumPHP\Task\TaskInterface;
use Laravel\SerializableClosure\SerializableClosure;

class ParallelProcessingMiddleware implements TaskHandlerMiddlewareInterface
{
Expand Down Expand Up @@ -62,19 +61,12 @@ public function handle(TaskInterface $task, TaskRunnerContext $runnerContext, ca
*/
$enqueueParallelTask = function () use ($task, $runnerContext, $next, $currentEnv): Promise {
return parallel(
static function (array $parentEnv) use ($task, $runnerContext, $next): SerializableClosure {
static function (array $parentEnv) use ($task, $runnerContext, $next): TaskResultInterface {
$_ENV = array_merge($parentEnv, $_ENV);
/** @var TaskResultInterface $result */
$result = wait($next($task, $runnerContext));

return new SerializableClosure(
/**
* @return TaskResultInterface
*/
static function () use ($result) {
return $result;
}
);
return $result;
},
$this->poolFactory->create()
)($currentEnv);
Expand All @@ -86,9 +78,7 @@ static function () use ($result) {
*/
function () use ($enqueueParallelTask, $task, $runnerContext): \Generator {
try {
/** @var callable(): TaskResultInterface $resultProvider */
$resultProvider = yield $enqueueParallelTask();
$result = $resultProvider();
$result = yield $enqueueParallelTask();
} catch (\Throwable $error) {
return TaskResult::createFailed(
$task,
Expand Down
3 changes: 0 additions & 3 deletions src/Runner/TaskHandler/TaskHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
use GrumPHP\Runner\TaskRunnerContext;
use GrumPHP\Task\TaskInterface;

/**
* @psalm-immutable
*/
class TaskHandler
{
/**
Expand Down
Binary file modified tools/composer-normalize
Binary file not shown.
Binary file modified tools/phpcbf
Binary file not shown.
Binary file modified tools/phpcs
Binary file not shown.
Binary file modified tools/psalm
Binary file not shown.

0 comments on commit 2308a0e

Please sign in to comment.