<commit_before><?php
namespace Concrete\Core\Health\Report\Test\Test\Search;

use Concrete\Core\Block\Block;
use Concrete\Core\Database\Schema\Parser\Axmls;
use Concrete\Core\Entity\Block\BlockType\BlockType;
use Concrete\Core\Filesystem\FileLocator;
use Concrete\Core\Filesystem\FileLocator\PackageLocation;
use Concrete\Core\Health\Report\Runner;
use Concrete\Core\Health\Report\Test\TestInterface;
use Concrete\Core\Health\Search\Traits\SearchContentTrait;
use Doctrine\ORM\EntityManagerInterface;

class SimpleBlockContentTest extends Axmls implements TestInterface
{
    use SearchContentTrait;

    private EntityManagerInterface $em;
    private FileLocator $locator;

    protected array $scanTables = [
        'btContentLocal' => ['bID', 'content']
    ];

    public function __construct(EntityManagerInterface $em, FileLocator $locator)
    {
        $this->em = $em;
        $this->locator = $locator;
    }

    public function run(Runner $report): void
    {
        $typeRepository = $this->em->getRepository(BlockType::class);
        /** @var BlockType[] $types */
        $types = $typeRepository->findAll();

        foreach ($types as $type) {
            $typeHandle = $type->getBlockTypeHandle();
            if ($typeHandle !== 'content' && $typeHandle !== 'html') {
                $this->addTable($type);
            }
        }

        // Alright we're ready to scan.
        foreach ($this->scanTables as $table => $columns) {
            $this->auditTable($report, $table, $columns);<commit_msg>Fix syntax under php 7.3<commit_after><?php
namespace Concrete\Core\Health\Report\Test\Test\Search;

use Concrete\Core\Block\Block;
use Concrete\Core\Database\Schema\Parser\Axmls;
use Concrete\Core\Entity\Block\BlockType\BlockType;
use Concrete\Core\Filesystem\FileLocator;
use Concrete\Core\Filesystem\FileLocator\PackageLocation;
use Concrete\Core\Health\Report\Runner;
use Concrete\Core\Health\Report\Test\TestInterface;
use Concrete\Core\Health\Search\Traits\SearchContentTrait;
use Doctrine\ORM\EntityManagerInterface;

class SimpleBlockContentTest extends Axmls implements TestInterface
{
    use SearchContentTrait;

    private $em;
    private $locator;

    protected $scanTables = [
        'btContentLocal' => ['bID', 'content']
    ];

    public function __construct(EntityManagerInterface $em, FileLocator $locator)
    {
        $this->em = $em;
        $this->locator = $locator;
    }

    public function run(Runner $report): void
    {
        $typeRepository = $this->em->getRepository(BlockType::class);
        /** @var BlockType[] $types */
        $types = $typeRepository->findAll();

        foreach ($types as $type) {
            $typeHandle = $type->getBlockTypeHandle();
            if ($typeHandle !== 'content' && $typeHandle !== 'html') {
                $this->addTable($type);
            }
        }

        // Alright we're ready to scan.
        foreach ($this->scanTables as $table => $columns) {
            $this->auditTable($report, $table, $columns);
{'fraction_non_alphanumeric': 0.13013245033112583, 'fraction_numerical': 0.0006622516556291391, 'mean_word_length': 3.1784232365145226, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '419470', 'n_tokens_mistral': 896, 'n_tokens_neox': 879, 'n_words': 176}