<commit_before><?php

use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\HTML;
use Illuminate\Support\Facades\View;
use Orchestra\Support\Facades\Site;

/*
|--------------------------------------------------------------------------
| HTML::title() macro
|--------------------------------------------------------------------------
|
| Page title macro helper.
|
*/

HTML::macro('title', function () {
    $siteTitle = $title = memorize('site.name');
    $pageTitle = trim(Site::get('title', ''));
    $format    = memorize('site.format.title', ':pageTitle &mdash; :siteTitle');

    if (! empty($pageTitle)) {
        $title = strtr($format, array(
            ":siteTitle" => $siteTitle,
            ":pageTitle" => $pageTitle,
        ));
    }

    return HTML::create('title', $title);
});

/*
|--------------------------------------------------------------------------
| Blade extend for @placeholder
|--------------------------------------------------------------------------
|
| Placeholder is Orchestra Platform version of widget for theme.
|
*/

Blade::extend(function ($view) {
    $placeholder = '$1<?php $__ps = Orchestra\Support\Facades\Widget::make("placeholder.".$2); '
                        .'foreach ($__ps as $__p) { echo value($__p->value ?:""); } ?>';
    $decorator   = '$1<?php echo Orchestra\Support\Facades\Decorator::render($2); ?>';

    foreach (compact('placeholder', 'decorator') as $name => $replacement) {
        $view = preg_replace('/(\s*)@'.$name.'\s?\(\s*(.*)\)/', $replacement, $view);
    }

    return $view;
});

/*
|--------------------------------------------------------------------------
| Decorator Macro for Navbar
|--------------------------------------------------------------------------
*/

App::make('orchestra.decorator')->macro('navbar', function ($navbar) {
    return View::make('orchestra/foundation::components.navbar', compact('navbar'));
});<commit_msg>Add <? shorthand using blade.<commit_after><?php

use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\HTML;
use Illuminate\Support\Facades\View;
use Orchestra\Support\Facades\Site;

/*
|--------------------------------------------------------------------------
| HTML::title() macro
|--------------------------------------------------------------------------
|
| Page title macro helper.
|
*/

HTML::macro('title', function () {
    $siteTitle = $title = memorize('site.name');
    $pageTitle = trim(Site::get('title', ''));
    $format    = memorize('site.format.title', ':pageTitle &mdash; :siteTitle');

    if (! empty($pageTitle)) {
        $title = strtr($format, array(
            ":siteTitle" => $siteTitle,
            ":pageTitle" => $pageTitle,
        ));
    }

    return HTML::create('title', $title);
});

/*
|--------------------------------------------------------------------------
| Blade extend for @placeholder
|--------------------------------------------------------------------------
|
| Placeholder is Orchestra Platform version of widget for theme.
|
*/

Blade::extend(function ($view) {
    $placeholder = '$1<?php $__ps = Orchestra\Support\Facades\Widget::make("placeholder.".$2); '
                        .'foreach ($__ps as $__p) { echo value($__p->value ?:""); } ?>';
    $decorator   = '$1<?php echo Orchestra\Support\Facades\Decorator::render($2); ?>';

    foreach (compact('placeholder', 'decorator') as $name => $replacement) {
        $view = preg_replace('/(\s*)@'.$name.'\s?\(\s*(.*)\)/', $replacement, $view);
    }

    $view = preg_replace('/(\s*)(<\?\s)/', '$1<?php ', $view);

    return $view;
});

/*
|--------------------------------------------------------------------------
| Decorator Macro for Navbar
|--------------------------------------------------------------------------
*/

App::make('orchestra.decorator')->macro('navbar', function ($navbar) {
    return View::make('orchestra/foundation::components.navbar', compact('navbar'));
});
{'fraction_non_alphanumeric': 0.3841554559043348, 'fraction_numerical': 0.002242152466367713, 'mean_word_length': 1.5573248407643312, 'pattern_counts': {'":': 4, '<': 12, '<?xml version=': 0, '>': 17, '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': '1417956', 'n_tokens_mistral': 1049, 'n_tokens_neox': 1028, 'n_words': 191}