<commit_before><?php namespace Bkwld\Decoy\Controllers;

// Dependencies
use App;
use Bkwld\Decoy\Models\Element;
use Bkwld\Decoy\Collections\Elements as ElementsCollection;
use Bkwld\Library\Utils\File;
use Cache;
use Config;
use Decoy;
use Former;
use Input;
use Redirect;
use Str;
use URL;
use View;

/**
 * Render a form that allows admins to override language files
 */
class Elements extends Base {
	
	protected $description = 'Copy, images, and files that aren\'t managed as part of an item in a list.';

	/**
	 * All fragments view
	 *
	 * @param string $locale The locale to load from the DB
	 * @param string $tab A deep link to a specific tab.  Will get processed by JS
	 * @return Illuminate\Http\Response
	 */
	public function index($locale = null, $tab = null) {

		// If there are no locales, treat the first argument as the tab
		if (empty(Config::get('decoy::site.locales'))) {
			$tab = $locale;
			$locale = null;
		
		// Otherwise, set a default locale if none was specified
		} elseif (!$locale) $locale = Decoy::defaultLocale();

		// Get all the elements for the current locale
		$elements = app('decoy.elements')->localize($locale)->hydrate(true);<commit_msg>Fixes #416, PHP 5.4 issue when testing the response for emptiness<commit_after><?php namespace Bkwld\Decoy\Controllers;

// Dependencies
use App;
use Bkwld\Decoy\Models\Element;
use Bkwld\Decoy\Collections\Elements as ElementsCollection;
use Bkwld\Library\Utils\File;
use Cache;
use Config;
use Decoy;
use Former;
use Input;
use Redirect;
use Str;
use URL;
use View;

/**
 * Render a form that allows admins to override language files
 */
class Elements extends Base {
	
	protected $description = 'Copy, images, and files that aren\'t managed as part of an item in a list.';

	/**
	 * All fragments view
	 *
	 * @param string $locale The locale to load from the DB
	 * @param string $tab A deep link to a specific tab.  Will get processed by JS
	 * @return Illuminate\Http\Response
	 */
	public function index($locale = null, $tab = null) {

		// If there are no locales, treat the first argument as the tab
		if (!($locales = Config::get('decoy::site.locales')) || empty($locales)) {
			$tab = $locale;
			$locale = null;
		
		// Otherwise, set a default locale if none was specified
		} elseif (!$locale) $locale = Decoy::defaultLocale();

		// Get all the elements for the current locale
		$elements = app('decoy.elements')->localize($locale)->hydrate(true);
{'fraction_non_alphanumeric': 0.11333878887070377, 'fraction_numerical': 0.0020458265139116204, 'mean_word_length': 3.89, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3856861', 'n_tokens_mistral': 775, 'n_tokens_neox': 729, 'n_words': 291}