<commit_before><?php
/**
 * (c) <NAME> <<EMAIL>>
 * Created at 06.07.2015 15:43
 */

namespace SciGroup\TinymcePluploadFileManagerBundle\Controller;


use SciGroup\TinymcePluploadFileManagerBundle\Entity\ContentFile;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;

class DefaultController
{
    use ContainerAwareTrait;
    
    public function uploadAction(Request $request, $mappingType)
    {
        $response = [
            'status' => 0,
            'message' => ''
        ];

        try {
            $pathResolver = $this->container->get('sci_group.tpfm.mapping_resolver')->resolve($mappingType);

            $fileNames = [];
            foreach ($request->files as $uploadedFile) {
                /* @var UploadedFile $uploadedFile */
                $dstDirectory = $pathResolver->getDirectory(true);
                $fileName = $pathResolver->generateFileName($uploadedFile);
<commit_msg>-Trait<commit_after><?php
/**
 * (c) <NAME> <<EMAIL>>
 * Created at 06.07.2015 15:43
 */

namespace SciGroup\TinymcePluploadFileManagerBundle\Controller;


use SciGroup\TinymcePluploadFileManagerBundle\Entity\ContentFile;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;

class DefaultController extends Controller
{
    public function uploadAction(Request $request, $mappingType)
    {
        $response = [
            'status' => 0,
            'message' => ''
        ];

        try {
            $pathResolver = $this->container->get('sci_group.tpfm.mapping_resolver')->resolve($mappingType);

            $fileNames = [];
            foreach ($request->files as $uploadedFile) {
                /* @var UploadedFile $uploadedFile */
                $dstDirectory = $pathResolver->getDirectory(true);
                $fileName = $pathResolver->generateFileName($uploadedFile);

{'fraction_non_alphanumeric': 0.11939594148183105, 'fraction_numerical': 0.012269938650306749, 'mean_word_length': 3.140625, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 25, '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': '1341591', 'n_tokens_mistral': 615, 'n_tokens_neox': 585, 'n_words': 96}