for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* A queued job that publishes a target after a delay.
*
* @package advancedworkflow
*/
class WorkflowPublishTargetJob extends AbstractQueuedJob {
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
public function __construct($obj = null, $type = null) {
if ($obj) {
$this->setObject($obj);
$this->publishType = $type ? strtolower($type) : 'publish';
$this->totalSteps = 1;
}
public function getTitle() {
return _t(
'AdvancedWorkflowPublishJob.SCHEDULEJOBTITLE',
"Scheduled {type} of {object}",
"",
array(
array('type' => $this->p...is->getObject()->Title)
array<string,?,{"type":"?","object":"?"}>
string
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
'type' => $this->publishType,
'object' => $this->getObject()->Title
)
);
public function process() {
if ($target = $this->getObject()) {
if ($this->publishType == 'publish') {
$target->setIsPublishJobRunning(true);
$target->PublishOnDate = '';
$target->writeWithoutVersion();
$target->doPublish();
} else if ($this->publishType == 'unpublish') {
$target->UnPublishOnDate = '';
$target->doUnpublish();
$this->currentStep = 1;
$this->isComplete = true;
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.