Get message names from folder in this directory

@return array
770051
public function listMessages()
    {
        $folder = $this->_path.SEPARATOR.$this->_directory.SEPARATOR."messages";
        $messages = array_slice(scandir($folder), 2);
        foreach ($messages as &$msg) {
            $msg = str_replace('.xml', '', $msg);
        }
        return $messages;
    }
378187
protected function getUserMessages()
    {
        $messages = [];

        foreach ($this->repository->all() as $field) {
            foreach ($field->getOption('messages') as $rule => $message) {
                $messages[$field->getName().'.'.$rule] = $message;
            }
        }

        return $messages;
    }
587512
public function getMessage()
    {
        $result = [];

        $messages = (isset($this->indexReverse[self::MESSAGE])) ? $this->indexReverse[self::MESSAGE] : [];

        foreach ($messages as $index) {
            $result[] = $this->getChild($index);
        }

        return $result;
    }
506858
private function getFilenames()
    {
        $files = [];

        foreach ($this->filesets as $fileset) {
            $ds = $fileset->getDirectoryScanner($this->project);
            $ds->scan();

            $includedFiles = $ds->getIncludedFiles();

            foreach ($includedFiles as $file) {
                $fs = new PhingFile(basename($ds->getBaseDir()), $file);

                $files[] = $fs->getAbsolutePath();
            }
        }

        return $files;
    }
65219
public function postbackMessages()
    {
        $result = [];
        foreach ($this->entries as $entry) {
            foreach ($entry->messages as $entryMessage) {
                if ($entryMessage->isPostback) {
                    $result[] = $entryMessage;
                }
            }
        }
        return collect($result);
    }
260823
public function getAllDirectories(): array
    {
        $directories = [];

        foreach ($this->filesystem->listContents('/'.$this->path) as $info) {
            $id = $info['filename'];

            if ($this->hasDirectory($id)) {
                $directories[$id] = $this->getDirectory($id);
            }
        }

        return $directories;
    }
1327460
private function getFiles(): array
	{
		$result = [];
		$files = Finder::find('*')
			->in($this->getFullPath());
		foreach ($files as $file) {
			$result[] = new FileInfo($file);
		}
		usort($result, function ($a, $b) {
			if ($a->isDir == $b->isDir) {
				return strcmp($a->name, $b->name);
			} else {
				if ($a->isDir) {
					return -1;
				} else {
					return 1;
				}
			}
		});
		return $result;
	}
1255798
public function getFileNames()
    {

        $filesArray = $this->getFiles();
        $filenamesArray = array();

        foreach ($filesArray as $file) {
            $sFileName = $file->getName();
            array_push($filenamesArray, $sFileName);
        }
        sort($filenamesArray);
        return $filenamesArray;
    }
523005
protected function getMessages($dir)
    {
        $file = sprintf("%smessages/%s.php", $dir, $this->lang);
        if (file_exists($file)) {
            return include $file;
        }

        return [];
    }
500007
public function getFilenames()
    {
        $files = [];
        foreach ($this->classList->getClasses() as $class) {
            // Push interfaces before classes if not already loaded
            try {
                $r = new \ReflectionClass($class);
                foreach ($r->getInterfaces() as $inf) {
                    $name = $inf->getFileName();
                    if ($name && !in_array($name, $files)) {
                        $files[] = $name;
                    }
                }
                if (!in_array($r->getFileName(), $files)) {
                    $files[] = $r->getFileName();
                }
            } catch (\ReflectionException $e) {
                // We ignore all exceptions related to reflection because in
                // some cases class doesn't need to exist. We're ignoring all
                // problems with classes, interfaces and traits.
            }
        }

        return $files;
    }
1320296
public function getMessages(): array
    {
        $errors = $this->getErrors();

        $keys = array_keys($errors);

        return array_reduce($keys, function ($messages, $key) use ($errors) {

            $translated = $this->translator->getMessages($key, $errors[$key]);

            return array_merge($messages, $translated);

        }, []);
    }
164535
protected function getFilesetsMsg()
    {
        $project = $this->getProject();
        $msg = '';
        foreach ($this->filesets as $fs) {
            $ds = $fs->getDirectoryScanner($project);
            $fromDir = $fs->getDir($project);
            $srcDirs = $ds->getIncludedDirectories();
            $srcFiles = $ds->getIncludedFiles();
            $msg .= 'Directory: ' . $fromDir . ' => '
                . realpath($fromDir) . "\n";
            foreach ($srcDirs as $dir) {
                $relPath = $fromDir . DIRECTORY_SEPARATOR . $dir;
                $msg .= $relPath . "\n";
            }
            foreach ($srcFiles as $file) {
                $relPath = $fromDir . DIRECTORY_SEPARATOR . $file;
                $msg .= $relPath . "\n";
            }
        }

        return $msg;
    }
1332689
public function message()
    {
        $messages = [];
        foreach($this->values as $key => $value) {
            if ($value->fails()) {
                $messages[$key] = $value->message();
            }
        }
        return $messages;
    }
284096
public function getOnlyMessages()
    {
        $messages = [];
        foreach ($this->errors as $key => $row) {
            foreach ($row as $keyRow => $valueRow) {
                $messages[] = $valueRow;
            }
        }

        return $messages;
    }
178191
public function getAllMessages()
    {
        $messages = [];
        foreach (array_keys($this->errors) as $key) {
            $messages = array_merge($messages, $this->getMessages($key));
        }
        return $messages;
    }
31188
public function getOtherDirectories()
    {
        $directories = array();
        foreach ($this->otherDirectories as $directory) {
            $directories[] = sprintf('%s/%s', $this->getHost()->getPath(), $directory);
        }

        return $directories;
    }
70676
public function getAllEmailAddresses() {
        $saveCurrentFolder = $this->folder;
        $emails = array();
        foreach($this->getFolders() as $folder) {
            $this->selectFolder($folder);
            foreach($this->getMessages(false) as $message) {
                $emails[] = $message['from'];
                $emails = array_merge($emails, $message['to']);
                if (isset($message['cc'])) {
                    $emails = array_merge($emails, $message['cc']);
                }
            }
        }
        $this->selectFolder($saveCurrentFolder);
        return array_unique($emails);
    }