4d0d436d3f4037546bf5de8e97c8e7add31b2cb6
[yaffs-website] / vendor / consolidation / robo / src / Task / Docker / Stop.php
1 <?php
2 namespace Robo\Task\Docker;
3
4 /**
5  * Stops Docker container
6  *
7  * ```php
8  * <?php
9  * $this->taskDockerStop($cidOrResult)
10  *      ->run();
11  * ?>
12  * ```
13  */
14 class Stop extends Base
15 {
16     /**
17      * @var string
18      */
19     protected $command = "docker stop";
20
21     /**
22      * @var null|string
23      */
24     protected $cid;
25
26     /**
27      * @param string|\Robo\Task\Docker\Result $cidOrResult
28      */
29     public function __construct($cidOrResult)
30     {
31         $this->cid = $cidOrResult instanceof Result ? $cidOrResult->getCid() : $cidOrResult;
32     }
33
34     /**
35      * {@inheritdoc}
36      */
37     public function getCommand()
38     {
39         return $this->command . ' ' . $this->arguments . ' ' . $this->cid;
40     }
41 }