refactoring for dependency injection and testability.

This commit is contained in:
Taylor Otwell
2011-08-25 22:53:05 -05:00
parent 0b86c94551
commit 1e7850d9ba
75 changed files with 1441 additions and 1461 deletions

View File

@@ -69,25 +69,6 @@ class Lang {
return new static($key, $replacements);
}
/**
* Set the language the line should be returned in.
*
* The language specified in this method should correspond to a language directory in your application.
*
* <code>
* // Get a "fr" language line
* $line = Lang::line('validation.required')->in('fr')->get();
* </code>
*
* @param string $language
* @return Lang
*/
public function in($language)
{
$this->language = $language;
return $this;
}
/**
* Get the language line.
*
@@ -123,7 +104,9 @@ class Lang {
/**
* Parse a language key.
*
* Language keys follow a {file}.{key} convention.
* Language keys follow a {file}.{key} convention. If a specific language key is not
* specified, an exception will be thrown. Setting entire language files at run-time
* is not currently supported.
*
* @param string $key
* @return array
@@ -168,6 +151,25 @@ class Lang {
return isset(static::$lines[$this->language.$file]);
}
/**
* Set the language the line should be returned in.
*
* The language specified in this method should correspond to a language directory in your application.
*
* <code>
* // Get a "fr" language line
* $line = Lang::line('validation.required')->in('fr')->get();
* </code>
*
* @param string $language
* @return Lang
*/
public function in($language)
{
$this->language = $language;
return $this;
}
/**
* Get the string content of the language line.
*/