Upgrade to 3.7.0

This commit is contained in:
Bastian Allgeier
2022-06-27 10:02:22 +02:00
parent 0751a6510d
commit 1c22148d7b
674 changed files with 5052 additions and 3082 deletions

14
kirby/src/Cms/Files.php Normal file → Executable file
View File

@@ -107,26 +107,30 @@ class Files extends Collection
/**
* Tries to find a file by id/filename
* @deprecated 3.7.0 Use `$files->find()` instead
* @todo 3.8.0 Remove method
* @codeCoverageIgnore
*
* @param string $id
* @return \Kirby\Cms\File|null
*/
public function findById(string $id)
{
return $this->get(ltrim($this->parent->id() . '/' . $id, '/'));
Helpers::deprecated('Cms\Files::findById() has been deprecated and will be removed in Kirby 3.8.0. Use $files->find() instead.');
return $this->findByKey($id);
}
/**
* Alias for FilesFinder::findById() which is
* used internally in the Files collection to
* map the get method correctly.
* Finds a file by its filename
* @internal Use `$files->find()` instead
*
* @param string $key
* @return \Kirby\Cms\File|null
*/
public function findByKey(string $key)
{
return $this->findById($key);
return $this->get(ltrim($this->parent->id() . '/' . $key, '/'));
}
/**