Exemple #1
0
 /** @inheritdoc */
 public static function getBool($section, $key, $default = null)
 {
     static::setConfig();
     if (!static::hasKey($section, $key, $default === null)) {
         return $default;
     }
     $value = static::doGetValue($section, $key);
     if (static::$configFileType === 'ini' && is_string($value)) {
         //                                              booleans from ini are converted to 1|0
         return Str::equals($value, "true", false) || Str::equals($value, "1");
     }
     return (bool) $value;
 }
Exemple #2
0
 public function test_equals()
 {
     $this->assertTrue(Str::equals("this", "this"));
     $this->assertFalse(Str::equals("this", "THIS"));
     $this->assertTrue(Str::equals("this", "THIS", false));
 }