usage example: new Message('example.keymap')->addSource('path/to/source/file', '514', '10'),.

@return array the keys to register in jms translation
500251
public static function getTranslationMessages()
    {
        return [
            new Message('menu.page', 'victoire'),
            new Message('menu.preview', 'victoire'),
            new Message('menu.page.settings', 'victoire'),
            new Message('menu.page.template', 'victoire'),
            new Message('menu.page.new', 'victoire'),
            new Message('menu.template', 'victoire'),
            new Message('menu.template.settings', 'victoire'),
            new Message('menu.template.new', 'victoire'),
            new Message('menu.sitemap', 'victoire'),
            new Message('menu.media', 'victoire'),
            new Message('menu.parent', 'victoire'),
            new Message('menu.business_template', 'victoire'),
            new Message('modal.button.create.title', 'victoire'),
            new Message('modal.button.update.title', 'victoire'),
            new Message('menu.leftnavbar.stats.label', 'victoire'),
            new Message('menu.leftnavbar.target.label', 'victoire'),
            new Message('menu.leftnavbar.lang.label', 'victoire'),
            new Message('menu.leftnavbar.network.label', 'victoire'),
            new Message('menu.leftnavbar.todo.label', 'victoire'),
            new Message('menu.leftnavbar.img.label', 'victoire'),
            new Message('menu.leftnavbar.user.label', 'victoire'),
            new Message('menu.leftnavbar.404.label', 'victoire'),
            new Message('menu.leftnavbar.sitemap.label', 'victoire'),
            new Message('menu.leftnavbar.sandbox.label', 'victoire'),
        ];
    }
59436
protected function getResourceMethodConfiguration(): array
    {
        return [
            ResourceMethodEnum::GET_ALL => RequestPathFormatEnum::TASKS,
            ResourceMethodEnum::GET_ALL_FOR_FOLDER => RequestPathFormatEnum::TASKS_FOR_FOLDER,
            ResourceMethodEnum::GET_BY_ID => RequestPathFormatEnum::TASKS_BY_ID,
            ResourceMethodEnum::GET_BY_IDS => RequestPathFormatEnum::TASKS_BY_IDS,
            ResourceMethodEnum::CREATE_FOR_FOLDER => RequestPathFormatEnum::TASKS_FOR_FOLDER,
            ResourceMethodEnum::UPDATE => RequestPathFormatEnum::TASKS_BY_ID,
            ResourceMethodEnum::DELETE => RequestPathFormatEnum::TASKS_BY_ID,
        ];
    }
619641
private function getJWKSources(): array
    {
        if (null !== $this->jwkSources) {
            return $this->jwkSources;
        }

        // load bundled adapter factories
        $tempContainer = new ContainerBuilder();
        $tempContainer->registerForAutoconfiguration(JWKSourceInterface::class)->addTag('jose.jwk_source');
        $loader = new YamlFileLoader($tempContainer, new FileLocator(__DIR__.'/../../../Resources/config'));
        $loader->load('jwk_sources.yml');
        $services = $tempContainer->findTaggedServiceIds('jose.jwk_source');
        $jwkSources = [];
        foreach (\array_keys($services) as $id) {
            $factory = $tempContainer->get($id);
            if (!$factory instanceof JWKSourceInterface) {
                throw new \InvalidArgumentException();
            }
            $jwkSources[\str_replace('-', '_', $factory->getKey())] = $factory;
        }

        $this->jwkSources = $jwkSources;

        return $jwkSources;
    }
198528
protected function getMap(): array
    {
        $auth = $this->core->auth();
        $paths = [
            ['GET', '/sw.[i].js', function () {
                if (headers_sent() === false) {
                    header("Content-Type: application/javascript");
                }
                return file_get_contents(dirname(__DIR__) . "/files/sw.js");
            }],
            ['GET', '/offline', "Home@offline"],
        ];
        if ($auth->details === false) {
            $paths = array_merge($paths, [
                ['GET', '/api/[**:link]?', "API"],
                ['GET', '/login', "Auth@showLogin", 'login-page'],
                ['GET', '/register', "Auth@showRegister", 'register-page'],
                ['GET', '/confirm', "Auth@confirm", 'confirm-page'],
                ['GET', '/forgot', "Auth@showForgot", 'forgot-page'],
                ['GET', '/reset/[a:reset_code]', "Auth@showReset", 'reset-page']
            ]);
        } else {
            $paths = array_merge($paths, [
                ['GET', '/api/[**:link]', "Auth@redirect"],
                ['GET', '/login', "Auth@redirect"],
                ['GET', '/register', "Auth@redirect"],
                ['GET', '/confirm', "Auth@confirm", 'confirm-page'],
                ['GET', '/forgot', "Auth@redirect"],
                ['GET', '/reset/[a:reset_code]', "Auth@redirect"]
            ]);
        }
        if ($auth->allow(["min" => 5, "max" => 1]) === true) {
            $paths = array_merge($paths, [
                ['GET', '/', "User@showProfile", 'home-page'],
                ['GET', '/logout', "User@logout", 'logout-page']
            ]);
        } elseif ($auth->details === false) {
            $paths = array_merge($paths, [
                ['GET', '/', "Home@redirect"],
                ['GET', '/logout', "Home@redirect"]
            ]);
        }
        if ($auth->allow(["min" => 4, "max" => 4]) === true) {
            $paths = array_merge($paths, [
                ['GET', '/users', "User@showList", 'users-list-page']
            ]);
        } elseif ($auth->details === false) {
            $paths = array_merge($paths, [
                ['GET', '/users', "Home@redirect"]
            ]);
        }
        if ($auth->allow(["min" => 4, "max" => 1]) === true) {
            $paths = array_merge($paths, [
                ['GET', '/pages/[i:page]?', "Page@showList", 'pages-list-page']
            ]);
        } elseif ($auth->details === false) {
            $paths = array_merge($paths, [
                ['GET', '/pages/[i:page]?', "Home@redirect"]
            ]);
        }
        if ($auth->allow(["min" => 3, "max" => 1]) === true) {
            $paths = array_merge($paths, [
                ['GET', '/pages/new', "Page@showNew", 'pages-new-page'],
                ['GET', '/pages/edit/[i:id]', "Page@showEdit", 'pages-edit-page'],
            ]);
        } elseif ($auth->details === false) {
            $paths = array_merge($paths, [
                ['GET', '/pages/new', "Home@redirect"],
                ['GET', '/pages/edit/[i:id]', "Home@redirect"],
            ]);
        }
        if ($auth->allow(["min" => 2, "max" => 1]) === true) {
            $paths = array_merge($paths, [
                ['GET', '/navigations', "Navigation@showNavigations", 'navigations-page']
            ]);
        } elseif ($auth->details === false) {
            $paths = array_merge($paths, [
                ['GET', '/navigations', "Home@redirect"]
            ]);
        }
        if ($auth->allow(["min" => 1, "max" => 1]) === true) {
            $paths = array_merge($paths, [
                ['GET', '/users/[i:page]?', "User@showList", 'users-list-page'],
                ['GET', '/users/new', "User@showNew", 'users-new-page'],
                ['GET', '/users/edit/[i:id]', "User@showEdit", 'users-edit-page'],
                ['GET', '/settings', "Site@showSettings", 'settings-page']
            ]);
        } elseif ($auth->details === false) {
            $paths = array_merge($paths, [
                ['GET', '/users/[i:page]?', "Home@redirect"],
                ['GET', '/users/new', "Home@redirect"],
                ['GET', '/users/edit/[i:id]', "Home@redirect"],
                ['GET', '/settings', "Home@redirect"]
            ]);
        }
        return $paths;
    }
12079
public function allSourcePaths()
    {
        return array_merge(
            $this->allPsr4SourcePaths(),
            $this->allPsr0SourcePaths(),
            $this->autoloadClassmap(),
            $this->autoloadFiles(),
            $this->includePath()
        );
    }
646991
private Map<String, Properties> loadRegisteredMessageResources() {
        Map<String, Properties> internalMessages = loadRegisteredMessageResources("pippo/pippo-messages%s.properties");
        Map<String, Properties> applicationMessages = loadRegisteredMessageResources("conf/messages%s.properties");
        Map<String, Properties> allMessages = new TreeMap<>();

        Set<String> merged = new HashSet<>();
        // create aggregate messages
        for (Map.Entry<String, Properties> entry : internalMessages.entrySet()) {
            String language = entry.getKey();
            Properties messages = entry.getValue();
            allMessages.put(language, messages);

            if (applicationMessages.containsKey(language)) {
                // override internal messages with application messages
                messages.putAll(applicationMessages.get(language));
            }

            merged.add(language);
        }

        // bring in the application languages which do not have an internal counterpart
        Set<String> unmerged = new HashSet<>(applicationMessages.keySet());
        unmerged.removeAll(merged);
        for (String language : unmerged) {
            allMessages.put(language, applicationMessages.get(language));
        }

        return allMessages;
    }
651138
protected function getSource($packagePath)
    {
        $sources = [
            "{$packagePath}/resources/database/migrations",
            "{$packagePath}/resources/migrations",
            "{$packagePath}/migrations",
        ];

        // iterate through all possible locations
        foreach ($sources as $source) {
            if ($this->files->isDirectory($source)) {
                $paths = [];

                // get all files of the current directory
                $files = $this->getSourceFiles($source);

                // iterate through all files
                foreach ($files as $file) {
                    // if the destination doesn't exist we can add the file to the queue
                    if (!class_exists($this->getClassFromFile($file))) {
                        $paths[$file] = $this->getDestinationPath('migrations', [
                            date('Y_m_d_His', time()), $this->getFileName($file),
                        ]);
                    }
                }

                return $paths;
            }
        }

        throw new InvalidArgumentException('Migrations not found.');
    }
983067
protected function getMappingClasses(): array
    {
        AnnotationRegistry::registerLoader('class_exists');

        $mappingClasses = [];

        foreach ($this->locator->getMappingFiles() as $annotationFile) {
            $mappingClasses[] = $this->loadClassFromFile($annotationFile);
        }

        return \array_map(
            function (string $sourceClass) {
                return new \ReflectionClass($sourceClass);
            },
            \array_filter(\array_unique($mappingClasses))
        );
    }
629981
public function getSourceStrings($buildIfNotSet = false)
    {
        $result = $this->sourceStrings;
        if ($result === null && $buildIfNotSet) {
            $result = new Translations();
            $result->setLanguage($this->app->make('community_translation/sourceLocale'));
            foreach ($this->translations as $translations) {
                foreach ($translations[1] as $key => $translation) {
                    if (!$result->offsetExists($key)) {
                        $newTranslation = $result->insert($translation->getContext(), $translation->getOriginal(), $translation->getPlural());
                        foreach ($translation->getExtractedComments() as $comment) {
                            $newTranslation->addExtractedComment($comment);
                        }
                    }
                }
            }
            $this->sourceStrings = $result;
        }

        return $result;
    }
394980
public List<String> messageSources() {
        if (null == _messageSources) {
            _messageSources = Arrays.asList(get(I18N_MESSAGE_SOURCES).toString().split("[, \\t]+"));
        }
        return _messageSources;
    }
1076215
protected function getKeys()
    {
        $identifier = $this->getIdentifier();

        $query = new Query();
        $selectNode = new Node\SelectNode([$identifier]);
        $query->setSelect($selectNode);
        $queryResult = $this->query($query);
        $keysArray = [];

        foreach ($queryResult as $row) {
            $keysArray[] = $row[$identifier];
        }

        return $keysArray;
    }
962477
public function actionFiles() {
		$sources = [];

		$currentSource = $this->getSource();

		foreach ($this->config->sources as $key => $source) {
			if ($this->request->source && $this->request->source !== 'default' && $currentSource !== $source && $this->request->path !== './') {
				continue;
			}

			if ($this->accessControl->isAllow($this->getUserRole(), $this->action, $source->getPath())) {
				$sources[$key] = $this->read($source);
			}


		}

		return [
			'sources' => $sources
		];
	}
1360494
private function loadResourceFiles()
    {
        return $this->replaceExecutableCode(
            $this->loadResourcesFiles()
        )->mapWithKeys(function ($value, $key) {
            return [$this->removeExtension($key) => $value];
        });
    }
1354618
public CmsResourceTranslator getFileTranslator() {

        String[] array = new String[0];
        if (m_fileTranslationEnabled) {
            array = new String[m_fileTranslations.size()];
            for (int i = 0; i < m_fileTranslations.size(); i++) {
                array[i] = m_fileTranslations.get(i);
            }
        }
        return new CmsResourceTranslator(array, true);
    }
905834
private File [] getSourceDirectories ()
  {
    final Set <File> directories = new LinkedHashSet <> ();
    if (this.sourceDirectories != null && this.sourceDirectories.length > 0)
    {
      directories.addAll (Arrays.asList (this.sourceDirectories));
    }
    else
    {
      if (this.defaultGrammarDirectoryJavaCC != null)
      {
        directories.add (this.defaultGrammarDirectoryJavaCC);
      }
      if (this.defaultGrammarDirectoryJJTree != null)
      {
        directories.add (this.defaultGrammarDirectoryJJTree);
      }
      if (this.defaultGrammarDirectoryJTB != null)
      {
        directories.add (this.defaultGrammarDirectoryJTB);
      }
    }
    return directories.toArray (new File [directories.size ()]);
  }
1217894
protected function getMessages()
    {
        $messages = [];
        foreach ($this->sourcePath as $namespace => $path) {
            $messages = array_merge($this->getMessagesFromSourcePath($path, $namespace), $messages);
        }

        return $messages;
    }
292816
public function availableIncludeKeys(): array
    {
        $availableKeys = [];
        if (($transformer = $this->transformer()) !== null && ($transformer instanceof  TransformerInterface)) {
            $availableKeys = $transformer->getAvailableIncludes();
        }

        return $availableKeys;
    }