123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace Docker\Composer;
- class NetworkConfig
- {
- protected $config = [];
- /**
- * @param string $driver Driver type. By default use 'default'
- * @return NetworkConfig Return this object.
- */
- public function addDriver($driver = 'default')
- {
- $this->config['driver'] = $driver;
- return $this;
- }
- /**
- * @param string $driver Subnet. By default 172.172.172.0/24
- * @return NetworkConfig Return this object.
- */
- public function addSubnetGateway($subnet = '172.172.172.0/24')
- {
- if (!isset($this->config['config'])) {
- $this->config['config'] = [];
- }
- $this->config['config'][] = array('subnet' => $subnet);
- // $this->config['config'][] = array('gateway' => $gateway);
- return $this;
- }
- /**
- * @return array Return array with config.
- */
- public function getConfig()
- {
- return $this->config;
- }
- }
|