symbiote /
silverstripe-queuedjobs
This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Symbiote\QueuedJobs\Jobs; |
||
| 4 | |||
| 5 | use SilverStripe\Control\HTTPRequest; |
||
| 6 | use SilverStripe\Core\Injector\Injector; |
||
| 7 | use SilverStripe\Dev\BuildTask; |
||
| 8 | use SilverStripe\ORM\DataObject; |
||
| 9 | use Symbiote\QueuedJobs\Services\AbstractQueuedJob; |
||
| 10 | use Symbiote\QueuedJobs\Services\QueuedJob; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * A job used to delete a data object. Typically used for deletes that need to happen on |
||
| 14 | * a schedule, or where the delete may have some onflow affect that takes a while to |
||
| 15 | * finish the deletion. |
||
| 16 | * |
||
| 17 | * @author [email protected] |
||
| 18 | * @license BSD License http://silverstripe.org/bsd-license/ |
||
| 19 | */ |
||
| 20 | class RunBuildTaskJob extends AbstractQueuedJob |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @param DataObject $node |
||
|
0 ignored issues
–
show
|
|||
| 24 | */ |
||
| 25 | public function __construct($taskClass = null, $queryString = null) |
||
| 26 | { |
||
| 27 | if ($taskClass) { |
||
| 28 | $this->TaskClass = $taskClass; |
||
|
0 ignored issues
–
show
The property
TaskClass does not exist on object<Symbiote\QueuedJobs\Jobs\RunBuildTaskJob>. Since you implemented __set, maybe consider adding a @property annotation.
Since your code implements the magic setter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
Since the property has write access only, you can use the @property-write annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 29 | } |
||
| 30 | |||
| 31 | if ($queryString) { |
||
| 32 | $this->QueryString = $queryString; |
||
|
0 ignored issues
–
show
The property
QueryString does not exist on object<Symbiote\QueuedJobs\Jobs\RunBuildTaskJob>. Since you implemented __set, maybe consider adding a @property annotation.
Since your code implements the magic setter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
Since the property has write access only, you can use the @property-write annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 33 | } |
||
| 34 | |||
| 35 | $this->currentStep = 0; |
||
| 36 | $this->totalSteps = 1; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param string (default: Object) |
||
| 41 | * |
||
| 42 | * @return DataObject |
||
| 43 | */ |
||
| 44 | protected function getObject($name = 'SilverStripe\\Core\\Object') |
||
| 45 | { |
||
| 46 | return DataObject::get_by_id($this->TargetClass, $this->TargetID); |
||
|
0 ignored issues
–
show
The property
TargetClass does not exist on object<Symbiote\QueuedJobs\Jobs\RunBuildTaskJob>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
The property
TargetID does not exist on object<Symbiote\QueuedJobs\Jobs\RunBuildTaskJob>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return string |
||
| 51 | */ |
||
| 52 | public function getJobType() |
||
| 53 | { |
||
| 54 | return QueuedJob::QUEUED; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | public function getTitle() |
||
| 61 | { |
||
| 62 | $taskName = $this->QueryString ? ($this->TaskClass . '?' . $this->QueryString) : $this->TaskClass; |
||
|
0 ignored issues
–
show
The property
QueryString does not exist on object<Symbiote\QueuedJobs\Jobs\RunBuildTaskJob>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
The property
TaskClass does not exist on object<Symbiote\QueuedJobs\Jobs\RunBuildTaskJob>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 63 | return _t('RunBuildTaskJob.JOB_TITLE', 'Run BuildTask {task}', ['task' => $taskName]); |
||
| 64 | } |
||
| 65 | |||
| 66 | public function process() |
||
| 67 | { |
||
| 68 | if (!is_subclass_of($this->TaskClass, BuildTask::class)) { |
||
|
0 ignored issues
–
show
The property
TaskClass does not exist on object<Symbiote\QueuedJobs\Jobs\RunBuildTaskJob>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 69 | throw new \LogicException($this->TaskClass . ' is not a build task'); |
||
|
0 ignored issues
–
show
The property
TaskClass does not exist on object<Symbiote\QueuedJobs\Jobs\RunBuildTaskJob>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 70 | } |
||
| 71 | |||
| 72 | $task = Injector::inst()->create($this->TaskClass); |
||
|
0 ignored issues
–
show
The property
TaskClass does not exist on object<Symbiote\QueuedJobs\Jobs\RunBuildTaskJob>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 73 | if (!$task->isEnabled()) { |
||
| 74 | throw new \LogicException($this->TaskClass . ' is not enabled'); |
||
|
0 ignored issues
–
show
The property
TaskClass does not exist on object<Symbiote\QueuedJobs\Jobs\RunBuildTaskJob>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 75 | } |
||
| 76 | |||
| 77 | $getVars = []; |
||
| 78 | parse_str($this->QueryString, $getVars); |
||
|
0 ignored issues
–
show
The property
QueryString does not exist on object<Symbiote\QueuedJobs\Jobs\RunBuildTaskJob>. Since you implemented __get, maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. Loading history...
|
|||
| 79 | $request = new HTTPRequest('GET', '/', $getVars); |
||
|
0 ignored issues
–
show
It seems like
$getVars can also be of type null; however, SilverStripe\Control\HTTPRequest::__construct() does only seem to accept array, maybe add an additional type check?
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check: /**
* @return array|string
*/
function returnsDifferentValues($x) {
if ($x) {
return 'foo';
}
return array();
}
$x = returnsDifferentValues($y);
if (is_array($x)) {
// $x is an array.
}
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue. Loading history...
|
|||
| 80 | $task->run($request); |
||
| 81 | |||
| 82 | $this->currentStep = 1; |
||
| 83 | $this->isComplete = true; |
||
| 84 | } |
||
| 85 | } |
||
| 86 |
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
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.