Add return types
This commit is contained in:
parent
f2785bca03
commit
05311ac7b6
21 changed files with 84 additions and 78 deletions
|
@ -20,7 +20,7 @@ class ConfigFactory
|
|||
* @return Config
|
||||
* @throws ConfigException
|
||||
*/
|
||||
public static function create(Container $container)
|
||||
public static function create(Container $container): Config
|
||||
{
|
||||
$configPath = __DIR__ . '/../../config/config.yml';
|
||||
if (is_file($configPath)) {
|
||||
|
|
|
@ -15,10 +15,10 @@ class LocaleManagerFactory
|
|||
|
||||
/**
|
||||
* @param Container $container
|
||||
* @return LocaleManager|null
|
||||
* @return LocaleManager
|
||||
* @throws DependencyException
|
||||
*/
|
||||
public static function create(Container $container)
|
||||
public static function create(Container $container): LocaleManager
|
||||
{
|
||||
if (!class_exists('Locale')) {
|
||||
throw new DependencyException('You need to install the intl extension for PHP.');
|
||||
|
|
|
@ -18,7 +18,7 @@ class LoggerFactory
|
|||
* @param Container $container
|
||||
* @return Logger
|
||||
*/
|
||||
public static function create(Container $container)
|
||||
public static function create(Container $container): Logger
|
||||
{
|
||||
$config = $container->get('config');
|
||||
if ($config->debug) {
|
||||
|
|
|
@ -21,7 +21,7 @@ class SessionFactory
|
|||
* @param Container $container
|
||||
* @return Session
|
||||
*/
|
||||
public static function create(Container $container)
|
||||
public static function create(Container $container): Session
|
||||
{
|
||||
$session_factory = new \Aura\Session\SessionFactory();
|
||||
$session = $session_factory->newInstance($_COOKIE);
|
||||
|
|
|
@ -26,7 +26,7 @@ class ViewFactory
|
|||
*
|
||||
* @return string URL
|
||||
*/
|
||||
private static function getCanonicalUrl(Request $request)
|
||||
private static function getCanonicalUrl(Request $request): string
|
||||
{
|
||||
/** @var Uri $uri */
|
||||
$uri = $request->getUri();
|
||||
|
@ -45,7 +45,7 @@ class ViewFactory
|
|||
* @return Smarty
|
||||
* @throws SmartyException
|
||||
*/
|
||||
public static function create(ContainerInterface $container, Request $request = null)
|
||||
public static function create(ContainerInterface $container, Request $request = null): Smarty
|
||||
{
|
||||
if (!isset($request)) {
|
||||
$request = $container->get('request');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue