Upgrade to 3.2.0

This commit is contained in:
Bastian Allgeier
2019-06-25 09:56:08 +02:00
parent 9e18cf635d
commit 9c89153d35
296 changed files with 14408 additions and 2504 deletions

View File

@@ -10,19 +10,29 @@ use Kirby\Toolkit\F;
* Provides a factory method to convert an array
* to a collection of Translation objects and load
* method to load all translations from disk
*
* @package Kirby Cms
* @author Bastian Allgeier <bastian@getkirby.com>
* @link https://getkirby.com
* @copyright Bastian Allgeier GmbH
* @license https://getkirby.com/license
*/
class Translations extends Collection
{
public function start(string $code)
public function start(string $code): void
{
F::move($this->parent->contentFile('', true), $this->parent->contentFile($code, true));
}
public function stop(string $code)
public function stop(string $code): void
{
F::move($this->parent->contentFile($code, true), $this->parent->contentFile('', true));
}
/**
* @param array $translations
* @return self
*/
public static function factory(array $translations)
{
$collection = new static;
@@ -35,6 +45,11 @@ class Translations extends Collection
return $collection;
}
/**
* @param string $root
* @param array $inject
* @return self
*/
public static function load(string $root, array $inject = [])
{
$collection = new static;