autorise les fichiers texte au téléchargement
@return ODDragNDrop
@throws ReflectionException
320039
public function enaWordFiles()
    {
        $properties = $this->getProperties();
        $extString  = (!empty($properties['acceptedFiles'])) ? $properties['acceptedFiles'] : '';
        $wordExts   = $this->getWordExtensionConstant();
        foreach ($wordExts as $wordExt) {
            if (strpos($extString, $wordExt) === false) {
                $extString .= ','.$wordExt;
            }
        }
        $extString                      = substr($extString, 1);
        $properties                     = $this->getProperties();
        $properties['acceptedFiles']    = $extString;
        $this->setProperties($properties);
        return $this;
    }
1325109
protected function availableReflections(): \Generator
    {
        /**
         * @var SplFileInfo
         */
        foreach ($this->finder->getIterator() as $file) {
            $reflection = new ReflectionFile((string)$file);

            if ($reflection->hasIncludes()) {
                //We are not analyzing files which has includes, it's not safe to require such reflections
                $this->getLogger()->warning(
                    sprintf("File `%s` has includes and excluded from analysis", $file),
                    compact('file')
                );

                continue;
            }

            /*
             * @var ReflectionFile $reflection
             */
            yield $reflection;
        }
    }
671512
public static function applyformatToText() {
    $args = func_get_args();
    $count = func_num_args();

    $text = $args[$count - 1];
    if ($count == 1) { return $text; }

    $mode_texts = array_slice($args, 0, $count - 1);

    return self::buildEscapeCodes($mode_texts).$text.self::buildEscapeCodes('plain');
  }
793832
public function initializeFormats() {
        if (is_null($this->formats)) {
            $self = $this;
            $this->registerFormat(Format::DBASE3, function ($filePath, $mode) {
                return new format\DBase3($filePath, $mode);
            });
            $this->registerFormat(Format::FOXPRO, function ($filePath, $mode) {
                return new format\FoxPro($filePath, $mode);
            });
            $this->registerFormat(Format::AUTO, function ($filePath, $mode) use (&$self) {
                foreach ($self->getFormats() as $name => $generator) {
                    try {
                        if ($name === Format::AUTO) {
                            continue;
                        }
                        $format = call_user_func($generator, $filePath, $mode);
                        if (!$format instanceof Format) {
                            throw new Exception('Invalid format returned from generator (' . Utils::getType($format) . ')');
                        }
                        if ($format->isValid()) {
                            return $format;
                        }
                    }
                    catch(Exception $e) {
                        throw $e;
                    }
                    catch (StdException $e) {
                        throw new Exception("Unable to detect format of `$filePath`", 0, $e);
                    }
                }
                throw new Exception("Unable to detect format of `$filePath`");
            });
        }
        return $this;
    }
1321893
protected function buildTextPart()
    {
        if ($this->body === false) {
            $result = null;
        } else {
            $result = new MimePart($this->body);
            $result->setType(Mime::TYPE_TEXT);
            $result->setCharset(APP_CHARSET);
        }

        return $result;
    }
443828
public function getAsText()
    {
        if ($this->asText === null) {
            $this->asText = $this->getGenerator()->generateText($this);
        }
        return $this->asText;
    }
796191
public function enaSoundFiles()
    {
        $properties = $this->getProperties();
        $extString  = (!empty($properties['acceptedFiles'])) ? $properties['acceptedFiles'] : '';
        $sndsExts   = $this->getSoundExtensionConstant();
        foreach ($sndsExts as $sndsExt) {
            if (strpos($extString, $sndsExt) === false) {
                $extString .= ','.$sndsExt;
            }
        }
        $extString                      = substr($extString, 1);
        $properties                     = $this->getProperties();
        $properties['acceptedFiles']    = $extString;
        $this->setProperties($properties);
        return $this;
    }
1274309
public static function load()
    {
        if (is_null(self::$loader)) {
            // Create loader object
            self::$loader = new \PhpMyAdmin\MoTranslator\Loader();

            // Set locale
            self::$loader->setlocale(
                self::$loader->detectlocale()
            );

            // Set default text domain
            self::$loader->textdomain('sqlparser');

            // Set path where to look for a domain
            self::$loader->bindtextdomain('sqlparser', __DIR__ . '/../locale/');
        }

        if (is_null(self::$translator)) {
            // Get translator
            self::$translator = self::$loader->getTranslator();
        }
    }
93067
protected function createOwnExtension()
    {
        $this->ownExtension = function (XType $type, $value, $view, $lang) {
            return $this->selfFormat($type, $value, $view, $lang);
        };
    }
11274
protected function parseTitle() {
    if (is_object($this->file)) {
      if (isset($this->file->title)) {
        return $this->file->title;
      }
    }

    if (is_array($this->file)) {
      if (isset($this->file['title'])) {
        return $this->file['title'];
      }
    }

    return '';
  }
672645
public function autodiscover(): void
    {
        $entityMappings = [];
        foreach ($this->fileSystem->getEntityDirectories() as $entityDirectory) {
            $namespace = $this->namespaceDetector->detectFromDirectory($entityDirectory);
            if (! $namespace) {
                continue;
            }

            $entityMappings[] = [
                'name' => $namespace, // required name
                'prefix' => $namespace,
                'type' => 'annotation',
                'dir' => $entityDirectory->getRealPath(),
                'is_bundle' => false, // performance
            ];
        }

        $xmlNamespaces = [];

        $directoryByNamespace = $this->resolveDirectoryByNamespace($this->fileSystem->getEntityXmlFiles());
        foreach ($directoryByNamespace as $namespace => $directory) {
            if (in_array($namespace, $xmlNamespaces, true)) {
                continue;
            }

            $xmlNamespaces[] = $namespace;

            $entityMappings[] = [
                'name' => $namespace, // required name
                'prefix' => $namespace,
                'type' => 'xml',
                'dir' => $directory,
                'is_bundle' => false,
            ];
        }

        if (! count($entityMappings)) {
            return;
        }

        // @see https://symfony.com/doc/current/reference/configuration/doctrine.html#mapping-entities-outside-of-a-bundle
        $this->containerBuilder->prependExtensionConfig('doctrine', [
            'orm' => ['mappings' => $entityMappings],
        ]);
    }
695899
public function reflection_file()
	{	
		if ( is_null( $this->reflection_file ) )
		{
			if ( is_null( $reflection = $this->reflection() ) )
			{
				return null;
			}
			
			$this->reflection_file = file( $reflection->getFileName() );
		}
		
		return $this->reflection_file;
	}
402953
public function parseText() : void
    {
        if (!count($this->stream->getTokens())) {
            return;
        }

        if ($this->accept(Token::T_TEXT)) {
            $this->insert(new TextNode($this->getCurrentToken()->getValue()));
            $this->advance();
        }
    }
1284628
public function getReflection(): ClassReflection
    {
        if (null === $this->reflection) {
            $this->reflection = new ClassReflection($this->documentClass);
        }

        return $this->reflection;
    }
361344
protected function scanFilesForDocumentation()
    {
        if ($this->isOpenApi()) {
            $this->swagger = \OpenApi\scan(
                $this->appDir,
                ['exclude' => $this->excludedDirs]
            );
        }

        if (! $this->isOpenApi()) {
            $this->swagger = \Swagger\scan(
                $this->appDir,
                ['exclude' => $this->excludedDirs]
            );
        }

        return $this;
    }
1315044
public function disArchiveFiles()
    {
        $properties     = $this->getProperties();
        $acceptedFiles  = $properties['acceptedFiles'];
        $archExt        = $this->getArchiveExtensionConstant();
        $acceptedFiles  = $this->rmAcceptedFiles($acceptedFiles, $archExt);
        $properties['acceptedFiles']    = $acceptedFiles;
        $this->setProperties($properties);
        return $this;
    }
1197560
public function getText() : ?string 
    {
        if ( ! $this->hasText()) {
            $this->setText($this->getDefaultText());
        }
        return $this->text;
    }