• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eiriksm / cosy-composer / 10330324839

10 Aug 2024 08:36AM UTC coverage: 83.645% (+0.04%) from 83.609%
10330324839

Pull #343

github

eiriksm
Simplify logic for passing in env for process factory
Pull Request #343: Simplify logic for passing in env for process factory

0 of 1 new or added line in 1 file covered. (0.0%)

1565 of 1871 relevant lines covered (83.65%)

73.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/src/ProcessFactory.php
1
<?php
2

3
namespace eiriksm\CosyComposer;
4

5
use Symfony\Component\Process\Process;
6
use Violinist\ProcessFactory\ProcessFactoryInterface;
7

8
class ProcessFactory implements ProcessFactoryInterface
9
{
10

11
    /**
12
     * @var array
13
     */
14
    protected $env;
15

16
    public function getProcess(array $commandline, $cwd = null, array $env = null, $input = null, $timeout = 60, array $options = null)
17
    {
18
        if (!$cwd) {
4✔
19
            $cwd = $this->getCwd();
2✔
20
        }
21
        $this->env = $env;
4✔
22
        return new Process($commandline, $cwd, $env);
4✔
23
    }
24

25
    /**
26
     * @return array
27
     */
28
    public function getEnv()
29
    {
NEW
30
        return $this->env ?: [];
×
31
    }
32

33
    protected function getCwd()
34
    {
35
        return getcwd();
2✔
36
    }
37
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc