<commit_before><?php

/**
 *
 * @copyright Copyright (c) 2013-2014 KipsProduction (http://www.kips.gr.jp)
 * @license   http://www.kips.gr.jp/newbsd/LICENSE.txt New BSD License
 */

namespace Flower\View\Pane;

/**
 * Description of ListPaneFactory
 *
 * @author <NAME> <kosugi at kips.gr.jp>
 */
class ListPaneFactory extends PaneFactory
{
    protected static $paneClass = 'Flower\View\Pane\ListPane';

    public static function factory(array $config, Builder $builder)
    {
        /* @var $pane \Flower\View\Pane\PaneInterface  */
        if (isset($config['pane_class'])) {
            $pane = new $config['pane_class'];
        } else {
            $pane = new self::$paneClass;
        }

        self::parseConfig($pane, $config);

        if (isset($pane->var)) {
            $pane->_var = $pane->var;
        } else {
            $pane->_var = 'content';
        }

        $pane->var = array($pane, 'render');

        if (isset($config['begin'])) {
            $pane->setBegin((string) $config['begin']);
        } else {
            $attributeString = self::parseAttributes($pane, $builder);
            if (strlen($attributeString)) {
                $pane->setBegin(sprintf('<%s%s>', $pane->tag, $attributeString));
            }
            else {
                $pane->setBegin(sprintf('<%s>', $pane->tag));
            }
         }

        if (isset($config['wrapBegin'])) {
            $pane->setWrapBegin((string) $config['wrapBegin']);
        } else {
            $attributes = $pane->getOption('wrap_attributes');
            if (is_array($attributes)) {
                $attributeString = self::attributesToAttributeString($pane, $builder);
                $pane->setWrapBegin(sprintf('<%s%s>', $pane->wrapTag, $attributeString));
            } else {
                $pane->setWrapBegin(sprintf('<%s>', $pane->wrapTag));
            }
        }

        if (isset($config['containerBegin'])) {
            $pane->containerBegin = (string) $config['containerBegin'];
        } elseif(isset($pane->containerTag)) {
            $attributes = $pane->getOption('container_attributes');
            if (is_array($attributes)) {
                $attributeString = self::attributesToAttributeString($pane, $builder);
                $pane->containerBegin = sprintf('<%s%s>', $pane->containerTag, $attributeString);
            } else {
                $pane->containerBegin = sprintf('<%s>', $pane->containerTag);
            }
        }

         if (isset($config['end'])) {
             $pane->setEnd((string) $config['end']);
         } elseif(! strlen($pane->tag)) {
             $pane->setEnd('<!-- end pane -->');
         } else {
             $pane->setEnd('</' . $pane->tag . '>');
         }

         if (isset($config['wrapEnd'])) {
             $pane->setWrapEnd((string) $config['wrapEnd']);
         } elseif (! strlen($pane->wrapTag)) {
             $pane->setWrapEnd('<!-- end pane -->');
         } else {
             $pane->setWrapEnd('</' . $pane->wrapTag . '>');
         }

         if (isset($config['containerEnd'])) {
             $pane->containerEnd = (string) $config['containerEnd'];
         } elseif (! isset($pane->containerTag)) {
             $pane->containerEnd = '<!-- end container -->';
         } else {
             $pane->containerEnd = '</' . $pane->containerTag . '>';
         }
         return $pane;
    }
}
<commit_msg>Fix self to static<commit_after><?php

/**
 *
 * @copyright Copyright (c) 2013-2014 KipsProduction (http://www.kips.gr.jp)
 * @license   http://www.kips.gr.jp/newbsd/LICENSE.txt New BSD License
 */

namespace Flower\View\Pane;

/**
 * Description of ListPaneFactory
 *
 * @author <NAME> <kosugi at kips.gr.jp>
 */
class ListPaneFactory extends PaneFactory
{
    protected static $paneClass = 'Flower\View\Pane\ListPane';

    public static function factory(array $config, Builder $builder)
    {
        /* @var $pane \Flower\View\Pane\PaneInterface  */
        if (isset($config['pane_class'])) {
            $pane = new $config['pane_class'];
        } else {
            $pane = new static::$paneClass;
        }

        self::parseConfig($pane, $config);

        if (isset($pane->var)) {
            $pane->_var = $pane->var;
        } else {
            $pane->_var = 'content';
        }

        $pane->var = array($pane, 'render');

        if (isset($config['begin'])) {
            $pane->setBegin((string) $config['begin']);
        } else {
            $attributeString = self::parseAttributes($pane, $builder);
            if (strlen($attributeString)) {
                $pane->setBegin(sprintf('<%s%s>', $pane->tag, $attributeString));
            }
            else {
                $pane->setBegin(sprintf('<%s>', $pane->tag));
            }
         }

        if (isset($config['wrapBegin'])) {
            $pane->setWrapBegin((string) $config['wrapBegin']);
        } else {
            $attributes = $pane->getOption('wrap_attributes');
            if (is_array($attributes)) {
                $attributeString = self::attributesToAttributeString($pane, $builder);
                $pane->setWrapBegin(sprintf('<%s%s>', $pane->wrapTag, $attributeString));
            } else {
                $pane->setWrapBegin(sprintf('<%s>', $pane->wrapTag));
            }
        }

        if (isset($config['containerBegin'])) {
            $pane->containerBegin = (string) $config['containerBegin'];
        } elseif(isset($pane->containerTag)) {
            $attributes = $pane->getOption('container_attributes');
            if (is_array($attributes)) {
                $attributeString = self::attributesToAttributeString($pane, $builder);
                $pane->containerBegin = sprintf('<%s%s>', $pane->containerTag, $attributeString);
            } else {
                $pane->containerBegin = sprintf('<%s>', $pane->containerTag);
            }
        }

         if (isset($config['end'])) {
             $pane->setEnd((string) $config['end']);
         } elseif(! strlen($pane->tag)) {
             $pane->setEnd('<!-- end pane -->');
         } else {
             $pane->setEnd('</' . $pane->tag . '>');
         }

         if (isset($config['wrapEnd'])) {
             $pane->setWrapEnd((string) $config['wrapEnd']);
         } elseif (! strlen($pane->wrapTag)) {
             $pane->setWrapEnd('<!-- end pane -->');
         } else {
             $pane->setWrapEnd('</' . $pane->wrapTag . '>');
         }

         if (isset($config['containerEnd'])) {
             $pane->containerEnd = (string) $config['containerEnd'];
         } elseif (! isset($pane->containerTag)) {
             $pane->containerEnd = '<!-- end container -->';
         } else {
             $pane->containerEnd = '</' . $pane->containerTag . '>';
         }
         return $pane;
    }
}

{'fraction_non_alphanumeric': 0.1851688043638508, 'fraction_numerical': 0.0023588382721509656, 'mean_word_length': 1.9938217122683142, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 107, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '1676730', 'n_tokens_mistral': 2042, 'n_tokens_neox': 2017, 'n_words': 313}