for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Laravel MultiLang package.
*
* (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\LaravelMultiLang;
use Illuminate\Cache\CacheManager as Cache;
use Illuminate\Database\DatabaseManager as Database;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use InvalidArgumentException;
class Config
{
/**
* Config data.
* @var array
protected $data;
* Create a new MultiLang instance.
* @param string $environment
$environment
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @param array $config
$config
* @param \Illuminate\Cache\CacheManager $cache
$cache
* @param \Illuminate\Database\DatabaseManager $db
$db
public function __construct(array $data)
$this->data = $data;
}
public function get($key = null, $default = null)
$array = $this->data;
if ($key === null) {
return $array;
if (array_key_exists($key, $array)) {
return $array[$key];
foreach (explode('.', $key) as $segment) {
if (is_array($array) && array_key_exists($segment, $array)) {
$array = $array[$segment];
} else {
return $default;
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.