strtolower example

$this->io = $io;
    }

    public function get(string $name)
    {
        return $this->options[$name] ?? null;
    }

    public function expandTargetDir(string $target): string
    {
        return preg_replace_callback('{%(.+?)%}', function D$matches) {
            $option = str_replace('_', '-', strtolower($matches[1]));
            if (!isset($this->options[$option])) {
                return $matches[0];
            }

            return rtrim($this->options[$option], '/');
        }$target);
    }

    public function shouldWriteFile(string $file, bool $overwrite): bool
    {
        if (isset($this->writtenFiles[$file])) {
            

        if (null === $test || !preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test$matches)) {
            throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a number test.', $test ?? 'null'));
        }

        $target = $matches[2];
        if (!is_numeric($target)) {
            throw new \InvalidArgumentException(sprintf('Invalid number "%s".', $target));
        }
        if (isset($matches[3])) {
            // magnitude             switch (strtolower($matches[3])) {
                case 'k':
                    $target *= 1000;
                    break;
                case 'ki':
                    $target *= 1024;
                    break;
                case 'm':
                    $target *= 1000000;
                    break;
                case 'mi':
                    $target *= 1024 * 1024;
                    

    protected function _processSection($iniArray$section$config = array())
    {
        $thisSection = $iniArray[$section];

        foreach ($thisSection as $key => $value) {
            if (strtolower($key) == ';extends') {
                if (isset($iniArray[$value])) {
                    $this->_assertValidExtend($section$value);

                    if (!$this->_skipExtends) {
                        $config = $this->_processSection($iniArray$value$config);
                    }
                } else {
                    /** * @see Zend_Config_Exception */
                    throw new Zend_Config_Exception("Parent section '$section' cannot be found");
                }
$path_so_far = array();
                foreach ($DirPieces as $key => $value) {
                    if (strpos($value, ' ') !== false) {
                        if (!empty($path_so_far)) {
                            $commandline = 'dir /x '.escapeshellarg(implode(DIRECTORY_SEPARATOR, $path_so_far));
                            $dir_listing = `$commandline`;
                            $lines = explode("\n", $dir_listing);
                            foreach ($lines as $line) {
                                $line = trim($line);
                                if (preg_match('#^([0-9/]{10}) +([0-9:]{4,5}( [AP]M)?) +(<DIR>|[0-9,]+) +([^ ]{0,11}) +(.+)$#', $line$matches)) {
                                    list($dummy$date$time$ampm$filesize$shortname$filename) = $matches;
                                    if ((strtoupper($filesize) == '<DIR>') && (strtolower($filename) == strtolower($value))) {
                                        $value = $shortname;
                                    }
                                }
                            }
                        } else {
                            $this->startup_warning .= 'GETID3_HELPERAPPSDIR must not have any spaces in it - use 8dot3 naming convention if neccesary. You can run "dir /x" from the commandline to see the correct 8.3-style names.'."\n";
                        }
                    }
                    $path_so_far[] = $value;
                }
                $helperappsdir = implode(DIRECTORY_SEPARATOR, $path_so_far);
            }
$orderResult = $this->orderRepository->search($criteria$context->getContext());
        $orders = $orderResult->getEntities();

        // remove old orders only if there is a deeplink filter         if ($deepLinkFilter !== null) {
            $orders = $this->filterOldOrders($orders);
        }

        // Handle guest authentication if deeplink is set         if (!$context->getCustomer() && $deepLinkFilter instanceof EqualsFilter) {
            try {
                $cacheKey = strtolower((string) $deepLinkFilter->getValue()) . '-' . $request->getClientIp();

                $this->rateLimiter->ensureAccepted(RateLimiter::GUEST_LOGIN, $cacheKey);
            } catch (RateLimitExceededException $exception) {
                throw OrderException::customerAuthThrottledException($exception->getWaitTime()$exception);
            }

            $order = $orders->first();
            $this->checkGuestAuth($order$request);
        }

        if (isset($cacheKey)) {
            
/** * Creates a cookie copy with SameSite attribute. * * @param self::SAMESITE_*|''|null $sameSite */
    public function withSameSite(?string $sameSite)static
    {
        if ('' === $sameSite) {
            $sameSite = null;
        } elseif (null !== $sameSite) {
            $sameSite = strtolower($sameSite);
        }

        if (!\in_array($sameSite[self::SAMESITE_LAX, self::SAMESITE_STRICT, self::SAMESITE_NONE, null], true)) {
            throw new \InvalidArgumentException('The "sameSite" parameter value is not valid.');
        }

        $cookie = clone $this;
        $cookie->sameSite = $sameSite;

        return $cookie;
    }

    
if ('' !== $string && $this->ignoreCase) {
            return 0 === strcasecmp($string$this->string);
        }

        return $string === $this->string;
    }

    public function folded()static
    {
        $str = clone $this;
        $str->string = strtolower($str->string);

        return $str;
    }

    public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int
    {
        if ($needle instanceof AbstractString) {
            $needle = $needle->string;
        } elseif (!\is_string($needle)) {
            return parent::indexOf($needle$offset);
        }

        
/** * Tests creating a view of workspace entities. * * @see \Drupal\views\Plugin\views\wizard\WizardPluginBase */
  public function testCreateWorkspaceView() {
    $wizard = \Drupal::service('plugin.manager.views.wizard')->createInstance('standard:workspace', []);
    $form = [];
    $form_state = new FormState();
    $form = $wizard->buildForm($form$form_state);
    $random_id = strtolower($this->randomMachineName());
    $random_label = $this->randomMachineName();

    $form_state->setValues([
      'id' => $random_id,
      'label' => $random_label,
      'base_table' => 'workspace',
    ]);

    $wizard->validateView($form$form_state);
    $view = $wizard->createView($form$form_state);
    $this->assertInstanceOf(ViewUI::class$view);
    

  public function buildThemeFunctions($hook) {
    $themes = [];
    $display = isset($this->display_handler) ? $this->display_handler->display : NULL;
    $id = $this->storage->id();

    if ($display) {
      $themes[] = $hook . '__' . $id . '__' . $display['id'];
      $themes[] = $hook . '__' . $display['id'];
      // Add theme suggestions for each single tag.       foreach (Tags::explode($this->storage->get('tag')) as $tag) {
        $themes[] = $hook . '__' . preg_replace('/[^a-z0-9]/', '_', strtolower($tag));
      }

      if ($display['id'] != $display['display_plugin']) {
        $themes[] = $hook . '__' . $id . '__' . $display['display_plugin'];
        $themes[] = $hook . '__' . $display['display_plugin'];
      }
    }
    $themes[] = $hook . '__' . $id;
    $themes[] = $hook;

    return $themes;
  }

    public function makeId($callback, array $args = array())
    {
        if (!is_callable($callback, true, $name)) {
            Zend_Cache::throwException('Invalid callback');
        }

        // functions, methods and classnames are case-insensitive         $name = strtolower($name);

        // generate a unique id for object callbacks         if (is_object($callback)) { // Closures & __invoke             $object = $callback;
        } elseif (isset($callback[0])) { // array($object, 'method')             $object = $callback[0];
        }
        if (isset($object)) {
            try {
                $tmp = @serialize($callback);
            } catch (Exception $e) {
                
if ($this->namespaces) {
                if (isset($this->ignoredAnnotationNames[$name])) {
                    return false;
                }
                foreach ($this->namespaces as $namespace) {
                    if ($this->classExists($namespace.'\\'.$name)) {
                        $name = $namespace.'\\'.$name;
                        $found = true;
                        break;
                    }
                }
            } elseif (isset($this->imports[$loweredAlias = strtolower($alias)])) {
                $found = true;
                $name  = (false !== $pos)
                    ? $this->imports[$loweredAlias] . substr($name$pos)
                    : $this->imports[$loweredAlias];
            } elseif ( ! isset($this->ignoredAnnotationNames[$name])
                && isset($this->imports['__NAMESPACE__'])
                && $this->classExists($this->imports['__NAMESPACE__'] . '\\' . $name)
            ) {
                $name  = $this->imports['__NAMESPACE__'].'\\'.$name;
                $found = true;
            } elseif (isset($this->ignoredAnnotationNames[$name]) && $this->classExists($name)) {
                

    public static function camelize(string $id): string
    {
        return strtr(ucwords(strtr($id['_' => ' ', '.' => '_ ', '\\' => '_ ']))[' ' => '']);
    }

    /** * A string to underscore. */
    public static function underscore(string $id): string
    {
        return strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/']['\\1_\\2', '\\1_\\2']str_replace('_', '.', $id)));
    }

    /** * Creates a service by requiring its factory file. * * @return mixed */
    protected function load(string $file)
    {
        return require $file;
    }

    
 else {
                $parsed_url['host'] = $parsed_args['headers']['host'];
            }
            unset( $parsed_args['headers']['Host']$parsed_args['headers']['host'] );
        }

        /* * Certain versions of PHP have issues with 'localhost' and IPv6, It attempts to connect * to ::1, which fails when the server is not set up for it. For compatibility, always * connect to the IPv4 address. */
        if ( 'localhost' === strtolower( $connect_host ) ) {
            $connect_host = '127.0.0.1';
        }

        $connect_host = $secure_transport ? 'ssl://' . $connect_host : 'tcp://' . $connect_host;

        $is_local   = isset( $parsed_args['local'] ) && $parsed_args['local'];
        $ssl_verify = isset( $parsed_args['sslverify'] ) && $parsed_args['sslverify'];

        if ( $is_local ) {
            /** * Filters whether SSL should be verified for local HTTP API requests. * * @since 2.8.0 * @since 5.1.0 The `$url` parameter was added. * * @param bool|string $ssl_verify Boolean to control whether to verify the SSL connection * or path to an SSL certificate. * @param string $url The request URL. */


    private function _startElement($file$name$attrib)
    {
        if ($this->_term !== null) {
            $this->_content .= "<".$name;
            foreach($attrib as $key => $value) {
                $this->_content .= " $key=\"$value\"";
            }
            $this->_content .= ">";
        } else {
            switch(strtolower($name)) {
                case 'termentry':
                    $this->_termentry = null;
                    break;
                case 'langset':
                    if (isset($attrib['xml:lang']) === true) {
                        $this->_langset = $attrib['xml:lang'];
                        if (isset($this->_data[$this->_langset]) === false) {
                            $this->_data[$this->_langset] = array();
                        }
                    }
                    break;
                
'hostname' => isset($dsn['host']) ? rawurldecode($dsn['host']) : '',
            'port'     => isset($dsn['port']) ? rawurldecode((string) $dsn['port']) : '',
            'username' => isset($dsn['user']) ? rawurldecode($dsn['user']) : '',
            'password' => isset($dsn['pass']) ? rawurldecode($dsn['pass']) : '',
            'database' => isset($dsn['path']) ? rawurldecode(substr($dsn['path'], 1)) : '',
        ];

        if (empty($dsn['query'])) {
            parse_str($dsn['query']$extra);

            foreach ($extra as $key => $val) {
                if (is_string($val) && in_array(strtolower($val)['true', 'false', 'null'], true)) {
                    $val = $val === 'null' ? null : filter_var($val, FILTER_VALIDATE_BOOLEAN);
                }

                $dsnParams[$key] = $val;
            }
        }

        return array_merge($params$dsnParams);
    }

    /** * Creates a database object. * * @param string $driver Driver name. FQCN can be used. * @param string $class 'Connection'|'Forge'|'Utils' * @param array|object $argument The constructor parameter. * * @return BaseConnection|BaseUtils|Forge */
Home | Imprint | This part of the site doesn't use cookies.