gc_session accesses the super-global variable $_SESSION. Open
function gc_session()
{
$now = time();
$_SESSION['login'] = isset($_SESSION['login']) ? $_SESSION['login'] : [];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
gc_session accesses the super-global variable $_SESSION. Open
function gc_session()
{
$now = time();
$_SESSION['login'] = isset($_SESSION['login']) ? $_SESSION['login'] : [];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
gc_session accesses the super-global variable $_SESSION. Open
function gc_session()
{
$now = time();
$_SESSION['login'] = isset($_SESSION['login']) ? $_SESSION['login'] : [];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
gc_session accesses the super-global variable $_SESSION. Open
function gc_session()
{
$now = time();
$_SESSION['login'] = isset($_SESSION['login']) ? $_SESSION['login'] : [];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
gc_session accesses the super-global variable $_SESSION. Open
function gc_session()
{
$now = time();
$_SESSION['login'] = isset($_SESSION['login']) ? $_SESSION['login'] : [];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
gc_session accesses the super-global variable $_SESSION. Open
function gc_session()
{
$now = time();
$_SESSION['login'] = isset($_SESSION['login']) ? $_SESSION['login'] : [];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
gc_session accesses the super-global variable $_SESSION. Open
function gc_session()
{
$now = time();
$_SESSION['login'] = isset($_SESSION['login']) ? $_SESSION['login'] : [];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
gc_session accesses the super-global variable $_SESSION. Open
function gc_session()
{
$now = time();
$_SESSION['login'] = isset($_SESSION['login']) ? $_SESSION['login'] : [];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
gc_session accesses the super-global variable $_SESSION. Open
function gc_session()
{
$now = time();
$_SESSION['login'] = isset($_SESSION['login']) ? $_SESSION['login'] : [];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
gc_session accesses the super-global variable $_SESSION. Open
function gc_session()
{
$now = time();
$_SESSION['login'] = isset($_SESSION['login']) ? $_SESSION['login'] : [];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
gc_session accesses the super-global variable $_SESSION. Open
function gc_session()
{
$now = time();
$_SESSION['login'] = isset($_SESSION['login']) ? $_SESSION['login'] : [];
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
Method get_client_app
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_client_app(m\Client $client, m\Service\Scope $scope, array $callback_uris)
{
$file = strtr($client->getHostname(), ['/' => '_']);
$path = __DIR__ . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, ['..', 'cache', "{$file}.json"]);
The method get_client_app uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$create_app_path = sprintf('%s://%s/api/v1/apps', $client->getScheme(), $client->getHostname());
$request_options = [
'form_params' => [
'client_name' => \SERVICE_NAME . " ip",
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Call to undeclared function \GuzzleHttp\json_decode()
(Did you mean \json_decode() or \json_encode()) Open
return \GuzzleHttp\json_decode($app, true);
- Exclude checks
Saw possibly unextractable annotation for a fragment of comment '* @param string':
after string,
did not see an element name (will guess based on comment order) Open
* @param string
- Exclude checks
Call to method request
from undeclared class \GuzzleHttp\ClientInterface
Open
$response = m\http()->request('POST', $create_app_path, $request_options);
- Exclude checks
Possibly zero references to use statement for classlike/namespace v
(\Respect\Validation\Validator)
Open
use Respect\Validation\Validator as v;
- Exclude checks
Call to method debug
from undeclared class \Monolog\Logger
Open
app_log()->debug('create_app', ['app' => $app]);
- Exclude checks
Call to method info
from undeclared class \Monolog\Logger
Open
chrome_log()->info('request', [
- Exclude checks