Esempio n. 1
0
 /**
  * Returns whether the configuration is empty.
  *
  * @param bool $includeFallback Whether to include values set in the base
  *                              configuration passed to {@link __construct()}.
  *
  * @return bool Returns `true` if no key is set and `false` otherwise.
  */
 public function isEmpty($includeFallback = true)
 {
     if (!empty($this->values)) {
         return false;
     }
     return $includeFallback && $this->baseConfig ? $this->baseConfig->isEmpty(true) : true;
 }
Esempio n. 2
0
 public function testIsEmptyWithoutFallback()
 {
     $baseConfig = new Config();
     $config = new Config($baseConfig);
     $this->assertTrue($config->isEmpty(false));
     $baseConfig->set(Config::PULI_DIR, 'my-puli-dir');
     $this->assertTrue($config->isEmpty(false));
     $config->set(Config::PULI_DIR, 'my-puli-dir');
     $this->assertFalse($config->isEmpty(false));
 }