is_bool example

protected $allowAdd;
    protected $allowDelete;

    private \Closure|bool $deleteEmpty;

    public function __construct(string $type, array $options = [], bool $allowAdd = false, bool $allowDelete = false, bool|callable $deleteEmpty = false, array $prototypeOptions = null)
    {
        $this->type = $type;
        $this->allowAdd = $allowAdd;
        $this->allowDelete = $allowDelete;
        $this->options = $options;
        $this->deleteEmpty = \is_bool($deleteEmpty) ? $deleteEmpty : $deleteEmpty(...);
        $this->prototypeOptions = $prototypeOptions ?? $options;
    }

    public static function getSubscribedEvents(): array
    {
        return [
            FormEvents::PRE_SET_DATA => 'preSetData',
            FormEvents::PRE_SUBMIT => 'preSubmit',
            // (MergeCollectionListener, MergeDoctrineCollectionListener)             FormEvents::SUBMIT => ['onSubmit', 50],
        ];
    }

  protected function convertScaffoldMetadata($destination$value) {
    if (is_bool($value)) {
      if (!$value) {
        return [self::MODE => SkipOp::ID];
      }
      throw new \RuntimeException("File mapping {$destination} cannot be given the value 'true'.");
    }
    if (empty($value)) {
      throw new \RuntimeException("File mapping {$destination} cannot be empty.");
    }
    if (is_string($value)) {
      $value = [self::PATH => $value];
    }
    
/** * CacheableNormalization constructor. * * @param \Drupal\Core\Cache\CacheableDependencyInterface $cacheability * The cacheability metadata for the normalized data. * @param array|string|int|float|bool|null $normalization * The normalized data. This value must not contain any * CacheableNormalizations. */
  public function __construct(CacheableDependencyInterface $cacheability$normalization) {
    assert((is_array($normalization) && static::hasNoNestedInstances($normalization)) || is_string($normalization) || is_int($normalization) || is_float($normalization) || is_bool($normalization) || is_null($normalization));
    $this->normalization = $normalization;
    $this->setCacheability($cacheability);
  }

  /** * Creates a CacheableNormalization instance without any special cacheability. * * @param array|string|int|float|bool|null $normalization * The normalized data. This value must not contain any * CacheableNormalizations. * * @return static * The CacheableNormalization. */
<?php     }

    /** * @global array $wp_meta_boxes * * @return bool */
    public function show_screen_options() {
        global $wp_meta_boxes;

        if ( is_bool( $this->_show_screen_options ) ) {
            return $this->_show_screen_options;
        }

        $columns = get_column_headers( $this );

        $show_screen = ! empty( $wp_meta_boxes[ $this->id ] ) || $columns || $this->get_option( 'per_page' );

        $this->_screen_settings = '';

        if ( 'post' === $this->base ) {
            $expand                 = '<fieldset class="editor-expand hidden"><legend>' . __( 'Additional settings' ) . '</legend><label for="editor-expand-toggle">';
            
$output .= "if (isset(\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name])) unset(\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name]);\n";
        $section_props = "\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name]";

        foreach ($_attr as $attr_name => $attr_value) {
            switch ($attr_name) {
                case 'loop':
                    $output .= "{$section_props}['loop'] = is_array(\$_loop=$attr_value) ? count(\$_loop) : max(0, (int)\$_loop); unset(\$_loop);\n";
                    break;

                case 'show':
                    if (is_bool($attr_value))
                        $show_attr_value = $attr_value ? 'true' : 'false';
                    else
                        $show_attr_value = "(bool)$attr_value";
                    $output .= "{$section_props}['show'] = $show_attr_value;\n";
                    break;

                case 'name':
                    $output .= "{$section_props}['$attr_name'] = $attr_value;\n";
                    break;

                case 'max':
                
->end()
            ->end()
            ->scalarNode('token_verifier')
                ->info('The service ID of a custom rememberme token verifier.')
            ->end();

        foreach ($this->options as $name => $value) {
            if ('secure' === $name) {
                $builder->enumNode($name)->values([true, false, 'auto'])->defaultValue('auto' === $value ? null : $value);
            } elseif ('samesite' === $name) {
                $builder->enumNode($name)->values([null, Cookie::SAMESITE_LAX, Cookie::SAMESITE_STRICT, Cookie::SAMESITE_NONE])->defaultValue($value);
            } elseif (\is_bool($value)) {
                $builder->booleanNode($name)->defaultValue($value);
            } elseif (\is_int($value)) {
                $builder->integerNode($name)->defaultValue($value);
            } else {
                $builder->scalarNode($name)->defaultValue($value);
            }
        }
    }

    private function createTokenProvider(ContainerBuilder $container, string $firewallName, array $config): string
    {
        

        return (bool) $this->options['is_variadic'];
    }

    public function isDeprecated(): bool
    {
        return (bool) $this->options['deprecated'];
    }

    public function getDeprecatedVersion(): string
    {
        return \is_bool($this->options['deprecated']) ? '' : $this->options['deprecated'];
    }

    public function getAlternative(): ?string
    {
        return $this->options['alternative'];
    }
}

    protected function dotize(string $id): string
    {
        return hash('sha1', $id);
    }

    /** * @internal */
    protected function escape(string|bool $value): string
    {
        return \is_bool($value) ? ($value ? '1' : '0') : addslashes($value);
    }

    /** * @internal */
    protected function addAttributes(array $attributes): string
    {
        $code = [];

        foreach ($attributes as $k => $v) {
            $code[] = sprintf('%s="%s"', $k$this->escape($v));
        }
final class Php80
{
    public static function fdiv(float $dividend, float $divisor): float
    {
        return @($dividend / $divisor);
    }

    public static function get_debug_type($value): string
    {
        switch (true) {
            case null === $valuereturn 'null';
            case \is_bool($value)return 'bool';
            case \is_string($value)return 'string';
            case \is_array($value)return 'array';
            case \is_int($value)return 'int';
            case \is_float($value)return 'float';
            case \is_object($value)break;
            case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class';
            default:
                if (null === $type = @get_resource_type($value)) {
                    return 'unknown';
                }

                
$result[$key] = ['incomplete-object', $this->getClassNameFromIncomplete($value)];
            } elseif (\is_object($value)) {
                $result[$key] = ['object', get_debug_type($value)];
            } elseif (\is_array($value)) {
                if ($level > 10) {
                    $result[$key] = ['array', '*DEEP NESTED ARRAY*'];
                } else {
                    $result[$key] = ['array', $this->flattenArgs($value$level + 1, $count)];
                }
            } elseif (null === $value) {
                $result[$key] = ['null', null];
            } elseif (\is_bool($value)) {
                $result[$key] = ['boolean', $value];
            } elseif (\is_int($value)) {
                $result[$key] = ['integer', $value];
            } elseif (\is_float($value)) {
                $result[$key] = ['float', $value];
            } elseif (\is_resource($value)) {
                $result[$key] = ['resource', get_resource_type($value)];
            } else {
                $result[$key] = ['string', (string) $value];
            }
        }

        

        return (bool) $this->options['is_variadic'];
    }

    public function isDeprecated(): bool
    {
        return (bool) $this->options['deprecated'];
    }

    public function getDeprecatedVersion(): string
    {
        return \is_bool($this->options['deprecated']) ? '' : $this->options['deprecated'];
    }

    public function getAlternative(): ?string
    {
        return $this->options['alternative'];
    }

    public function hasOneMandatoryArgument(): bool
    {
        return (bool) $this->options['one_mandatory_argument'];
    }
}
/** * {@inheritdoc} */
  public function query($query, array $args = []$options = []) {
    $options += $this->defaultOptions();

    // The PDO PostgreSQL driver has a bug which doesn't type cast booleans     // correctly when parameters are bound using associative arrays.     // @see http://bugs.php.net/bug.php?id=48383     foreach ($args as &$value) {
      if (is_bool($value)) {
        $value = (int) $value;
      }
    }

    // We need to wrap queries with a savepoint if:     // - Currently in a transaction.     // - A 'mimic_implicit_commit' does not exist already.     // - The query is not a savepoint query.     $wrap_with_savepoint = $this->inTransaction() &&
      !isset($this->transactionLayers['mimic_implicit_commit']) &&
      !(is_string($query) && (
        
/** * Defined by Zend_Validate_Interface * * Returns true if and only if $value is not an empty value. * * @param string $value * @return boolean */
    public function isValid($value)
    {
        if ($value !== null && !is_string($value) && !is_int($value) && !is_float($value) &&
            !is_bool($value) && !is_array($value) && !is_object($value)) {
            $this->_error(self::INVALID);
            return false;
        }

        $type    = $this->getType();
        $this->_setValue($value);
        $object  = false;

        // OBJECT_COUNT (countable object)         if ($type >= self::OBJECT_COUNT) {
            $type -= self::OBJECT_COUNT;
            
/** * Generates the SELECT portion of the query * * @param array|RawSql|string $select * * @return $this */
    public function select($select = '*', ?bool $escape = null)
    {
        // If the escape value was not set, we will base it on the global setting         if (is_bool($escape)) {
            $escape = $this->db->protectIdentifiers;
        }

        if ($select instanceof RawSql) {
            $this->QBSelect[] = $select;

            return $this;
        }

        if (is_string($select)) {
            $select = $escape === false ? [$select] : explode(',', $select);
        }
else {
        if (!isset($condition['operator'])) {
          $condition['operator'] = is_array($condition['value']) ? 'IN' : '=';
        }

        // Process the value for operator that use it.         if (!in_array($condition['operator']['IS NULL', 'IS NOT NULL'], TRUE)) {
          // Lowercase condition value(s) for case-insensitive matches.           if (is_array($condition['value'])) {
            $condition['value'] = array_map('mb_strtolower', $condition['value']);
          }
          elseif (!is_bool($condition['value'])) {
            $condition['value'] = mb_strtolower($condition['value']);
          }
        }

        $single_conditions[] = $condition;
      }
    }
    $return = [];
    if ($single_conditions) {
      foreach ($configs as $config_name => $config) {
        foreach ($single_conditions as $condition) {
          
Home | Imprint | This part of the site doesn't use cookies.