for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Class FluentDocumentExtension|Firesphere\SolrFluent\Extensions\FluentDocumentExtension Add Fluent filtering
* to queries
*
* @package Firesphere\Solr\Fluent
* @author Simon `Firesphere` Erkelens; Marco `Sheepy` Hermo
* @copyright Copyright (c) 2018 - now() Firesphere & Sheepy
*/
namespace Firesphere\SolrFluent\Extensions;
use Firesphere\SolrSearch\Factories\DocumentFactory;
use SilverStripe\Core\Extension;
use TractorCow\Fluent\State\FluentState;
* Class Firesphere\SolrFluent\Extensions\FluentDocumentExtension
* Update Documents per locale
* @property DocumentFactory|FluentDocumentExtension $owner
class FluentDocumentExtension extends Extension
{
* Update the Solr field for the value to use the locale name
* @param array $field
* @param string $value
public function onBeforeAddDoc(&$field, &$value): void
$value
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function onBeforeAddDoc(&$field, /** @scrutinizer ignore-unused */ &$value): void
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$fluentState = FluentState::singleton();
/** @var string $locale */
$locale = $fluentState->getLocale();
if ($locale) {
$field['name'] .= '_' . $locale;
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.