<commit_before><?php

namespace Gitlist\Util;

use Silex\Application;

class Routing
{
    protected $app;

    public function __construct(Application $app)
    {
        $this->app = $app;
    }

    public function getRepositoryRegex()
    {
        static $regex = null;

        if ($regex === null) {
            $app = $this->app;
            $self = $this;
            $quotedPaths = array_map(
               function ($repo) use ($app, $self) {
                    $repoName =  $repo['name'] ;
                    //Windows
                    if ($self->OSIsWindows()){
                       $repoName = str_replace('\\', '\\\\',$repoName);
                    }
                    return $repoName;
                },
                $this->app['git']->getRepositories($this->app['git.repos'])
            );
            usort($quotedPaths, function ($a, $b) {
				return strlen($b) - strlen($a);
			});
            $regex = implode('|', $quotedPaths);
        }

        return $regex;
    }


    public function OSIsWindows()
    {
      switch(PHP_OS){<commit_msg>Small fix for PSR guidelines.<commit_after><?php

namespace Gitlist\Util;

use Silex\Application;

class Routing
{
    protected $app;

    public function __construct(Application $app)
    {
        $this->app = $app;
    }

    public function getRepositoryRegex()
    {
        static $regex = null;

        if ($regex === null) {
            $app = $this->app;
            $self = $this;
            $quotedPaths = array_map(
               function ($repo) use ($app, $self) {
                    $repoName =  $repo['name'] ;
                    //Windows
                    if ($self->isWindows()){
                       $repoName = str_replace('\\', '\\\\',$repoName);
                    }
                    return $repoName;
                },
                $this->app['git']->getRepositories($this->app['git.repos'])
            );
            usort($quotedPaths, function ($a, $b) {
				return strlen($b) - strlen($a);
			});
            $regex = implode('|', $quotedPaths);
        }

        return $regex;
    }


    public function isWindows()
    {
      switch(PHP_OS){
{'fraction_non_alphanumeric': 0.14751838235294118, 'fraction_numerical': 0.0, 'mean_word_length': 1.4296875, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7292920', 'n_tokens_mistral': 648, 'n_tokens_neox': 607, 'n_words': 127}