/** * Finds the file name extension for a given file path that has no extension. * * @param string $path The absolute path to a view template, with or without filename extension. * @return string|bool The complete file name or false if no suitable file was found. */ private function findTemplate($path) { if (file_exists($path)) { return $path; } return FilesystemFlow::glob("{$path}.*")->onlyFiles()->fetchKey(); }
/** * @return string[] */ private function getProjectMigrations() { return FilesystemFlow::glob("{$this->migrationsPath}/*.php")->keys()->sort()->map(function ($path, &$i) { $i = str_segmentsFirst(basename($path), '_'); return [Migration::date => $i, Migration::name => Migration::nameFromFilename($path), Migration::module => $this->module->name, Migration::path => $path]; })->all(); }