├── src └── NorbertTech │ └── SymfonyProcessExecutor │ ├── Exception │ └── Exception.php │ ├── Executor.php │ ├── SynchronousExecutor.php │ ├── AsynchronousExecutor.php │ ├── ProcessWrapper.php │ └── ProcessPool.php ├── LICENSE ├── composer.json ├── README.md ├── composer.lock ├── CHANGELOG.md └── .php-cs-fixer.php /src/NorbertTech/SymfonyProcessExecutor/Exception/Exception.php: -------------------------------------------------------------------------------- 1 | stopwatch->isStarted()) { 21 | throw new Exception('SynchronousExecutor already started'); 22 | } 23 | } 24 | 25 | /** 26 | * @throws Exception 27 | */ 28 | public function execute() : void 29 | { 30 | if ($this->stopwatch->isStarted()) { 31 | throw new Exception('SynchronousExecutor already started'); 32 | } 33 | 34 | $this->stopwatch->start(); 35 | $sleep = $this->sleep ?: TimeUnit::milliseconds(100); 36 | $total = TimeUnit::seconds(0); 37 | 38 | $this->pool->each(function (ProcessWrapper $process) use ($sleep, &$total) : void { 39 | /** @var TimeUnit $total */ 40 | $process->start(); 41 | $process->check(); 42 | 43 | if ($this->timeout) { 44 | if ($total->isGreaterThan($this->timeout)) { 45 | $process->kill(); 46 | } 47 | } 48 | 49 | while (!$process->finished()) { 50 | \Aeon\Sleep\sleep($sleep); 51 | 52 | $total = $total->add($sleep); 53 | 54 | if ($this->timeout) { 55 | if ($total->isGreaterThan($this->timeout)) { 56 | $process->kill(); 57 | } 58 | } 59 | 60 | $process->check(); 61 | } 62 | }); 63 | 64 | $this->stopwatch->stop(); 65 | } 66 | 67 | public function pool() : ProcessPool 68 | { 69 | return $this->pool; 70 | } 71 | 72 | public function executionTime() : TimeUnit 73 | { 74 | return $this->stopwatch->totalElapsedTime(); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/NorbertTech/SymfonyProcessExecutor/AsynchronousExecutor.php: -------------------------------------------------------------------------------- 1 | stopwatch->isStarted()) { 22 | throw new Exception('AsynchronousExecutor already started'); 23 | } 24 | } 25 | 26 | /** 27 | * @throws Exception 28 | */ 29 | public function execute() : void 30 | { 31 | if ($this->stopwatch->isStarted()) { 32 | throw new Exception('AsynchronousExecutor already started'); 33 | } 34 | 35 | $sleep = $this->sleep ?: TimeUnit::milliseconds(100); 36 | $total = TimeUnit::seconds(0); 37 | 38 | $this->stopwatch->start(); 39 | 40 | while ($this->pool->notStartedCount() > 0) { 41 | foreach ($this->pool->notStarted($this->batchSize) as $process) { 42 | $process->start(); 43 | } 44 | 45 | while ($this->pool->unfinishedCount() > 0) { 46 | foreach ($this->pool->notFinished() as $process) { 47 | $process->check(); 48 | } 49 | 50 | \Aeon\Sleep\sleep($sleep); 51 | 52 | $total = $total->add($sleep); 53 | 54 | if ($this->timeout) { 55 | if ($total->isGreaterThan($this->timeout)) { 56 | $this->pool->each(function (ProcessWrapper $process) : void { 57 | $process->kill(); 58 | }); 59 | } 60 | } 61 | } 62 | } 63 | 64 | $this->stopwatch->stop(); 65 | } 66 | 67 | public function pool() : ProcessPool 68 | { 69 | return $this->pool; 70 | } 71 | 72 | public function executionTime() : TimeUnit 73 | { 74 | return $this->stopwatch->totalElapsedTime(); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/NorbertTech/SymfonyProcessExecutor/ProcessWrapper.php: -------------------------------------------------------------------------------- 1 | process = $process; 27 | $this->stopwatch = new Stopwatch(); 28 | } 29 | 30 | public function started() : bool 31 | { 32 | return $this->pid !== null; 33 | } 34 | 35 | public function finished() : bool 36 | { 37 | return $this->exitCode !== null; 38 | } 39 | 40 | public function process() : Process 41 | { 42 | return $this->process; 43 | } 44 | 45 | public function start() : void 46 | { 47 | if ($this->started()) { 48 | return; 49 | } 50 | 51 | if ($this->finished()) { 52 | return; 53 | } 54 | 55 | $this->stopwatch->start(); 56 | $this->process->start(); 57 | $this->pid = $this->process->getPid(); 58 | 59 | if ($this->pid === null) { 60 | throw new Exception(\sprintf('Can\'t get pid for process %s', $this->process->getCommandLine())); 61 | } 62 | } 63 | 64 | public function kill() : void 65 | { 66 | if (!$this->started()) { 67 | return; 68 | } 69 | 70 | if ($this->finished()) { 71 | return; 72 | } 73 | 74 | $this->exitCode = $this->process->stop(0); 75 | $this->output = $this->process->getOutput(); 76 | $this->stopwatch->stop(); 77 | } 78 | 79 | public function check() : void 80 | { 81 | if (!$this->started()) { 82 | return; 83 | } 84 | 85 | if ($this->finished()) { 86 | return; 87 | } 88 | 89 | if ($this->process->isRunning()) { 90 | return; 91 | } 92 | 93 | $this->output = $this->process->getOutput(); 94 | $this->exitCode = $this->process->getExitCode(); 95 | $this->stopwatch->stop(); 96 | } 97 | 98 | public function output() : ?string 99 | { 100 | return $this->output; 101 | } 102 | 103 | public function exitCode() : ?int 104 | { 105 | return $this->exitCode; 106 | } 107 | 108 | public function pid() : ?int 109 | { 110 | return $this->pid; 111 | } 112 | 113 | public function executionTime() : TimeUnit 114 | { 115 | return $this->stopwatch->totalElapsedTime(); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Symfony Process Executor 2 | 3 | [![Tests](https://github.com/norberttech/symfony-process-executor/actions/workflows/tests.yml/badge.svg?branch=2.x)](https://github.com/norberttech/symfony-process-executor/actions/workflows/tests.yml) 4 | 5 | Tiny library that simplifies launching multiple processes in parallel (or not). 6 | 7 | ### Installation 8 | 9 | ```bash 10 | composer require norberttech/symfony-process-executor 11 | ``` 12 | 13 | ### Examples 14 | 15 | ```php 16 | execute(); 40 | 41 | $executor->pool()->each(function (ProcessWrapper $processWrapper) { 42 | var_dump($processWrapper->exitCode()); 43 | var_dump(\trim($processWrapper->output())); 44 | var_dump($processWrapper->executionTime()->inSeconds()); 45 | var_dump($processWrapper->executionTime()->inMilliseconds()); 46 | var_dump($processWrapper->executionTime()->microsecond()); 47 | echo "----\n"; 48 | }); 49 | 50 | echo \sprintf("Successfully finished child processes: %d\n", $executor->pool()->withSuccessExitCode()); 51 | echo \sprintf("Failure finished child processes: %d\n", $executor->pool()->withFailureExitCode()); 52 | echo \sprintf("Total execution time [s]: %d\n", $executor->executionTime()->inSecondsPreciseString()); 53 | ``` 54 | 55 | Output: 56 | 57 | ```bash 58 | php examples/async_multiple_success_processes.php 59 | 60 | int(0) 61 | string(1) "1" 62 | int(1) 63 | int(1033) 64 | int(1033295) 65 | ---- 66 | int(0) 67 | string(1) "2" 68 | int(2) 69 | int(2064) 70 | int(2064680) 71 | ---- 72 | int(0) 73 | string(1) "3" 74 | int(3) 75 | int(3092) 76 | int(3092137) 77 | ---- 78 | int(0) 79 | string(1) "4" 80 | int(4) 81 | int(4026) 82 | int(4026060) 83 | ---- 84 | int(0) 85 | string(1) "5" 86 | int(5) 87 | int(5052) 88 | int(5052531) 89 | ---- 90 | Successfully finished child processes: 5 91 | Failure finished child processes: 0 92 | Total execution time [s]: 5 93 | ``` 94 | 95 | ## Tests 96 | 97 | All tests for this library are written as phpt files, you can read more about it here https://qa.php.net/phpt_details.php. 98 | 99 | In order to launch full testsuite use composer 100 | 101 | ```php 102 | composer tests 103 | ``` 104 | -------------------------------------------------------------------------------- /src/NorbertTech/SymfonyProcessExecutor/ProcessPool.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | private array $processes; 15 | 16 | public function __construct(Process ...$processes) 17 | { 18 | $this->processes = \array_values(\array_map( 19 | function (Process $process) : ProcessWrapper { 20 | return new ProcessWrapper($process); 21 | }, 22 | $processes 23 | )); 24 | } 25 | 26 | /** 27 | * Returns processes that are not started yet. 28 | * 29 | * @return array 30 | */ 31 | public function notStarted(int $max = null) : array 32 | { 33 | $processes = []; 34 | 35 | foreach ($this->processes as $nextProcess) { 36 | if ($nextProcess->started()) { 37 | continue; 38 | } 39 | 40 | $processes[] = $nextProcess; 41 | 42 | if ($max !== null) { 43 | if (\count($processes) >= $max) { 44 | break; 45 | } 46 | } 47 | } 48 | 49 | return $processes; 50 | } 51 | 52 | /** 53 | * Returns count of processes that have been started but not finished yet. 54 | */ 55 | public function unfinishedCount() : int 56 | { 57 | return \array_reduce( 58 | $this->processes, 59 | function (int $unfinishedCount, ProcessWrapper $nextProcess) : int { 60 | if ($nextProcess->started() && !$nextProcess->finished()) { 61 | $unfinishedCount += 1; 62 | } 63 | 64 | return $unfinishedCount; 65 | }, 66 | 0 67 | ); 68 | } 69 | 70 | public function succeeded() : int 71 | { 72 | return \array_reduce( 73 | $this->processes, 74 | function (int $withExitCode, ProcessWrapper $nextProcess) : int { 75 | if ($nextProcess->finished()) { 76 | if ($nextProcess->exitCode() === 0) { 77 | $withExitCode += 1; 78 | } 79 | } 80 | 81 | return $withExitCode; 82 | }, 83 | 0 84 | ); 85 | } 86 | 87 | public function failed() : int 88 | { 89 | return \array_reduce( 90 | $this->processes, 91 | function (int $withExitCode, ProcessWrapper $nextProcess) : int { 92 | if ($nextProcess->finished()) { 93 | if ($nextProcess->exitCode() !== 0) { 94 | $withExitCode += 1; 95 | } 96 | } 97 | 98 | return $withExitCode; 99 | }, 100 | 0 101 | ); 102 | } 103 | 104 | public function each(callable $callback) : void 105 | { 106 | \array_map($callback, $this->processes); 107 | } 108 | 109 | public function notStartedCount() : int 110 | { 111 | return \array_reduce( 112 | $this->processes, 113 | function (int $notStartedCount, ProcessWrapper $nextProcess) : int { 114 | if (!$nextProcess->started()) { 115 | $notStartedCount += 1; 116 | } 117 | 118 | return $notStartedCount; 119 | }, 120 | 0 121 | ); 122 | } 123 | 124 | /** 125 | * Returns all processes in the pool. 126 | * 127 | * @return array 128 | */ 129 | public function all() : array 130 | { 131 | return $this->processes; 132 | } 133 | 134 | /** 135 | * Returns processes that have been started but not finished yet. 136 | * 137 | * @return array 138 | */ 139 | public function notFinished() : array 140 | { 141 | return \array_filter( 142 | $this->processes, 143 | function (ProcessWrapper $nextProcess) : bool { 144 | return $nextProcess->started() && !$nextProcess->finished(); 145 | } 146 | ); 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "3e12eadea6c654b29f2a7813c425976d", 8 | "packages": [ 9 | { 10 | "name": "aeon-php/calendar", 11 | "version": "1.0.11", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/aeon-php/calendar.git", 15 | "reference": "41f4b0ff07247c36b232ddfbcddc62af738be6fe" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/aeon-php/calendar/zipball/41f4b0ff07247c36b232ddfbcddc62af738be6fe", 20 | "reference": "41f4b0ff07247c36b232ddfbcddc62af738be6fe", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "php": "~8.2.0 || ~8.3.0 || ~8.4.0" 25 | }, 26 | "require-dev": { 27 | "ext-bcmath": "*", 28 | "ext-pcov": "*" 29 | }, 30 | "suggest": { 31 | "ext-bcmath": "Compare time units with high precision" 32 | }, 33 | "type": "library", 34 | "autoload": { 35 | "psr-4": { 36 | "Aeon\\": [ 37 | "src/Aeon" 38 | ] 39 | } 40 | }, 41 | "notification-url": "https://packagist.org/downloads/", 42 | "license": [ 43 | "MIT" 44 | ], 45 | "description": "PHP type safe, immutable calendar library", 46 | "keywords": [ 47 | "calendar", 48 | "date", 49 | "datetime", 50 | "immutable", 51 | "time" 52 | ], 53 | "support": { 54 | "issues": "https://github.com/aeon-php/calendar/issues", 55 | "source": "https://github.com/aeon-php/calendar/tree/1.0.11" 56 | }, 57 | "funding": [ 58 | { 59 | "url": "https://flow-php.com/sponsor", 60 | "type": "custom" 61 | }, 62 | { 63 | "url": "https://github.com/norberttech", 64 | "type": "github" 65 | } 66 | ], 67 | "time": "2025-01-24T04:47:09+00:00" 68 | }, 69 | { 70 | "name": "aeon-php/sleep", 71 | "version": "1.0.11", 72 | "source": { 73 | "type": "git", 74 | "url": "https://github.com/aeon-php/sleep.git", 75 | "reference": "59f44ef6313e0b05d65aa20369be1fcc937142d3" 76 | }, 77 | "dist": { 78 | "type": "zip", 79 | "url": "https://api.github.com/repos/aeon-php/sleep/zipball/59f44ef6313e0b05d65aa20369be1fcc937142d3", 80 | "reference": "59f44ef6313e0b05d65aa20369be1fcc937142d3", 81 | "shasum": "" 82 | }, 83 | "require": { 84 | "aeon-php/calendar": "~1.0", 85 | "php": "~8.2.0 || ~8.3.0 || ~8.4.0" 86 | }, 87 | "type": "library", 88 | "autoload": { 89 | "files": [ 90 | "src/Aeon/Sleep/sleep.php" 91 | ], 92 | "psr-4": { 93 | "Aeon\\": [ 94 | "src/Aeon" 95 | ] 96 | } 97 | }, 98 | "notification-url": "https://packagist.org/downloads/", 99 | "license": [ 100 | "MIT" 101 | ], 102 | "description": "Improved sleep function that uses simple TimeUnit and decides between \\sleep and \\usleep", 103 | "keywords": [ 104 | "calendar", 105 | "holidays", 106 | "immutable", 107 | "sleep" 108 | ], 109 | "support": { 110 | "issues": "https://github.com/aeon-php/sleep/issues", 111 | "source": "https://github.com/aeon-php/sleep/tree/1.0.11" 112 | }, 113 | "funding": [ 114 | { 115 | "url": "https://flow-php.com/sponsor", 116 | "type": "custom" 117 | }, 118 | { 119 | "url": "https://github.com/norberttech", 120 | "type": "github" 121 | } 122 | ], 123 | "time": "2025-01-24T04:47:20+00:00" 124 | }, 125 | { 126 | "name": "symfony/process", 127 | "version": "v7.3.4", 128 | "source": { 129 | "type": "git", 130 | "url": "https://github.com/symfony/process.git", 131 | "reference": "f24f8f316367b30810810d4eb30c543d7003ff3b" 132 | }, 133 | "dist": { 134 | "type": "zip", 135 | "url": "https://api.github.com/repos/symfony/process/zipball/f24f8f316367b30810810d4eb30c543d7003ff3b", 136 | "reference": "f24f8f316367b30810810d4eb30c543d7003ff3b", 137 | "shasum": "" 138 | }, 139 | "require": { 140 | "php": ">=8.2" 141 | }, 142 | "type": "library", 143 | "autoload": { 144 | "psr-4": { 145 | "Symfony\\Component\\Process\\": "" 146 | }, 147 | "exclude-from-classmap": [ 148 | "/Tests/" 149 | ] 150 | }, 151 | "notification-url": "https://packagist.org/downloads/", 152 | "license": [ 153 | "MIT" 154 | ], 155 | "authors": [ 156 | { 157 | "name": "Fabien Potencier", 158 | "email": "fabien@symfony.com" 159 | }, 160 | { 161 | "name": "Symfony Community", 162 | "homepage": "https://symfony.com/contributors" 163 | } 164 | ], 165 | "description": "Executes commands in sub-processes", 166 | "homepage": "https://symfony.com", 167 | "support": { 168 | "source": "https://github.com/symfony/process/tree/v7.3.4" 169 | }, 170 | "funding": [ 171 | { 172 | "url": "https://symfony.com/sponsor", 173 | "type": "custom" 174 | }, 175 | { 176 | "url": "https://github.com/fabpot", 177 | "type": "github" 178 | }, 179 | { 180 | "url": "https://github.com/nicolas-grekas", 181 | "type": "github" 182 | }, 183 | { 184 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 185 | "type": "tidelift" 186 | } 187 | ], 188 | "time": "2025-09-11T10:12:26+00:00" 189 | } 190 | ], 191 | "packages-dev": [], 192 | "aliases": [], 193 | "minimum-stability": "dev", 194 | "stability-flags": {}, 195 | "prefer-stable": true, 196 | "prefer-lowest": false, 197 | "platform": { 198 | "php": "^8.2" 199 | }, 200 | "platform-dev": {}, 201 | "plugin-api-version": "2.6.0" 202 | } 203 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [3.0.0] - 2025-05-03 2 | 3 | ### Changed 4 | - [#342](https://github.com/norberttech/symfony-process-executor/pull/342) - **Updated dependencies and readme** - [@norberttech](https://github.com/norberttech) 5 | - [298e77](https://github.com/norberttech/symfony-process-executor/commit/298e77852b9aadcc32bd956c33e82d9827b88bec) - **API of Executor Interface to allow executing parallel commands in chunks** - [@norberttech](https://github.com/norberttech) 6 | 7 | ### Updated 8 | - [69ed6d](https://github.com/norberttech/symfony-process-executor/commit/69ed6db8720175adfaf6d7b83b007f4038e03341) - **synchronouse executor docblocks** - [@norberttech](https://github.com/norberttech) 9 | 10 | ## [2.2.0] - 2025-05-02 11 | 12 | ### Added 13 | - [3e22b8](https://github.com/norberttech/symfony-process-executor/commit/3e22b871e0c24992eaccc15784ed4d4cbe341e97) - **common interface for executors** - [@norberttech](https://github.com/norberttech) 14 | 15 | ### Changed 16 | - [#326](https://github.com/norberttech/symfony-process-executor/pull/326) - **Allow Symfony 7** - [@PabloKowalczyk](https://github.com/PabloKowalczyk) 17 | 18 | ### Fixed 19 | - [01ceb2](https://github.com/norberttech/symfony-process-executor/commit/01ceb2aa7628f3bb24bbbbfc9f2a1dbe5b0e12d8) - **indention in tests.yaml** - [@norberttech](https://github.com/norberttech) 20 | 21 | ### Updated 22 | - [370769](https://github.com/norberttech/symfony-process-executor/commit/370769f416d3f7f1f9f8513fe45f09f3ad901b5b) - **github actions workflows & upgraded minimum required php version** - [@norberttech](https://github.com/norberttech) 23 | - [fe3641](https://github.com/norberttech/symfony-process-executor/commit/fe3641da469e086197305bfcd0426073fa0ca817) - **README.md** - [@norberttech](https://github.com/norberttech) 24 | - [8f6baa](https://github.com/norberttech/symfony-process-executor/commit/8f6baa66ae50c76485716559447427a9feedcbe4) - **changelog-update.yml** - [@norberttech](https://github.com/norberttech) 25 | - [25980f](https://github.com/norberttech/symfony-process-executor/commit/25980feabe4c94c8de6b339006375cf272b67ba7) - **tests.yml** - [@norberttech](https://github.com/norberttech) 26 | - [88f45b](https://github.com/norberttech/symfony-process-executor/commit/88f45be1b2fbd12f5a5583731915b02d6faff75c) - **static-analyze.yml** - [@norberttech](https://github.com/norberttech) 27 | - [1f2cec](https://github.com/norberttech/symfony-process-executor/commit/1f2cecc3ffecf3fc567b7d066b9ad1178e4fd583) - **tools dependnecies** - [@norberttech](https://github.com/norberttech) 28 | - [bee17a](https://github.com/norberttech/symfony-process-executor/commit/bee17aa76a54cc7c018a5b36c2d43bf3ed38db16) - **dependencies** - [@norberttech](https://github.com/norberttech) 29 | - [26e533](https://github.com/norberttech/symfony-process-executor/commit/26e5333440a00c7b93ec41eb6ed70c66052ca523) - **dependencies and fixed static analysis errors** - [@norberttech](https://github.com/norberttech) 30 | 31 | ### Removed 32 | - [fb264c](https://github.com/norberttech/symfony-process-executor/commit/fb264c64aff05af82ffbb1814eb8dc47dfad0131) - **automerge workflow** - [@norberttech](https://github.com/norberttech) 33 | - [b3ebe8](https://github.com/norberttech/symfony-process-executor/commit/b3ebe83d5571ebf438aade3e4482c023e6781e7a) - **php 8.0 and stick to 8.1** - [@norberttech](https://github.com/norberttech) 34 | - [cdd25c](https://github.com/norberttech/symfony-process-executor/commit/cdd25c39b4730a4bbe66c726f5eabafc11fc51a6) - **php 7.4 support** - [@norberttech](https://github.com/norberttech) 35 | 36 | ## [2.1.0] - 2022-01-01 37 | 38 | ### Added 39 | - [23209f](https://github.com/norberttech/symfony-process-executor/commit/23209f06ee1f45c00ab50a9ffa3efe7fe4791fb3) - **dependabot auto merge workflow** - [@norberttech](https://github.com/norberttech) 40 | 41 | ### Changed 42 | - [#17](https://github.com/norberttech/symfony-process-executor/pull/17) - **updated dependencies** - [@norberttech](https://github.com/norberttech) 43 | 44 | ### Updated 45 | - [ebc661](https://github.com/norberttech/symfony-process-executor/commit/ebc66118acf2a1a1a4673958cfec42b138c35e82) - **dependencies** - [@norberttech](https://github.com/norberttech) 46 | 47 | ### Removed 48 | - [#17](https://github.com/norberttech/symfony-process-executor/pull/17) - **phive** - [@norberttech](https://github.com/norberttech) 49 | 50 | ## [2.0.4] - 2021-01-25 51 | 52 | ### Added 53 | - [#3](https://github.com/norberttech/symfony-process-executor/pull/3) - **aeon-php/automation integraiton** - [@norberttech](https://github.com/norberttech) 54 | 55 | ### Fixed 56 | - [63ac6a](https://github.com/norberttech/symfony-process-executor/commit/63ac6adde0792465a2c01473954897e0644e7bcb) - **invalid target for changelog-update** - [@norberttech](https://github.com/norberttech) 57 | - [#3](https://github.com/norberttech/symfony-process-executor/pull/3) - **broken aeon-php/sleep dependency** - [@norberttech](https://github.com/norberttech) 58 | 59 | ## [2.0.3] - 2021-01-02 60 | 61 | ### Changed 62 | - [4a9111](https://github.com/norberttech/symfony-process-executor/commit/4a9111e5c5072324bd5678e9c1d029859fd22829) - **Changelog** - [@norberttech](https://github.com/norberttech) 63 | - [4af729](https://github.com/norberttech/symfony-process-executor/commit/4af72928fb48699a19aa474e4ab8406de1aaeca4) - **Feature/upgrade (#2)** - [@norberttech](https://github.com/norberttech) 64 | - [7d2315](https://github.com/norberttech/symfony-process-executor/commit/7d23153b7ed584a22b8be46a5ce50af148d0d4a7) - **phar dependencies** - [@norberttech](https://github.com/norberttech) 65 | 66 | ## [2.0.2] - 2020-08-18 67 | 68 | ### Removed 69 | - [851db4](https://github.com/norberttech/symfony-process-executor/commit/851db4fe52e7573f202b463a4a398803488f6083) - **tools from repository** - [@norberttech](https://github.com/norberttech) 70 | 71 | ## [2.0.1] - 2020-08-02 72 | 73 | ### Changed 74 | - [8aad8b](https://github.com/norberttech/symfony-process-executor/commit/8aad8bb45b2bb4bc9bbb11e65e69d781d9a59527) - **dependencies, moved tools to phive (#1)** - [@norberttech](https://github.com/norberttech) 75 | 76 | ## [2.0.0] - 2020-07-16 77 | 78 | ### Changed 79 | - [2e084b](https://github.com/norberttech/symfony-process-executor/commit/2e084bc35659a810c12ff965ee3f30b864ac8724) - **Use stable version of aeon-php/sleep** - [@norberttech](https://github.com/norberttech) 80 | - [c7dee3](https://github.com/norberttech/symfony-process-executor/commit/c7dee3d9ed26460c71c520516cfc89cca4f86712) - **Don't run tests against windows because of issues with slee 1 && echo 1 command** - [@norberttech](https://github.com/norberttech) 81 | - [d0f241](https://github.com/norberttech/symfony-process-executor/commit/d0f241c1aabb6f545bb0c2a3f7b2073bf62cd2e3) - **sleep with ping localhost at windows** - [@norberttech](https://github.com/norberttech) 82 | - [40e66f](https://github.com/norberttech/symfony-process-executor/commit/40e66f39ecba589151b4886e20256cb43a3c6e81) - **Run different commands tests on different operatin systems** - [@norberttech](https://github.com/norberttech) 83 | - [8af042](https://github.com/norberttech/symfony-process-executor/commit/8af0423b30e28cb2e74c769d7e68418efc263c15) - **Update tests.yml** - [@norberttech](https://github.com/norberttech) 84 | - [b877d7](https://github.com/norberttech/symfony-process-executor/commit/b877d758af2c61473587d0e3f8cf501c67b23fd8) - **Update static-analyze.yml** - [@norberttech](https://github.com/norberttech) 85 | - [a4b6f6](https://github.com/norberttech/symfony-process-executor/commit/a4b6f6837c201c97dfe43caf61610fff0b2c8b83) - **Update README.md** - [@norberttech](https://github.com/norberttech) 86 | - [c6495f](https://github.com/norberttech/symfony-process-executor/commit/c6495f95d9131b949a4f90083c474e30ffac8263) - **readme** - [@norberttech](https://github.com/norberttech) 87 | - [84b8d1](https://github.com/norberttech/symfony-process-executor/commit/84b8d1525affc8a2ee10f6d7e36283399e1cafea) - **Upgraded to php 7.4, added Aeon PHP** - [@norberttech](https://github.com/norberttech) 88 | 89 | ## [1.0.0] - 2020-04-23 90 | 91 | ### Changed 92 | - [2c7f8c](https://github.com/norberttech/symfony-process-executor/commit/2c7f8c94fdb4a5ab370f7c332528a34e76dea3e5) - **Update README.md** - [@norberttech](https://github.com/norberttech) 93 | - [152b62](https://github.com/norberttech/symfony-process-executor/commit/152b62849f9c1aadf277b89b3882e84a5014673d) - **Reduced sleep in syncrynouse multiple process with timeout test to satisfy cheap machines** - [@norberttech](https://github.com/norberttech) 94 | - [eabf36](https://github.com/norberttech/symfony-process-executor/commit/eabf3694dd49216664873fa32e652515331d8e2b) - **Locked cs-fixer version to avoid differences between latest and oldest depdendencies** - [@norberttech](https://github.com/norberttech) 95 | - [953fbf](https://github.com/norberttech/symfony-process-executor/commit/953fbf79092326d6cef62524892de77f6421f06e) - **Initial commit** - [@norberttech](https://github.com/norberttech) 96 | 97 | ### Fixed 98 | - [da76dc](https://github.com/norberttech/symfony-process-executor/commit/da76dcfe4157eb91fafd0e75c81f132b2835ec55) - **github workflow tests execution command** - [@norberttech](https://github.com/norberttech) 99 | 100 | ## Contributors 101 | 102 | - @norberttech 103 | - @PabloKowalczyk 104 | 105 | Generated by [Automation](https://github.com/aeon-php/automation) -------------------------------------------------------------------------------- /.php-cs-fixer.php: -------------------------------------------------------------------------------- 1 | in([ 5 | __DIR__ . '/src', 6 | __DIR__ . '/tests', 7 | __DIR__ . '/examples', 8 | ]); 9 | 10 | if (!\file_exists(__DIR__ . '/var')) { 11 | \mkdir(__DIR__ . '/var'); 12 | } 13 | 14 | /** 15 | * This configuration was taken from https://github.com/sebastianbergmann/phpunit/blob/master/.php_cs.dist 16 | * and slightly adjusted. 17 | */ 18 | $config = new PhpCsFixer\Config(); 19 | 20 | return $config 21 | ->setRiskyAllowed(true) 22 | ->setCacheFile(__DIR__.'/var/.php_cs.cache') 23 | ->setRules([ 24 | 'align_multiline_comment' => true, 25 | 'array_indentation' => true, 26 | 'array_syntax' => ['syntax' => 'short'], 27 | 'blank_line_after_namespace' => true, 28 | 'blank_line_before_statement' => [ 29 | 'statements' => [ 30 | 'break', 31 | 'continue', 32 | 'declare', 33 | 'default', 34 | 'do', 35 | 'exit', 36 | 'for', 37 | 'foreach', 38 | 'goto', 39 | 'if', 40 | 'include', 41 | 'include_once', 42 | 'require', 43 | 'require_once', 44 | 'return', 45 | 'switch', 46 | 'throw', 47 | 'try', 48 | 'while', 49 | ], 50 | ], 51 | 'braces' => true, 52 | 'cast_spaces' => true, 53 | 'class_attributes_separation' => ['elements' => ['const'=>'one', 'method'=>'one', 'property'=>'one']], 54 | 'combine_consecutive_issets' => true, 55 | 'combine_consecutive_unsets' => true, 56 | 'compact_nullable_typehint' => true, 57 | 'concat_space' => ['spacing' => 'one'], 58 | 'constant_case' => true, 59 | 'declare_equal_normalize' => ['space' => 'none'], 60 | 'declare_strict_types' => true, 61 | 'dir_constant' => true, 62 | 'elseif' => true, 63 | 'encoding' => true, 64 | 'echo_tag_syntax' => true, 65 | 'explicit_indirect_variable' => true, 66 | 'explicit_string_variable' => true, 67 | 'full_opening_tag' => true, 68 | 'fully_qualified_strict_types' => true, 69 | 'function_typehint_space' => true, 70 | 'function_declaration' => true, 71 | 'global_namespace_import' => [ 72 | 'import_classes' => false, 73 | 'import_constants' => false, 74 | 'import_functions' => false, 75 | ], 76 | 'heredoc_to_nowdoc' => true, 77 | 'increment_style' => [ 78 | 'style' => PhpCsFixer\Fixer\Operator\IncrementStyleFixer::STYLE_POST, 79 | ], 80 | 'indentation_type' => true, 81 | 'is_null' => true, 82 | 'line_ending' => true, 83 | 'list_syntax' => ['syntax' => 'short'], 84 | 'logical_operators' => true, 85 | 'lowercase_keywords' => true, 86 | 'lowercase_static_reference' => true, 87 | 'magic_constant_casing' => true, 88 | 'magic_method_casing' => true, 89 | 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], 90 | 'modernize_types_casting' => false, 91 | 'multiline_comment_opening_closing' => true, 92 | 'multiline_whitespace_before_semicolons' => true, 93 | 'native_constant_invocation' => false, 94 | 'native_function_casing' => false, 95 | 'native_function_invocation' => ['include'=>['@all']], 96 | 'native_function_type_declaration_casing' => true, 97 | 'new_with_braces' => false, 98 | 'no_alias_functions' => true, 99 | 'no_alternative_syntax' => true, 100 | 'no_blank_lines_after_class_opening' => true, 101 | 'no_blank_lines_after_phpdoc' => true, 102 | 'no_blank_lines_before_namespace' => false, 103 | 'no_closing_tag' => true, 104 | 'no_empty_comment' => true, 105 | 'no_empty_phpdoc' => true, 106 | 'no_empty_statement' => true, 107 | 'no_extra_blank_lines' => true, 108 | 'no_homoglyph_names' => true, 109 | 'no_leading_import_slash' => true, 110 | 'no_leading_namespace_whitespace' => true, 111 | 'no_mixed_echo_print' => ['use' => 'print'], 112 | 'no_multiline_whitespace_around_double_arrow' => true, 113 | 'no_null_property_initialization' => true, 114 | 'no_php4_constructor' => true, 115 | 'no_short_bool_cast' => true, 116 | 'no_singleline_whitespace_before_semicolons' => true, 117 | 'no_spaces_after_function_name' => true, 118 | 'no_spaces_around_offset' => true, 119 | 'no_spaces_inside_parenthesis' => true, 120 | 'no_superfluous_elseif' => true, 121 | 'no_superfluous_phpdoc_tags' => false, 122 | 'no_trailing_comma_in_list_call' => true, 123 | 'no_trailing_comma_in_singleline_array' => true, 124 | 'no_trailing_whitespace' => true, 125 | 'no_trailing_whitespace_in_comment' => true, 126 | 'no_unneeded_control_parentheses' => true, 127 | 'no_unneeded_curly_braces' => true, 128 | 'no_unneeded_final_method' => true, 129 | 'no_unreachable_default_argument_value' => true, 130 | 'no_unset_on_property' => true, 131 | 'no_unused_imports' => true, 132 | 'no_useless_else' => true, 133 | 'no_useless_return' => true, 134 | 'no_whitespace_before_comma_in_array' => true, 135 | 'no_whitespace_in_blank_line' => true, 136 | 'non_printable_character' => true, 137 | 'normalize_index_brace' => true, 138 | 'object_operator_without_whitespace' => true, 139 | 'ordered_class_elements' => [ 140 | 'order' => [ 141 | 'use_trait', 142 | 'constant_public', 143 | 'constant_protected', 144 | 'constant_private', 145 | 'property_public_static', 146 | 'property_protected_static', 147 | 'property_private_static', 148 | 'property_public', 149 | 'property_protected', 150 | 'property_private', 151 | 'construct', 152 | 'method_public_static', 153 | 'destruct', 154 | 'magic', 155 | 'phpunit', 156 | 'method_public', 157 | 'method_protected', 158 | 'method_private', 159 | 'method_protected_static', 160 | 'method_private_static', 161 | ], 162 | ], 163 | 'ordered_imports' => [ 164 | 'imports_order' => [ 165 | PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_CONST, 166 | PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_FUNCTION, 167 | PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_CLASS, 168 | ] 169 | ], 170 | 'ordered_interfaces' => [ 171 | 'direction' => 'ascend', 172 | 'order' => 'alpha', 173 | ], 174 | 'phpdoc_add_missing_param_annotation' => false, 175 | 'phpdoc_align' => ['align' => 'left'], 176 | 'phpdoc_annotation_without_dot' => true, 177 | 'phpdoc_indent' => true, 178 | 'phpdoc_no_access' => true, 179 | 'phpdoc_no_empty_return' => true, 180 | 'phpdoc_no_package' => true, 181 | 'phpdoc_order' => true, 182 | 'phpdoc_return_self_reference' => true, 183 | 'phpdoc_scalar' => true, 184 | 'phpdoc_separation' => true, 185 | 'phpdoc_single_line_var_spacing' => true, 186 | 'phpdoc_summary' => true, 187 | 'phpdoc_to_comment' => false, 188 | 'phpdoc_trim' => true, 189 | 'phpdoc_trim_consecutive_blank_line_separation' => true, 190 | 'phpdoc_types' => ['groups' => ['simple', 'meta']], 191 | 'phpdoc_types_order' => true, 192 | 'phpdoc_var_without_name' => true, 193 | 'pow_to_exponentiation' => true, 194 | 'protected_to_private' => true, 195 | 'return_assignment' => true, 196 | 'return_type_declaration' => ['space_before' => 'one'], 197 | 'self_accessor' => true, 198 | 'self_static_accessor' => true, 199 | 'semicolon_after_instruction' => true, 200 | 'set_type_to_cast' => true, 201 | 'short_scalar_cast' => true, 202 | 'simple_to_complex_string_variable' => true, 203 | 'simplified_null_return' => false, 204 | 'single_blank_line_at_eof' => true, 205 | 'single_import_per_statement' => true, 206 | 'single_line_after_imports' => true, 207 | 'single_quote' => true, 208 | 'standardize_not_equals' => true, 209 | 'strict_param' => true, 210 | 'ternary_to_null_coalescing' => true, 211 | 'trailing_comma_in_multiline' => true, 212 | 'trim_array_spaces' => true, 213 | 'unary_operator_spaces' => true, 214 | 'visibility_required' => [ 215 | 'elements' => [ 216 | 'const', 217 | 'method', 218 | 'property', 219 | ], 220 | ], 221 | 'void_return' => true, 222 | 'whitespace_after_comma_in_array' => true, 223 | ]) 224 | ->setFinder($finder); --------------------------------------------------------------------------------