Function getTasksForWorkflow
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getTasksForWorkflow($workflowId, $active = true)
{
$cacheName = "{$workflowId}:{$active}";
if (\App\Cache::staticHas('getTasksForWorkflow', $cacheName)) {
return \App\Cache::staticGet('getTasksForWorkflow', $cacheName);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Missing class import via use statement (line '92', column '15'). Open
$row = (new \App\Db\Query())->select(['task_id', 'workflow_id', 'task'])->from('com_vtiger_workflowtasks')->where(['task_id' => $taskId])->one();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The method getTasksForWorkflow has a boolean flag argument $active, which is a certain sign of a Single Responsibility Principle violation. Open
public function getTasksForWorkflow($workflowId, $active = true)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '114', column '22'). Open
$dataReader = (new \App\Db\Query())->select(['task_id', 'workflow_id', 'task'])->from('com_vtiger_workflowtasks')->where(['workflow_id' => $workflowId])->orderBy(['sequence' => SORT_ASC])->createCommand()->query();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class 'VTTaskType' in method 'createTask'. Open
$taskTypeInstance = VTTaskType::getInstanceFromTaskType($taskType);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Cache' in method 'getTasksForWorkflow'. Open
if (\App\Cache::staticHas('getTasksForWorkflow', $cacheName)) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Cache' in method 'getTasksForWorkflow'. Open
return \App\Cache::staticGet('getTasksForWorkflow', $cacheName);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Cache' in method 'getTasksForWorkflow'. Open
\App\Cache::staticSave('getTasksForWorkflow', $cacheName, $tasks);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'App\Db' in method 'saveTask'. Open
$db = App\Db::getInstance();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Define a constant instead of duplicating this literal "com_vtiger_workflowtasks" 5 times. Open
$db->createCommand()->update('com_vtiger_workflowtasks', ['summary' => $task->summary, 'task' => serialize($task)], ['task_id' => $taskId])->execute();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "workflow_id" 6 times. Open
'workflow_id' => $task->workflowId,
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "task_id" 7 times. Open
$db->createCommand()->update('com_vtiger_workflowtasks', ['summary' => $task->summary, 'task' => serialize($task)], ['task_id' => $taskId])->execute();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "getTasksForWorkflow" 3 times. Open
if (\App\Cache::staticHas('getTasksForWorkflow', $cacheName)) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Return type of saveTask()
is undeclared type \The
Open
public function saveTask(VTTask $task)
- Exclude checks
Reference to undeclared property \VTTask->workflowId
Open
'workflow_id' => $task->workflowId,
- Exclude checks
Suspicious type bool|true
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
$cacheName = "{$workflowId}:{$active}";
- Exclude checks
Returning type array|bool
but retrieveTask()
is declared to return \VTTask
Open
return $task;
- Exclude checks
Expected an object instance when accessing an instance property, but saw an expression with type array|bool
Open
$task->workflowId = $row['workflow_id'];
- Exclude checks
Reference to undeclared property \VTTask->id
Open
if (!empty($task->id) && is_numeric($task->id)) {
- Exclude checks
Reference to undeclared property \VTTask->summary
Open
$db->createCommand()->update('com_vtiger_workflowtasks', ['summary' => $task->summary, 'task' => serialize($task)], ['task_id' => $taskId])->execute();
- Exclude checks
Reference to undeclared property \VTTask->id
Open
$taskId = $task->id;
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$dataReader = (new \App\Db\Query())->select(['task_id', 'workflow_id', 'task'])->from('com_vtiger_workflowtasks')->where(['workflow_id' => $workflowId])->orderBy(['sequence' => SORT_ASC])->createCommand()->query();
- Exclude checks
Reference to undeclared property \VTTask->email
Open
if (isset($task->email) && !\is_array($task->email)) {
- Exclude checks
Reference to undeclared property \VTTask->summary
Open
'summary' => $task->summary,
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->update('com_vtiger_workflowtasks', ['summary' => $task->summary, 'task' => serialize($task)], ['task_id' => $taskId])->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->insert('com_vtiger_workflowtasks', [
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
App\Db::getInstance()->createCommand()->delete('com_vtiger_workflowtasks', ['task_id' => $taskId])->execute();
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$row = (new \App\Db\Query())->select(['task_id', 'workflow_id', 'task'])->from('com_vtiger_workflowtasks')->where(['task_id' => $taskId])->one();
- Exclude checks
Reference to undeclared property \VTTask->sequence
Open
'sequence' => $task->sequence,
- Exclude checks
Returning type string
but saveTask()
is declared to return \The
Open
return $db->getLastInsertID();
- Exclude checks
Reference to undeclared property \VTTask->email
Open
$task->email = [$task->email];
- Exclude checks
Expected an object instance when accessing an instance property, but saw an expression with type array|bool
Open
$task->id = $row['task_id'];
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class VTTaskManager
- Exclude checks
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 17 and the first side effect is on line 11. Open
<?php
- Exclude checks
Avoid variables with short names like $db. Configured minimum length is 3. Open
$db = App\Db::getInstance();
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($task->id) && is_numeric($task->id)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//How do I check whether a member exists in php?
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Delete task by id.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $taskId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
require_once $taskTypeInstance->get('classpath');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Return tasks for workflow.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$task = unserialize($row['task']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Retrieve a task from the database.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row = (new \App\Db\Query())->select(['task_id', 'workflow_id', 'task'])->from('com_vtiger_workflowtasks')->where(['task_id' => $taskId])->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($taskType)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($task->email) && !\is_array($task->email)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $task;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function unserializeTask($str)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Save the task into the database.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$taskId = $task->id;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'task' => serialize($task),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'sequence' => $task->sequence,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$task->active = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
require_once "tasks/$taskType.php";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$taskType = self::taskName($str);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return VTTask
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getTasksForWorkflow($workflowId, $active = true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = (new \App\Db\Query())->select(['task_id', 'workflow_id', 'task'])->from('com_vtiger_workflowtasks')->where(['workflow_id' => $workflowId])->orderBy(['sequence' => SORT_ASC])->createCommand()->query();
- Exclude checks
Line exceeds 120 characters; contains 222 characters Open
$dataReader = (new \App\Db\Query())->select(['task_id', 'workflow_id', 'task'])->from('com_vtiger_workflowtasks')->where(['workflow_id' => $workflowId])->orderBy(['sequence' => SORT_ASC])->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param VTTask $task The task instance to save
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function saveTask(VTTask $task)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->update('com_vtiger_workflowtasks', ['summary' => $task->summary, 'task' => serialize($task)], ['task_id' => $taskId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $taskId;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
App\Db::getInstance()->createCommand()->delete('com_vtiger_workflowtasks', ['task_id' => $taskId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db = App\Db::getInstance();
- Exclude checks
Line exceeds 120 characters; contains 163 characters Open
$db->createCommand()->update('com_vtiger_workflowtasks', ['summary' => $task->summary, 'task' => serialize($task)], ['task_id' => $taskId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'workflow_id' => $task->workflowId,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $taskType
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$taskTypeInstance = VTTaskType::getInstanceFromTaskType($taskType);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Line exceeds 120 characters; contains 153 characters Open
$row = (new \App\Db\Query())->select(['task_id', 'workflow_id', 'task'])->from('com_vtiger_workflowtasks')->where(['task_id' => $taskId])->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$task->workflowId = $row['workflow_id'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $task;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$cacheName = "{$workflowId}:{$active}";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Create a new class instance.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$taskClass = $taskTypeInstance->get('classname');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$task = new $taskClass();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$task = $this->unserializeTask($row['task']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param bool $active
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::staticSave('getTasksForWorkflow', $cacheName, $tasks);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $str
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* When a new task is saved for the first time a field is added to it called
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$task->workflowId = $workflowId;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function retrieveTask($taskId)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$task->id = $row['task_id'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$task->workflowId = $row['workflow_id'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Unserialize task string.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return The id of the task
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->insert('com_vtiger_workflowtasks', [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Cache::staticHas('getTasksForWorkflow', $cacheName)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tasks = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$taskType = self::taskName($row['task']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
continue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$task->id = $row['task_id'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array|bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($active && !$task->active) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'summary' => $task->summary,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $workflowId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$task->summary = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $workflowId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $tasks;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* id that stores the task id used in the database.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$task->email = [$task->email];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $db->getLastInsertID();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function deleteTask($taskId)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return VTTask The retrieved task
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function createTask($taskType, $workflowId)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param $taskId The id of the task to retrieve
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \App\Cache::staticGet('getTasksForWorkflow', $cacheName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tasks[] = $task;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($taskType)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $matches[1];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return unserialize($str);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
require_once "tasks/$taskType.php";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function taskName($serializedTask)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $serializedTask
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Return task name.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
preg_match('/"([^"]+)"/', $serializedTask, $matches);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$matches = [];
- Exclude checks