Fix PHPStan warnings in lib
[MAILPOET-5751]
This commit is contained in:
@ -202,6 +202,7 @@ class Subscribers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// when global status changes to subscribed, fire subscribed hook for all subscribed segments
|
// when global status changes to subscribed, fire subscribed hook for all subscribed segments
|
||||||
|
/** @var SubscriberEntity $subscriber - From some reason PHPStan evaluates $subscriber->getStatus() as mixed */
|
||||||
if ($subscriber->getStatus() === SubscriberEntity::STATUS_SUBSCRIBED) {
|
if ($subscriber->getStatus() === SubscriberEntity::STATUS_SUBSCRIBED) {
|
||||||
$subscriberSegments = $subscriber->getSubscriberSegments();
|
$subscriberSegments = $subscriber->getSubscriberSegments();
|
||||||
foreach ($subscriberSegments as $subscriberSegment) {
|
foreach ($subscriberSegments as $subscriberSegment) {
|
||||||
|
@ -20,6 +20,7 @@ class AutomationTemplatesGetEndpoint extends Endpoint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function handle(Request $request): Response {
|
public function handle(Request $request): Response {
|
||||||
|
/** @var string|null $category */
|
||||||
$category = $request->getParam('category');
|
$category = $request->getParam('category');
|
||||||
$templates = array_values($this->registry->getTemplates($category ? strval($category) : null));
|
$templates = array_values($this->registry->getTemplates($category ? strval($category) : null));
|
||||||
return new Response(array_map(function (AutomationTemplate $automation) {
|
return new Response(array_map(function (AutomationTemplate $automation) {
|
||||||
|
@ -19,7 +19,9 @@ class AutomationsDeleteEndpoint extends Endpoint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function handle(Request $request): Response {
|
public function handle(Request $request): Response {
|
||||||
$automationId = intval($request->getParam('id'));
|
/** @var int $automationId */
|
||||||
|
$automationId = $request->getParam('id');
|
||||||
|
$automationId = intval($automationId);
|
||||||
$this->deleteController->deleteAutomation($automationId);
|
$this->deleteController->deleteAutomation($automationId);
|
||||||
return new Response(null);
|
return new Response(null);
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,9 @@ class AutomationsDuplicateEndpoint extends Endpoint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function handle(Request $request): Response {
|
public function handle(Request $request): Response {
|
||||||
$automationId = intval($request->getParam('id'));
|
/** @var int $automationId */
|
||||||
|
$automationId = $request->getParam('id');
|
||||||
|
$automationId = intval($automationId);
|
||||||
$duplicate = $this->duplicateController->duplicateAutomation($automationId);
|
$duplicate = $this->duplicateController->duplicateAutomation($automationId);
|
||||||
return new Response($this->automationMapper->buildAutomation($duplicate));
|
return new Response($this->automationMapper->buildAutomation($duplicate));
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,9 @@ class AutomationsPutEndpoint extends Endpoint {
|
|||||||
|
|
||||||
public function handle(Request $request): Response {
|
public function handle(Request $request): Response {
|
||||||
$data = $request->getParams();
|
$data = $request->getParams();
|
||||||
$automation = $this->updateController->updateAutomation(intval($request->getParam('id')), $data);
|
/** @var int $automationId */
|
||||||
|
$automationId = $request->getParam('id');
|
||||||
|
$automation = $this->updateController->updateAutomation(intval($automationId), $data);
|
||||||
return new Response($this->automationMapper->buildAutomation($automation));
|
return new Response($this->automationMapper->buildAutomation($automation));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ class AutomationRunLogStorage {
|
|||||||
if ($versionId !== null) {
|
if ($versionId !== null) {
|
||||||
$whereCondition .= ' AND run.version_id = %d';
|
$whereCondition .= ' AND run.version_id = %d';
|
||||||
}
|
}
|
||||||
|
/** @var literal-string $sql */
|
||||||
$sql = "SELECT count(log.id) as `count`, log.step_id FROM $logTable AS log
|
$sql = "SELECT count(log.id) as `count`, log.step_id FROM $logTable AS log
|
||||||
JOIN $runTable AS run ON log.automation_run_id = run.id
|
JOIN $runTable AS run ON log.automation_run_id = run.id
|
||||||
WHERE $whereCondition
|
WHERE $whereCondition
|
||||||
@ -60,7 +61,9 @@ class AutomationRunLogStorage {
|
|||||||
|
|
||||||
public function getAutomationRunLog(int $id): ?AutomationRunLog {
|
public function getAutomationRunLog(int $id): ?AutomationRunLog {
|
||||||
$table = esc_sql($this->table);
|
$table = esc_sql($this->table);
|
||||||
$query = $this->wpdb->prepare("SELECT * FROM $table WHERE id = %d", $id);
|
/** @var literal-string $sql */
|
||||||
|
$sql = "SELECT * FROM $table WHERE id = %d";
|
||||||
|
$query = $this->wpdb->prepare($sql, $id);
|
||||||
|
|
||||||
if (!is_string($query)) {
|
if (!is_string($query)) {
|
||||||
throw InvalidStateException::create();
|
throw InvalidStateException::create();
|
||||||
@ -77,7 +80,9 @@ class AutomationRunLogStorage {
|
|||||||
|
|
||||||
public function getAutomationRunLogByRunAndStepId(int $runId, string $stepId): ?AutomationRunLog {
|
public function getAutomationRunLogByRunAndStepId(int $runId, string $stepId): ?AutomationRunLog {
|
||||||
$table = esc_sql($this->table);
|
$table = esc_sql($this->table);
|
||||||
$query = $this->wpdb->prepare("SELECT * FROM $table WHERE automation_run_id = %d AND step_id = %s", $runId, $stepId);
|
/** @var literal-string $sql */
|
||||||
|
$sql = "SELECT * FROM $table WHERE automation_run_id = %d AND step_id = %s";
|
||||||
|
$query = $this->wpdb->prepare($sql, $runId, $stepId);
|
||||||
if (!is_string($query)) {
|
if (!is_string($query)) {
|
||||||
throw InvalidStateException::create();
|
throw InvalidStateException::create();
|
||||||
}
|
}
|
||||||
@ -92,12 +97,14 @@ class AutomationRunLogStorage {
|
|||||||
*/
|
*/
|
||||||
public function getLogsForAutomationRun(int $automationRunId): array {
|
public function getLogsForAutomationRun(int $automationRunId): array {
|
||||||
$table = esc_sql($this->table);
|
$table = esc_sql($this->table);
|
||||||
$query = $this->wpdb->prepare("
|
/** @var literal-string $sql */
|
||||||
|
$sql = "
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM $table
|
FROM $table
|
||||||
WHERE automation_run_id = %d
|
WHERE automation_run_id = %d
|
||||||
ORDER BY id ASC
|
ORDER BY id ASC
|
||||||
", $automationRunId);
|
";
|
||||||
|
$query = $this->wpdb->prepare($sql, $automationRunId);
|
||||||
|
|
||||||
if (!is_string($query)) {
|
if (!is_string($query)) {
|
||||||
throw InvalidStateException::create();
|
throw InvalidStateException::create();
|
||||||
@ -111,6 +118,7 @@ class AutomationRunLogStorage {
|
|||||||
|
|
||||||
if ($results) {
|
if ($results) {
|
||||||
return array_map(function($data) {
|
return array_map(function($data) {
|
||||||
|
/** @var array $data - for PHPStan because it conflicts with expected callable(mixed): mixed)|null */
|
||||||
return AutomationRunLog::fromArray($data);
|
return AutomationRunLog::fromArray($data);
|
||||||
}, $results);
|
}, $results);
|
||||||
}
|
}
|
||||||
|
@ -57,12 +57,16 @@ class AutomationRunStorage {
|
|||||||
public function getAutomationRun(int $id): ?AutomationRun {
|
public function getAutomationRun(int $id): ?AutomationRun {
|
||||||
$table = esc_sql($this->table);
|
$table = esc_sql($this->table);
|
||||||
$subjectTable = esc_sql($this->subjectTable);
|
$subjectTable = esc_sql($this->subjectTable);
|
||||||
$query = (string)$this->wpdb->prepare("SELECT * FROM $table WHERE id = %d", $id);
|
/** @var literal-string $sql */
|
||||||
|
$sql = "SELECT * FROM $table WHERE id = %d";
|
||||||
|
$query = (string)$this->wpdb->prepare($sql, $id);
|
||||||
$data = $this->wpdb->get_row($query, ARRAY_A);
|
$data = $this->wpdb->get_row($query, ARRAY_A);
|
||||||
if (!is_array($data) || !$data) {
|
if (!is_array($data) || !$data) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
$query = (string)$this->wpdb->prepare("SELECT * FROM $subjectTable WHERE automation_run_id = %d", $id);
|
/** @var literal-string $sql */
|
||||||
|
$sql = "SELECT * FROM $subjectTable WHERE automation_run_id = %d";
|
||||||
|
$query = (string)$this->wpdb->prepare($sql, $id);
|
||||||
$subjects = $this->wpdb->get_results($query, ARRAY_A);
|
$subjects = $this->wpdb->get_results($query, ARRAY_A);
|
||||||
$data['subjects'] = is_array($subjects) ? $subjects : [];
|
$data['subjects'] = is_array($subjects) ? $subjects : [];
|
||||||
return AutomationRun::fromArray((array)$data);
|
return AutomationRun::fromArray((array)$data);
|
||||||
@ -75,7 +79,9 @@ class AutomationRunStorage {
|
|||||||
public function getAutomationRunsForAutomation(Automation $automation): array {
|
public function getAutomationRunsForAutomation(Automation $automation): array {
|
||||||
$table = esc_sql($this->table);
|
$table = esc_sql($this->table);
|
||||||
$subjectTable = esc_sql($this->subjectTable);
|
$subjectTable = esc_sql($this->subjectTable);
|
||||||
$query = (string)$this->wpdb->prepare("SELECT * FROM $table WHERE automation_id = %d order by id", $automation->getId());
|
/** @var literal-string $sql */
|
||||||
|
$sql = "SELECT * FROM $table WHERE automation_id = %d order by id";
|
||||||
|
$query = (string)$this->wpdb->prepare($sql, $automation->getId());
|
||||||
$automationRuns = $this->wpdb->get_results($query, ARRAY_A);
|
$automationRuns = $this->wpdb->get_results($query, ARRAY_A);
|
||||||
if (!is_array($automationRuns) || !$automationRuns) {
|
if (!is_array($automationRuns) || !$automationRuns) {
|
||||||
return [];
|
return [];
|
||||||
@ -83,6 +89,7 @@ class AutomationRunStorage {
|
|||||||
|
|
||||||
$automationRunIds = array_column($automationRuns, 'id');
|
$automationRunIds = array_column($automationRuns, 'id');
|
||||||
|
|
||||||
|
/** @var literal-string $sql */
|
||||||
$sql = sprintf(
|
$sql = sprintf(
|
||||||
"SELECT * FROM $subjectTable WHERE automation_run_id in (%s) order by automation_run_id, id",
|
"SELECT * FROM $subjectTable WHERE automation_run_id in (%s) order by automation_run_id, id",
|
||||||
implode(
|
implode(
|
||||||
@ -100,10 +107,12 @@ class AutomationRunStorage {
|
|||||||
$subjects = $this->wpdb->get_results($query, ARRAY_A);
|
$subjects = $this->wpdb->get_results($query, ARRAY_A);
|
||||||
|
|
||||||
return array_map(
|
return array_map(
|
||||||
function(array $runData) use ($subjects): AutomationRun {
|
function($runData) use ($subjects): AutomationRun {
|
||||||
|
/** @var array $runData - PHPStan expects as array_map first parameter (callable(mixed): mixed)|null */
|
||||||
$runData['subjects'] = array_values(array_filter(
|
$runData['subjects'] = array_values(array_filter(
|
||||||
is_array($subjects) ? $subjects : [],
|
is_array($subjects) ? $subjects : [],
|
||||||
function(array $subjectData) use ($runData): bool {
|
function($subjectData) use ($runData): bool {
|
||||||
|
/** @var array $subjectData - PHPStan expects as array_map first parameter (callable(mixed): mixed)|null */
|
||||||
return (int)$subjectData['automation_run_id'] === (int)$runData['id'];
|
return (int)$subjectData['automation_run_id'] === (int)$runData['id'];
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
@ -120,7 +129,7 @@ class AutomationRunStorage {
|
|||||||
public function getCountByAutomationAndSubject(Automation $automation, Subject $subject): int {
|
public function getCountByAutomationAndSubject(Automation $automation, Subject $subject): int {
|
||||||
$table = esc_sql($this->table);
|
$table = esc_sql($this->table);
|
||||||
$subjectTable = esc_sql($this->subjectTable);
|
$subjectTable = esc_sql($this->subjectTable);
|
||||||
|
/** @var literal-string $sql */
|
||||||
$sql = "SELECT count(DISTINCT runs.id) as count from $table as runs
|
$sql = "SELECT count(DISTINCT runs.id) as count from $table as runs
|
||||||
JOIN $subjectTable as subjects on runs.id = subjects.automation_run_id
|
JOIN $subjectTable as subjects on runs.id = subjects.automation_run_id
|
||||||
WHERE runs.automation_id = %d
|
WHERE runs.automation_id = %d
|
||||||
@ -137,33 +146,39 @@ class AutomationRunStorage {
|
|||||||
$table = esc_sql($this->table);
|
$table = esc_sql($this->table);
|
||||||
|
|
||||||
if (!count($status)) {
|
if (!count($status)) {
|
||||||
$query = (string)$this->wpdb->prepare("
|
/** @var literal-string $sql */
|
||||||
|
$sql = "
|
||||||
SELECT COUNT(id) as count
|
SELECT COUNT(id) as count
|
||||||
FROM $table
|
FROM $table
|
||||||
WHERE automation_id = %d
|
WHERE automation_id = %d
|
||||||
", $automation->getId());
|
";
|
||||||
|
$query = (string)$this->wpdb->prepare($sql, $automation->getId());
|
||||||
$result = $this->wpdb->get_col($query);
|
$result = $this->wpdb->get_col($query);
|
||||||
return $result ? (int)current($result) : 0;
|
return $result ? (int)current($result) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusSql = (string)$this->wpdb->prepare(implode(',', array_fill(0, count($status), '%s')), ...$status);
|
$statusSql = (string)$this->wpdb->prepare(implode(',', array_fill(0, count($status), '%s')), ...$status);
|
||||||
$query = (string)$this->wpdb->prepare("
|
/** @var literal-string $sql */
|
||||||
|
$sql = "
|
||||||
SELECT COUNT(id) as count
|
SELECT COUNT(id) as count
|
||||||
FROM $table
|
FROM $table
|
||||||
WHERE automation_id = %d
|
WHERE automation_id = %d
|
||||||
AND status IN ($statusSql)
|
AND status IN ($statusSql)
|
||||||
", $automation->getId());
|
";
|
||||||
|
$query = (string)$this->wpdb->prepare($sql, $automation->getId());
|
||||||
$result = $this->wpdb->get_col($query);
|
$result = $this->wpdb->get_col($query);
|
||||||
return $result ? (int)current($result) : 0;
|
return $result ? (int)current($result) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateStatus(int $id, string $status): void {
|
public function updateStatus(int $id, string $status): void {
|
||||||
$table = esc_sql($this->table);
|
$table = esc_sql($this->table);
|
||||||
$query = (string)$this->wpdb->prepare("
|
/** @var literal-string $sql */
|
||||||
|
$sql = "
|
||||||
UPDATE $table
|
UPDATE $table
|
||||||
SET status = %s, updated_at = current_timestamp()
|
SET status = %s, updated_at = current_timestamp()
|
||||||
WHERE id = %d
|
WHERE id = %d
|
||||||
", $status, $id);
|
";
|
||||||
|
$query = (string)$this->wpdb->prepare($sql, $status, $id);
|
||||||
$result = $this->wpdb->query($query);
|
$result = $this->wpdb->query($query);
|
||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
throw Exceptions::databaseError($this->wpdb->last_error);
|
throw Exceptions::databaseError($this->wpdb->last_error);
|
||||||
@ -172,11 +187,13 @@ class AutomationRunStorage {
|
|||||||
|
|
||||||
public function updateNextStep(int $id, ?string $nextStepId): void {
|
public function updateNextStep(int $id, ?string $nextStepId): void {
|
||||||
$table = esc_sql($this->table);
|
$table = esc_sql($this->table);
|
||||||
$query = (string)$this->wpdb->prepare("
|
/** @var literal-string $sql */
|
||||||
|
$sql = "
|
||||||
UPDATE $table
|
UPDATE $table
|
||||||
SET next_step_id = %s, updated_at = current_timestamp()
|
SET next_step_id = %s, updated_at = current_timestamp()
|
||||||
WHERE id = %d
|
WHERE id = %d
|
||||||
", $nextStepId, $id);
|
";
|
||||||
|
$query = (string)$this->wpdb->prepare($sql, $nextStepId, $id);
|
||||||
$result = $this->wpdb->query($query);
|
$result = $this->wpdb->query($query);
|
||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
throw Exceptions::databaseError($this->wpdb->last_error);
|
throw Exceptions::databaseError($this->wpdb->last_error);
|
||||||
@ -192,6 +209,7 @@ class AutomationRunStorage {
|
|||||||
if ($versionId) {
|
if ($versionId) {
|
||||||
$where .= " AND version_id = %d";
|
$where .= " AND version_id = %d";
|
||||||
}
|
}
|
||||||
|
/** @var literal-string $sql */
|
||||||
$sql = "
|
$sql = "
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(id) AS `count`,
|
COUNT(id) AS `count`,
|
||||||
|
@ -73,16 +73,24 @@ class AutomationStatisticsStorage {
|
|||||||
LEFT JOIN ($runningSubquery) r ON t.id = r.id
|
LEFT JOIN ($runningSubquery) r ON t.id = r.id
|
||||||
", ARRAY_A);
|
", ARRAY_A);
|
||||||
|
|
||||||
|
/** @var array{id: int, total: int, running: int} $results */
|
||||||
return array_combine(array_column($results, 'id'), $results) ?: [];
|
return array_combine(array_column($results, 'id'), $results) ?: [];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getStatsQuery(array $automationIds, int $versionId = null, \DateTimeImmutable $after = null, \DateTimeImmutable $before = null, string $status = null): string {
|
private function getStatsQuery(array $automationIds, int $versionId = null, \DateTimeImmutable $after = null, \DateTimeImmutable $before = null, string $status = null): string {
|
||||||
$table = esc_sql($this->table);
|
$table = esc_sql($this->table);
|
||||||
$placeholders = implode(',', array_fill(0, count($automationIds), '%d'));
|
$placeholders = implode(',', array_fill(0, count($automationIds), '%d'));
|
||||||
$versionCondition = strval($versionId ? $this->wpdb->prepare('AND version_id = %d', $versionId) : '');
|
/** @var string $versionCondition */
|
||||||
$statusCondition = strval($status ? $this->wpdb->prepare('AND status = %s', $status) : '');
|
$versionCondition = $versionId ? $this->wpdb->prepare('AND version_id = %d', $versionId) : '';
|
||||||
$dateCondition = $after !== null && $before !== null ? strval($this->wpdb->prepare('AND created_at BETWEEN %s AND %s', $after->format('Y-m-d H:i:s'), $before->format('Y-m-d H:i:s'))) : '';
|
$versionCondition = strval($versionCondition);
|
||||||
$query = $this->wpdb->prepare("
|
/** @var string $statusCondition */
|
||||||
|
$statusCondition = $status ? $this->wpdb->prepare('AND status = %s', $status) : '';
|
||||||
|
$statusCondition = strval($statusCondition);
|
||||||
|
/** @var string $dateCondition */
|
||||||
|
$dateCondition = $after !== null && $before !== null ? $this->wpdb->prepare('AND created_at BETWEEN %s AND %s', $after->format('Y-m-d H:i:s'), $before->format('Y-m-d H:i:s')) : '';
|
||||||
|
$dateCondition = strval($dateCondition);
|
||||||
|
/** @var literal-string $sql */
|
||||||
|
$sql = "
|
||||||
SELECT automation_id AS id, COUNT(*) AS count
|
SELECT automation_id AS id, COUNT(*) AS count
|
||||||
FROM $table
|
FROM $table
|
||||||
WHERE automation_id IN ($placeholders)
|
WHERE automation_id IN ($placeholders)
|
||||||
@ -90,7 +98,9 @@ class AutomationStatisticsStorage {
|
|||||||
$statusCondition
|
$statusCondition
|
||||||
$dateCondition
|
$dateCondition
|
||||||
GROUP BY automation_id
|
GROUP BY automation_id
|
||||||
", $automationIds);
|
";
|
||||||
|
/** @var string $query */
|
||||||
|
$query = $this->wpdb->prepare($sql, $automationIds);
|
||||||
return strval($query);
|
return strval($query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,18 +75,18 @@ class AutomationStorage {
|
|||||||
*/
|
*/
|
||||||
public function getAutomationVersionDates(int $automationId): array {
|
public function getAutomationVersionDates(int $automationId): array {
|
||||||
$versionsTable = esc_sql($this->versionsTable);
|
$versionsTable = esc_sql($this->versionsTable);
|
||||||
$query = (string)$this->wpdb->prepare(
|
/** @var literal-string $sql */
|
||||||
"
|
$sql = "
|
||||||
SELECT id, created_at
|
SELECT id, created_at
|
||||||
FROM $versionsTable
|
FROM $versionsTable
|
||||||
WHERE automation_id = %d
|
WHERE automation_id = %d
|
||||||
ORDER BY id DESC
|
ORDER BY id DESC
|
||||||
",
|
";
|
||||||
$automationId
|
$query = (string)$this->wpdb->prepare($sql, $automationId);
|
||||||
);
|
|
||||||
$data = $this->wpdb->get_results($query, ARRAY_A);
|
$data = $this->wpdb->get_results($query, ARRAY_A);
|
||||||
return is_array($data) ? array_map(
|
return is_array($data) ? array_map(
|
||||||
function($row): array {
|
function($row): array {
|
||||||
|
/** @var array{id: string, created_at: string} $row */
|
||||||
return [
|
return [
|
||||||
'id' => absint($row['id']),
|
'id' => absint($row['id']),
|
||||||
'created_at' => new \DateTimeImmutable($row['created_at']),
|
'created_at' => new \DateTimeImmutable($row['created_at']),
|
||||||
@ -107,15 +107,14 @@ class AutomationStorage {
|
|||||||
}
|
}
|
||||||
$automationsTable = esc_sql($this->automationsTable);
|
$automationsTable = esc_sql($this->automationsTable);
|
||||||
$versionsTable = esc_sql($this->versionsTable);
|
$versionsTable = esc_sql($this->versionsTable);
|
||||||
$query = (string)$this->wpdb->prepare(
|
/** @var literal-string $sql */
|
||||||
"
|
$sql = "
|
||||||
SELECT a.*, v.id AS version_id, v.steps
|
SELECT a.*, v.id AS version_id, v.steps
|
||||||
FROM $automationsTable as a, $versionsTable as v
|
FROM $automationsTable as a, $versionsTable as v
|
||||||
WHERE v.automation_id = a.id AND v.id IN (" . implode(',', array_fill(0, count($versionIds), '%d')) . ")
|
WHERE v.automation_id = a.id AND v.id IN (" . implode(',', array_fill(0, count($versionIds), '%d')) . ")
|
||||||
ORDER BY v.id DESC
|
ORDER BY v.id DESC
|
||||||
",
|
";
|
||||||
...$versionIds
|
$query = (string)$this->wpdb->prepare($sql, ...$versionIds);
|
||||||
);
|
|
||||||
$data = $this->wpdb->get_results($query, ARRAY_A);
|
$data = $this->wpdb->get_results($query, ARRAY_A);
|
||||||
return is_array($data) ? array_map(
|
return is_array($data) ? array_map(
|
||||||
function($row): Automation {
|
function($row): Automation {
|
||||||
@ -133,17 +132,15 @@ class AutomationStorage {
|
|||||||
$automations = $this->getAutomationWithDifferentVersions([$versionId]);
|
$automations = $this->getAutomationWithDifferentVersions([$versionId]);
|
||||||
return $automations ? $automations[0] : null;
|
return $automations ? $automations[0] : null;
|
||||||
}
|
}
|
||||||
|
/** @var literal-string $sql */
|
||||||
$query = (string)$this->wpdb->prepare(
|
$sql = "
|
||||||
"
|
|
||||||
SELECT a.*, v.id AS version_id, v.steps
|
SELECT a.*, v.id AS version_id, v.steps
|
||||||
FROM $automationsTable as a, $versionsTable as v
|
FROM $automationsTable as a, $versionsTable as v
|
||||||
WHERE v.automation_id = a.id AND a.id = %d
|
WHERE v.automation_id = a.id AND a.id = %d
|
||||||
ORDER BY v.id DESC
|
ORDER BY v.id DESC
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
",
|
";
|
||||||
$automationId
|
$query = (string)$this->wpdb->prepare($sql, $automationId);
|
||||||
);
|
|
||||||
$data = $this->wpdb->get_row($query, ARRAY_A);
|
$data = $this->wpdb->get_row($query, ARRAY_A);
|
||||||
return $data ? Automation::fromArray((array)$data) : null;
|
return $data ? Automation::fromArray((array)$data) : null;
|
||||||
}
|
}
|
||||||
@ -154,6 +151,7 @@ class AutomationStorage {
|
|||||||
$versionsTable = esc_sql($this->versionsTable);
|
$versionsTable = esc_sql($this->versionsTable);
|
||||||
|
|
||||||
$statusFilter = $status ? 'AND a.status IN(' . implode(',', array_fill(0, count($status), '%s')) . ')' : '';
|
$statusFilter = $status ? 'AND a.status IN(' . implode(',', array_fill(0, count($status), '%s')) . ')' : '';
|
||||||
|
/** @var literal-string $sql */
|
||||||
$sql = "
|
$sql = "
|
||||||
SELECT a.*, v.id AS version_id, v.steps
|
SELECT a.*, v.id AS version_id, v.steps
|
||||||
FROM $automationsTable AS a
|
FROM $automationsTable AS a
|
||||||
@ -167,7 +165,8 @@ class AutomationStorage {
|
|||||||
|
|
||||||
$query = $status ? (string)$this->wpdb->prepare($sql, ...$status) : $sql;
|
$query = $status ? (string)$this->wpdb->prepare($sql, ...$status) : $sql;
|
||||||
$data = $this->wpdb->get_results($query, ARRAY_A);
|
$data = $this->wpdb->get_results($query, ARRAY_A);
|
||||||
return array_map(function (array $automationData) {
|
return array_map(function ($automationData) {
|
||||||
|
/** @var array $automationData - for PHPStan because it conflicts with expected callable(mixed): mixed)|null */
|
||||||
return Automation::fromArray($automationData);
|
return Automation::fromArray($automationData);
|
||||||
}, (array)$data);
|
}, (array)$data);
|
||||||
}
|
}
|
||||||
@ -180,7 +179,8 @@ class AutomationStorage {
|
|||||||
$subjectTable = esc_sql($this->subjectsTable);
|
$subjectTable = esc_sql($this->subjectsTable);
|
||||||
|
|
||||||
$statusFilter = $runStatus ? 'AND r.status IN(' . implode(',', array_fill(0, count($runStatus), '%s')) . ')' : '';
|
$statusFilter = $runStatus ? 'AND r.status IN(' . implode(',', array_fill(0, count($runStatus), '%s')) . ')' : '';
|
||||||
$query = (string)$this->wpdb->prepare("
|
/** @var literal-string $sql */
|
||||||
|
$sql = "
|
||||||
SELECT DISTINCT a.*, v.id AS version_id, v.steps
|
SELECT DISTINCT a.*, v.id AS version_id, v.steps
|
||||||
FROM $automationsTable a
|
FROM $automationsTable a
|
||||||
INNER JOIN $versionsTable v ON v.automation_id = a.id
|
INNER JOIN $versionsTable v ON v.automation_id = a.id
|
||||||
@ -192,10 +192,12 @@ class AutomationStorage {
|
|||||||
AND s.hash = %s
|
AND s.hash = %s
|
||||||
$statusFilter
|
$statusFilter
|
||||||
ORDER BY a.id DESC
|
ORDER BY a.id DESC
|
||||||
", ...array_merge([$subject->getHash()], $runStatus ?? []));
|
";
|
||||||
|
$query = (string)$this->wpdb->prepare($sql, ...array_merge([$subject->getHash()], $runStatus ?? []));
|
||||||
|
|
||||||
$data = $this->wpdb->get_results($query, ARRAY_A);
|
$data = $this->wpdb->get_results($query, ARRAY_A);
|
||||||
return array_map(function (array $automationData) {
|
return array_map(function ($automationData) {
|
||||||
|
/** @var array $automationData - for PHPStan because it conflicts with expected callable(mixed): mixed)|null */
|
||||||
return Automation::fromArray($automationData);
|
return Automation::fromArray($automationData);
|
||||||
}, (array)$data);
|
}, (array)$data);
|
||||||
}
|
}
|
||||||
@ -210,16 +212,15 @@ class AutomationStorage {
|
|||||||
$automationsTable = esc_sql($this->automationsTable);
|
$automationsTable = esc_sql($this->automationsTable);
|
||||||
$triggersTable = esc_sql($this->triggersTable);
|
$triggersTable = esc_sql($this->triggersTable);
|
||||||
|
|
||||||
$query = (string)$this->wpdb->prepare(
|
/** @var literal-string $sql */
|
||||||
"
|
$sql = "
|
||||||
SELECT DISTINCT t.trigger_key
|
SELECT DISTINCT t.trigger_key
|
||||||
FROM {$automationsTable} AS a
|
FROM {$automationsTable} AS a
|
||||||
JOIN $triggersTable as t
|
JOIN $triggersTable as t
|
||||||
WHERE a.status = %s AND a.id = t.automation_id
|
WHERE a.status = %s AND a.id = t.automation_id
|
||||||
ORDER BY trigger_key DESC
|
ORDER BY trigger_key DESC
|
||||||
",
|
";
|
||||||
Automation::STATUS_ACTIVE
|
$query = (string)$this->wpdb->prepare($sql, Automation::STATUS_ACTIVE);
|
||||||
);
|
|
||||||
return $this->wpdb->get_col($query);
|
return $this->wpdb->get_col($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,8 +235,8 @@ class AutomationStorage {
|
|||||||
$versionsTable = esc_sql($this->versionsTable);
|
$versionsTable = esc_sql($this->versionsTable);
|
||||||
$triggersTable = esc_sql($this->triggersTable);
|
$triggersTable = esc_sql($this->triggersTable);
|
||||||
|
|
||||||
$query = (string)$this->wpdb->prepare(
|
/** @var literal-string $sql */
|
||||||
"
|
$sql = "
|
||||||
SELECT a.*, v.id AS version_id, v.steps
|
SELECT a.*, v.id AS version_id, v.steps
|
||||||
FROM $automationsTable AS a
|
FROM $automationsTable AS a
|
||||||
INNER JOIN $triggersTable as t ON (t.automation_id = a.id)
|
INNER JOIN $triggersTable as t ON (t.automation_id = a.id)
|
||||||
@ -245,13 +246,12 @@ class AutomationStorage {
|
|||||||
AND v.id = (
|
AND v.id = (
|
||||||
SELECT MAX(id) FROM $versionsTable WHERE automation_id = v.automation_id
|
SELECT MAX(id) FROM $versionsTable WHERE automation_id = v.automation_id
|
||||||
)
|
)
|
||||||
",
|
";
|
||||||
Automation::STATUS_ACTIVE,
|
$query = (string)$this->wpdb->prepare($sql, Automation::STATUS_ACTIVE, $triggerKey);
|
||||||
$triggerKey
|
|
||||||
);
|
|
||||||
|
|
||||||
$data = $this->wpdb->get_results($query, ARRAY_A);
|
$data = $this->wpdb->get_results($query, ARRAY_A);
|
||||||
return array_map(function (array $automationData) {
|
return array_map(function ($automationData) {
|
||||||
|
/** @var array $automationData - for PHPStan because it conflicts with expected callable(mixed): mixed)|null */
|
||||||
return Automation::fromArray($automationData);
|
return Automation::fromArray($automationData);
|
||||||
}, (array)$data);
|
}, (array)$data);
|
||||||
}
|
}
|
||||||
@ -270,17 +270,16 @@ class AutomationStorage {
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
// Using the phpcs:ignore because the query arguments count is dynamic and passed via an array but the code sniffer sees only one argument
|
// Using the phpcs:ignore because the query arguments count is dynamic and passed via an array but the code sniffer sees only one argument
|
||||||
$query = (string)$this->wpdb->prepare( // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber
|
/** @var literal-string $sql */
|
||||||
"
|
$sql = "
|
||||||
SELECT count(*)
|
SELECT count(*)
|
||||||
FROM $automationsTable AS a
|
FROM $automationsTable AS a
|
||||||
INNER JOIN $triggersTable as t ON (t.automation_id = a.id) AND t.trigger_key IN ({$triggerKeysPlaceholders})
|
INNER JOIN $triggersTable as t ON (t.automation_id = a.id) AND t.trigger_key IN ({$triggerKeysPlaceholders})
|
||||||
INNER JOIN $versionsTable as v ON v.id = (SELECT MAX(id) FROM $versionsTable WHERE automation_id = a.id)
|
INNER JOIN $versionsTable as v ON v.id = (SELECT MAX(id) FROM $versionsTable WHERE automation_id = a.id)
|
||||||
WHERE a.status = %s
|
WHERE a.status = %s
|
||||||
AND v.steps LIKE %s
|
AND v.steps LIKE %s
|
||||||
",
|
";
|
||||||
$queryArgs
|
$query = (string)$this->wpdb->prepare($sql, $queryArgs);
|
||||||
);
|
|
||||||
|
|
||||||
return (int)$this->wpdb->get_var($query);
|
return (int)$this->wpdb->get_var($query);
|
||||||
}
|
}
|
||||||
@ -289,17 +288,16 @@ class AutomationStorage {
|
|||||||
$automationRunsTable = esc_sql($this->runsTable);
|
$automationRunsTable = esc_sql($this->runsTable);
|
||||||
$automationRunLogsTable = esc_sql($this->wpdb->prefix . 'mailpoet_automation_run_logs');
|
$automationRunLogsTable = esc_sql($this->wpdb->prefix . 'mailpoet_automation_run_logs');
|
||||||
$automationId = $automation->getId();
|
$automationId = $automation->getId();
|
||||||
$runLogsQuery = (string)$this->wpdb->prepare(
|
/** @var literal-string $sql */
|
||||||
"
|
$sql = "
|
||||||
DELETE FROM $automationRunLogsTable
|
DELETE FROM $automationRunLogsTable
|
||||||
WHERE automation_run_id IN (
|
WHERE automation_run_id IN (
|
||||||
SELECT id
|
SELECT id
|
||||||
FROM $automationRunsTable
|
FROM $automationRunsTable
|
||||||
WHERE automation_id = %d
|
WHERE automation_id = %d
|
||||||
)
|
)
|
||||||
",
|
";
|
||||||
$automationId
|
$runLogsQuery = (string)$this->wpdb->prepare($sql, $automationId);
|
||||||
);
|
|
||||||
|
|
||||||
$logsDeleted = $this->wpdb->query($runLogsQuery);
|
$logsDeleted = $this->wpdb->query($runLogsQuery);
|
||||||
if ($logsDeleted === false) {
|
if ($logsDeleted === false) {
|
||||||
@ -387,8 +385,10 @@ class AutomationStorage {
|
|||||||
// insert/update
|
// insert/update
|
||||||
if ($triggerKeys) {
|
if ($triggerKeys) {
|
||||||
$placeholders = implode(',', array_fill(0, count($triggerKeys), '(%d, %s)'));
|
$placeholders = implode(',', array_fill(0, count($triggerKeys), '(%d, %s)'));
|
||||||
|
/** @var literal-string $sql */
|
||||||
|
$sql = "INSERT IGNORE INTO {$triggersTable} (automation_id, trigger_key) VALUES {$placeholders}";
|
||||||
$query = (string)$this->wpdb->prepare(
|
$query = (string)$this->wpdb->prepare(
|
||||||
"INSERT IGNORE INTO {$triggersTable} (automation_id, trigger_key) VALUES {$placeholders}",
|
$sql,
|
||||||
array_merge(
|
array_merge(
|
||||||
...array_map(function (string $key) use ($automationId) {
|
...array_map(function (string $key) use ($automationId) {
|
||||||
return [$automationId, $key];
|
return [$automationId, $key];
|
||||||
@ -404,12 +404,15 @@ class AutomationStorage {
|
|||||||
|
|
||||||
// delete
|
// delete
|
||||||
$placeholders = implode(',', array_fill(0, count($triggerKeys), '%s'));
|
$placeholders = implode(',', array_fill(0, count($triggerKeys), '%s'));
|
||||||
$query = $triggerKeys
|
if ($triggerKeys) {
|
||||||
? (string)$this->wpdb->prepare(
|
/** @var literal-string $sql */
|
||||||
"DELETE FROM {$triggersTable} WHERE automation_id = %d AND trigger_key NOT IN ({$placeholders})",
|
$sql = "DELETE FROM {$triggersTable} WHERE automation_id = %d AND trigger_key NOT IN ({$placeholders})";
|
||||||
array_merge([$automationId], $triggerKeys)
|
$query = (string)$this->wpdb->prepare($sql, array_merge([$automationId], $triggerKeys));
|
||||||
)
|
} else {
|
||||||
: (string)$this->wpdb->prepare("DELETE FROM {$triggersTable} WHERE automation_id = %d", $automationId);
|
/** @var literal-string $sql */
|
||||||
|
$sql = "DELETE FROM {$triggersTable} WHERE automation_id = %d";
|
||||||
|
$query = (string)$this->wpdb->prepare($sql, $automationId);
|
||||||
|
}
|
||||||
|
|
||||||
$result = $this->wpdb->query($query);
|
$result = $this->wpdb->query($query);
|
||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
|
@ -57,6 +57,7 @@ class ValidStepRule implements AutomationNodeVisitor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$key = $rule instanceof ValidStepFiltersRule ? 'filters' : 'fields';
|
$key = $rule instanceof ValidStepFiltersRule ? 'filters' : 'fields';
|
||||||
|
/** @phpstan-ignore-next-line - PHPStan detects inconsistency in merged array */
|
||||||
$this->errors[$stepId][$key] = array_merge(
|
$this->errors[$stepId][$key] = array_merge(
|
||||||
$this->mapErrorCodesToErrorMessages($e->getErrors()),
|
$this->mapErrorCodesToErrorMessages($e->getErrors()),
|
||||||
$this->errors[$stepId][$key]
|
$this->errors[$stepId][$key]
|
||||||
|
@ -62,6 +62,7 @@ class WordPress {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param 'ARRAY_A'|'ARRAY_N'|'OBJECT' $object
|
||||||
* @return array|WP_Post|null
|
* @return array|WP_Post|null
|
||||||
*/
|
*/
|
||||||
public function getPost(int $id, string $object = OBJECT) {
|
public function getPost(int $id, string $object = OBJECT) {
|
||||||
@ -90,6 +91,7 @@ class WordPress {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param 'ARRAY_A'|'ARRAY_N'|'OBJECT' $output
|
||||||
* @return WP_Comment|array|null
|
* @return WP_Comment|array|null
|
||||||
*/
|
*/
|
||||||
public function getComment(int $id, string $output = OBJECT) {
|
public function getComment(int $id, string $output = OBJECT) {
|
||||||
@ -161,9 +163,10 @@ class WordPress {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param 'and'|'or' $operator
|
||||||
* @return string[]|\WP_Taxonomy[]
|
* @return string[]|\WP_Taxonomy[]
|
||||||
*/
|
*/
|
||||||
public function getTaxonomies(array $args = [], string $output = 'names', string $operator = 'AND'): array {
|
public function getTaxonomies(array $args = [], string $output = 'names', string $operator = 'and'): array {
|
||||||
return get_taxonomies($args, $output, $operator);
|
return get_taxonomies($args, $output, $operator);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,7 +180,7 @@ class WordPress {
|
|||||||
/**
|
/**
|
||||||
* @param int|WP_Term|object $term
|
* @param int|WP_Term|object $term
|
||||||
* @param string $taxonomy
|
* @param string $taxonomy
|
||||||
* @param string $output
|
* @param 'ARRAY_A'|'ARRAY_N'|'OBJECT' $output
|
||||||
* @param string $filter
|
* @param string $filter
|
||||||
* @return WP_Term|array|WP_Error|null
|
* @return WP_Term|array|WP_Error|null
|
||||||
*/
|
*/
|
||||||
|
@ -54,6 +54,9 @@ class NumberFilter implements Filter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param float $value
|
||||||
|
*/
|
||||||
public function matches(FilterData $data, $value): bool {
|
public function matches(FilterData $data, $value): bool {
|
||||||
$filterValue = $data->getArgs()['value'] ?? null;
|
$filterValue = $data->getArgs()['value'] ?? null;
|
||||||
$condition = $data->getCondition();
|
$condition = $data->getCondition();
|
||||||
@ -94,7 +97,7 @@ class NumberFilter implements Filter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $value
|
* @param float|null $value
|
||||||
* @param mixed $filterValue
|
* @param mixed $filterValue
|
||||||
*/
|
*/
|
||||||
private function matchesBetween(string $condition, $value, $filterValue): bool {
|
private function matchesBetween(string $condition, $value, $filterValue): bool {
|
||||||
@ -110,6 +113,7 @@ class NumberFilter implements Filter {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @var float $value */
|
||||||
$value = floatval($value);
|
$value = floatval($value);
|
||||||
$from = floatval($filterValue[0]);
|
$from = floatval($filterValue[0]);
|
||||||
$to = floatval($filterValue[1]);
|
$to = floatval($filterValue[1]);
|
||||||
|
@ -141,8 +141,8 @@ class SubscriberCustomFieldsFactory {
|
|||||||
|
|
||||||
private function getCustomFieldValue(SubscriberPayload $payload, CustomFieldEntity $customField): ?string {
|
private function getCustomFieldValue(SubscriberPayload $payload, CustomFieldEntity $customField): ?string {
|
||||||
$subscriberCustomField = $payload->getSubscriber()->getSubscriberCustomFields()->filter(
|
$subscriberCustomField = $payload->getSubscriber()->getSubscriberCustomFields()->filter(
|
||||||
function (SubscriberCustomFieldEntity $subscriberCustomField) use ($customField) {
|
function (SubscriberCustomFieldEntity $subscriberCustomField = null) use ($customField) {
|
||||||
return $subscriberCustomField->getCustomField() === $customField;
|
return $subscriberCustomField && $subscriberCustomField->getCustomField() === $customField;
|
||||||
}
|
}
|
||||||
)->first() ?: null;
|
)->first() ?: null;
|
||||||
return $subscriberCustomField ? $subscriberCustomField->getValue() : null;
|
return $subscriberCustomField ? $subscriberCustomField->getValue() : null;
|
||||||
|
@ -131,7 +131,8 @@ class CustomerOrderFieldsFactory {
|
|||||||
$statusesPlaceholder = implode(',', array_fill(0, count($statuses), '%s'));
|
$statusesPlaceholder = implode(',', array_fill(0, count($statuses), '%s'));
|
||||||
|
|
||||||
if ($this->wooCommerce->isWooCommerceCustomOrdersTableEnabled()) {
|
if ($this->wooCommerce->isWooCommerceCustomOrdersTableEnabled()) {
|
||||||
$statement = (string)$wpdb->prepare("
|
/** @var literal-string $query */
|
||||||
|
$query = "
|
||||||
SELECT o.date_created_gmt
|
SELECT o.date_created_gmt
|
||||||
FROM {$wpdb->prefix}wc_orders o
|
FROM {$wpdb->prefix}wc_orders o
|
||||||
WHERE o.customer_id = %d
|
WHERE o.customer_id = %d
|
||||||
@ -139,9 +140,11 @@ class CustomerOrderFieldsFactory {
|
|||||||
AND o.total_amount > 0
|
AND o.total_amount > 0
|
||||||
ORDER BY o.date_created_gmt {$sorting}
|
ORDER BY o.date_created_gmt {$sorting}
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
", array_merge([$customer->get_id()], $statuses));
|
";
|
||||||
|
$statement = (string)$wpdb->prepare($query, array_merge([$customer->get_id()], $statuses));
|
||||||
} else {
|
} else {
|
||||||
$statement = (string)$wpdb->prepare("
|
/** @var literal-string $query */
|
||||||
|
$query = "
|
||||||
SELECT p.post_date_gmt
|
SELECT p.post_date_gmt
|
||||||
FROM {$wpdb->prefix}posts p
|
FROM {$wpdb->prefix}posts p
|
||||||
LEFT JOIN {$wpdb->prefix}postmeta pm_total ON p.ID = pm_total.post_id AND pm_total.meta_key = '_order_total'
|
LEFT JOIN {$wpdb->prefix}postmeta pm_total ON p.ID = pm_total.post_id AND pm_total.meta_key = '_order_total'
|
||||||
@ -152,7 +155,8 @@ class CustomerOrderFieldsFactory {
|
|||||||
AND pm_total.meta_value > 0
|
AND pm_total.meta_value > 0
|
||||||
ORDER BY p.post_date_gmt {$sorting}
|
ORDER BY p.post_date_gmt {$sorting}
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
", array_merge($statuses, [$customer->get_id()]));
|
";
|
||||||
|
$statement = (string)$wpdb->prepare($query, array_merge($statuses, [$customer->get_id()]));
|
||||||
}
|
}
|
||||||
|
|
||||||
$date = $wpdb->get_var($statement);
|
$date = $wpdb->get_var($statement);
|
||||||
@ -186,7 +190,8 @@ class CustomerOrderFieldsFactory {
|
|||||||
";
|
";
|
||||||
}
|
}
|
||||||
|
|
||||||
$statement = (string)$wpdb->prepare("
|
/** @var literal-string $query */
|
||||||
|
$query = "
|
||||||
SELECT DISTINCT tt.term_id
|
SELECT DISTINCT tt.term_id
|
||||||
FROM {$wpdb->prefix}term_taxonomy tt
|
FROM {$wpdb->prefix}term_taxonomy tt
|
||||||
JOIN {$wpdb->prefix}woocommerce_order_items AS oi ON oi.order_id IN ($orderIdsSubquery) AND oi.order_item_type = 'line_item'
|
JOIN {$wpdb->prefix}woocommerce_order_items AS oi ON oi.order_id IN ($orderIdsSubquery) AND oi.order_item_type = 'line_item'
|
||||||
@ -195,7 +200,8 @@ class CustomerOrderFieldsFactory {
|
|||||||
JOIN {$wpdb->prefix}term_relationships tr ON IF(p.post_type = 'product_variation', p.post_parent, p.ID) = tr.object_id AND tr.term_taxonomy_id = tt.term_taxonomy_id
|
JOIN {$wpdb->prefix}term_relationships tr ON IF(p.post_type = 'product_variation', p.post_parent, p.ID) = tr.object_id AND tr.term_taxonomy_id = tt.term_taxonomy_id
|
||||||
WHERE tt.taxonomy = %s
|
WHERE tt.taxonomy = %s
|
||||||
ORDER BY tt.term_id ASC
|
ORDER BY tt.term_id ASC
|
||||||
", array_merge($statuses, [$customer->get_id(), $taxonomy]));
|
";
|
||||||
|
$statement = (string)$wpdb->prepare($query, array_merge($statuses, [$customer->get_id(), $taxonomy]));
|
||||||
|
|
||||||
return array_map('intval', $wpdb->get_col($statement));
|
return array_map('intval', $wpdb->get_col($statement));
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,7 @@ class CustomerReviewFieldsFactory {
|
|||||||
*/
|
*/
|
||||||
private function getUniqueProductReviewCount(WC_Customer $customer): int {
|
private function getUniqueProductReviewCount(WC_Customer $customer): int {
|
||||||
$wpdb = $this->wordPress->getWpdb();
|
$wpdb = $this->wordPress->getWpdb();
|
||||||
|
/** @var literal-string $sql */
|
||||||
$sql = "
|
$sql = "
|
||||||
SELECT COUNT(DISTINCT comment_post_ID) FROM {$wpdb->comments}
|
SELECT COUNT(DISTINCT comment_post_ID) FROM {$wpdb->comments}
|
||||||
WHERE comment_parent = 0
|
WHERE comment_parent = 0
|
||||||
@ -62,6 +63,7 @@ class CustomerReviewFieldsFactory {
|
|||||||
|
|
||||||
private function getLastReviewDate(WC_Customer $customer): ?DateTimeImmutable {
|
private function getLastReviewDate(WC_Customer $customer): ?DateTimeImmutable {
|
||||||
$wpdb = $this->wordPress->getWpdb();
|
$wpdb = $this->wordPress->getWpdb();
|
||||||
|
/** @var literal-string $sql */
|
||||||
$sql = "
|
$sql = "
|
||||||
SELECT comment_date FROM {$wpdb->comments}
|
SELECT comment_date FROM {$wpdb->comments}
|
||||||
WHERE comment_parent = 0
|
WHERE comment_parent = 0
|
||||||
|
@ -387,6 +387,7 @@ class OrderFieldsFactory {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return array_map(function ($product) {
|
return array_map(function ($product) {
|
||||||
|
/** @var array{ID:int, post_title:string} $product */
|
||||||
$id = $product['ID'];
|
$id = $product['ID'];
|
||||||
$title = $product['post_title'];
|
$title = $product['post_title'];
|
||||||
return ['id' => (int)$id, 'name' => "$title (#$id)"];
|
return ['id' => (int)$id, 'name' => "$title (#$id)"];
|
||||||
|
@ -22,12 +22,14 @@ class TermParentsLoader {
|
|||||||
$idsPlaceholder = implode(',', array_fill(0, count($termIds), '%s'));
|
$idsPlaceholder = implode(',', array_fill(0, count($termIds), '%s'));
|
||||||
|
|
||||||
$wpdb = $this->wordPress->getWpdb();
|
$wpdb = $this->wordPress->getWpdb();
|
||||||
$statement = (string)$wpdb->prepare("
|
/** @var literal-string $query - PHPStan expects literal-string */
|
||||||
|
$query = "
|
||||||
SELECT DISTINCT tt.parent
|
SELECT DISTINCT tt.parent
|
||||||
FROM {$wpdb->term_taxonomy} AS tt
|
FROM {$wpdb->term_taxonomy} AS tt
|
||||||
WHERE tt.parent != 0
|
WHERE tt.parent != 0
|
||||||
AND tt.term_id IN ($idsPlaceholder)
|
AND tt.term_id IN ($idsPlaceholder)
|
||||||
", $termIds);
|
";
|
||||||
|
$statement = (string)$wpdb->prepare($query, $termIds);
|
||||||
|
|
||||||
$parentIds = array_map('intval', $wpdb->get_col($statement));
|
$parentIds = array_map('intval', $wpdb->get_col($statement));
|
||||||
if (count($parentIds) === 0) {
|
if (count($parentIds) === 0) {
|
||||||
|
@ -154,6 +154,7 @@ class Activator {
|
|||||||
$tablesSql = implode(
|
$tablesSql = implode(
|
||||||
',',
|
',',
|
||||||
array_map(function ($table): string {
|
array_map(function ($table): string {
|
||||||
|
/** @var string $table */
|
||||||
return $this->wp->escSql(strval($table));
|
return $this->wp->escSql(strval($table));
|
||||||
}, $tables)
|
}, $tables)
|
||||||
);
|
);
|
||||||
|
@ -36,6 +36,7 @@ class Beamer extends SimpleWorker {
|
|||||||
$posts = $this->wp->wpRemoteRetrieveBody($response);
|
$posts = $this->wp->wpRemoteRetrieveBody($response);
|
||||||
if (empty($posts)) return false;
|
if (empty($posts)) return false;
|
||||||
$posts = json_decode($posts);
|
$posts = json_decode($posts);
|
||||||
|
/** @var \stdClass[] $posts */
|
||||||
if (empty($posts) || empty($posts[0]->date)) return false;
|
if (empty($posts) || empty($posts[0]->date)) return false;
|
||||||
$this->settings->set('last_announcement_date', Carbon::createFromTimeString($posts[0]->date)->getTimestamp());
|
$this->settings->set('last_announcement_date', Carbon::createFromTimeString($posts[0]->date)->getTimestamp());
|
||||||
return true;
|
return true;
|
||||||
|
@ -49,7 +49,7 @@ class WooCommercePastOrders extends SimpleWorker {
|
|||||||
add_filter('posts_where', function ($where = '') use ($lastId) {
|
add_filter('posts_where', function ($where = '') use ($lastId) {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
return $where . " AND {$wpdb->prefix}posts.ID > " . $lastId;
|
return $where . " AND {$wpdb->prefix}posts.ID > " . $lastId;
|
||||||
}, 10, 2);
|
}, 10, 1);
|
||||||
|
|
||||||
$orderIds = $this->woocommerceHelper->wcGetOrders([
|
$orderIds = $this->woocommerceHelper->wcGetOrders([
|
||||||
'date_completed' => '>=' . (($createdAt = $oldestClick->getCreatedAt()) ? $createdAt->format('Y-m-d H:i:s') : null),
|
'date_completed' => '>=' . (($createdAt = $oldestClick->getCreatedAt()) ? $createdAt->format('Y-m-d H:i:s') : null),
|
||||||
|
@ -648,20 +648,6 @@ class ContainerConfigurator implements IContainerConfigurator {
|
|||||||
return $container;
|
return $container;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @phpcsSuppress SlevomatCodingStandard.Classes.UnusedPrivateElements
|
|
||||||
*/
|
|
||||||
private function registerPremiumService(ContainerBuilder $container, $id) {
|
|
||||||
$container->register($id)
|
|
||||||
->setPublic(true)
|
|
||||||
->addArgument($id)
|
|
||||||
->addArgument(new Reference('service_container'))
|
|
||||||
->setFactory([
|
|
||||||
self::class,
|
|
||||||
'getPremiumService',
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getPremiumService($id, ContainerInterface $container = null) {
|
public static function getPremiumService($id, ContainerInterface $container = null) {
|
||||||
if ($container === null) {
|
if ($container === null) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -41,6 +41,7 @@ class MetadataCache extends CacheProvider {
|
|||||||
|
|
||||||
// in dev mode invalidate cache if source file has changed
|
// in dev mode invalidate cache if source file has changed
|
||||||
if ($fileExists && $this->isDevMode) {
|
if ($fileExists && $this->isDevMode) {
|
||||||
|
/** @var \stdClass $classMetadata */
|
||||||
$classMetadata = unserialize((string)file_get_contents($filename));
|
$classMetadata = unserialize((string)file_get_contents($filename));
|
||||||
if (!isset($classMetadata->name) || (!class_exists($classMetadata->name) && !interface_exists($classMetadata->name))) {
|
if (!isset($classMetadata->name) || (!class_exists($classMetadata->name) && !interface_exists($classMetadata->name))) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -453,7 +453,8 @@ class NewsletterEntity {
|
|||||||
* @return int[]
|
* @return int[]
|
||||||
*/
|
*/
|
||||||
public function getSegmentIds() {
|
public function getSegmentIds() {
|
||||||
return array_filter($this->newsletterSegments->map(function(NewsletterSegmentEntity $newsletterSegment) {
|
return array_filter($this->newsletterSegments->map(function(NewsletterSegmentEntity $newsletterSegment = null) {
|
||||||
|
if (!$newsletterSegment) return null;
|
||||||
$segment = $newsletterSegment->getSegment();
|
$segment = $newsletterSegment->getSegment();
|
||||||
return $segment ? (int)$segment->getId() : null;
|
return $segment ? (int)$segment->getId() : null;
|
||||||
})->toArray());
|
})->toArray());
|
||||||
@ -467,7 +468,8 @@ class NewsletterEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getOption(string $name): ?NewsletterOptionEntity {
|
public function getOption(string $name): ?NewsletterOptionEntity {
|
||||||
$option = $this->options->filter(function (NewsletterOptionEntity $option) use ($name): bool {
|
$option = $this->options->filter(function (NewsletterOptionEntity $option = null) use ($name): bool {
|
||||||
|
if (!$option) return false;
|
||||||
return ($field = $option->getOptionField()) ? $field->getName() === $name : false;
|
return ($field = $option->getOptionField()) ? $field->getName() === $name : false;
|
||||||
})->first();
|
})->first();
|
||||||
return $option ?: null;
|
return $option ?: null;
|
||||||
|
@ -226,7 +226,8 @@ class ScheduledTaskEntity {
|
|||||||
public function getSubscribersByProcessed(int $processed): array {
|
public function getSubscribersByProcessed(int $processed): array {
|
||||||
$criteria = Criteria::create()
|
$criteria = Criteria::create()
|
||||||
->where(Criteria::expr()->eq('processed', $processed));
|
->where(Criteria::expr()->eq('processed', $processed));
|
||||||
$subscribers = $this->subscribers->matching($criteria)->map(function (ScheduledTaskSubscriberEntity $taskSubscriber): ?SubscriberEntity {
|
$subscribers = $this->subscribers->matching($criteria)->map(function (ScheduledTaskSubscriberEntity $taskSubscriber = null): ?SubscriberEntity {
|
||||||
|
if (!$taskSubscriber) return null;
|
||||||
return $taskSubscriber->getSubscriber();
|
return $taskSubscriber->getSubscriber();
|
||||||
});
|
});
|
||||||
return array_filter($subscribers->toArray());
|
return array_filter($subscribers->toArray());
|
||||||
|
@ -496,9 +496,10 @@ class SubscriberEntity {
|
|||||||
|
|
||||||
/** * @return Collection<int, SegmentEntity> */
|
/** * @return Collection<int, SegmentEntity> */
|
||||||
public function getSegments() {
|
public function getSegments() {
|
||||||
return $this->subscriberSegments->map(function (SubscriberSegmentEntity $subscriberSegment) {
|
return $this->subscriberSegments->map(function (SubscriberSegmentEntity $subscriberSegment = null) {
|
||||||
|
if (!$subscriberSegment) return null;
|
||||||
return $subscriberSegment->getSegment();
|
return $subscriberSegment->getSegment();
|
||||||
})->filter(function ($segment) {
|
})->filter(function (?SegmentEntity $segment = null) {
|
||||||
return $segment !== null;
|
return $segment !== null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -626,7 +627,8 @@ class SubscriberEntity {
|
|||||||
/** @ORM\PreFlush */
|
/** @ORM\PreFlush */
|
||||||
public function cleanupSubscriberSegments(): void {
|
public function cleanupSubscriberSegments(): void {
|
||||||
// Delete old orphan SubscriberSegments to avoid errors on update
|
// Delete old orphan SubscriberSegments to avoid errors on update
|
||||||
$this->subscriberSegments->map(function (SubscriberSegmentEntity $subscriberSegment) {
|
$this->subscriberSegments->map(function (SubscriberSegmentEntity $subscriberSegment = null) {
|
||||||
|
if (!$subscriberSegment) return null;
|
||||||
if ($subscriberSegment->getSegment() === null) {
|
if ($subscriberSegment->getSegment() === null) {
|
||||||
$this->subscriberSegments->removeElement($subscriberSegment);
|
$this->subscriberSegments->removeElement($subscriberSegment);
|
||||||
}
|
}
|
||||||
|
@ -268,6 +268,7 @@ class Widget extends \WP_Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($formType === 'widget') {
|
if ($formType === 'widget') {
|
||||||
|
/** @var string $output */
|
||||||
// We control the template and the data is sanitized
|
// We control the template and the data is sanitized
|
||||||
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPressDotOrg.sniffs.OutputEscaping.UnescapedOutputParameter
|
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPressDotOrg.sniffs.OutputEscaping.UnescapedOutputParameter
|
||||||
echo $output;
|
echo $output;
|
||||||
|
@ -66,6 +66,9 @@ class Migration_20231128_120355_App extends AppMigration {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param class-string $entityClassName
|
||||||
|
*/
|
||||||
private function getTableName(string $entityClassName): string {
|
private function getTableName(string $entityClassName): string {
|
||||||
return $this->entityManager->getClassMetadata($entityClassName)->getTableName();
|
return $this->entityManager->getClassMetadata($entityClassName)->getTableName();
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,7 @@ class Migration_20230831_143755_Db extends DbMigration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$queries = [];
|
$queries = [];
|
||||||
|
/** @var array<int, array{id:int, automation_run_id:int, step_id:int, started_at:string, steps:string}> $data */
|
||||||
foreach ($data as $item) {
|
foreach ($data as $item) {
|
||||||
/** @var array $steps */
|
/** @var array $steps */
|
||||||
$steps = json_decode(strval($item['steps']), true);
|
$steps = json_decode(strval($item['steps']), true);
|
||||||
|
@ -23,6 +23,9 @@ abstract class DbMigration {
|
|||||||
|
|
||||||
abstract public function run(): void;
|
abstract public function run(): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param class-string<object> $entityClass
|
||||||
|
*/
|
||||||
protected function getTableName(string $entityClass): string {
|
protected function getTableName(string $entityClass): string {
|
||||||
return $this->entityManager->getClassMetadata($entityClass)->getTableName();
|
return $this->entityManager->getClassMetadata($entityClass)->getTableName();
|
||||||
}
|
}
|
||||||
|
@ -467,6 +467,7 @@ class NewslettersRepository extends Repository {
|
|||||||
", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]);
|
", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]);
|
||||||
|
|
||||||
// Fetch WP Posts IDs and delete them
|
// Fetch WP Posts IDs and delete them
|
||||||
|
/** @var int[] $wpPostsIds */
|
||||||
$wpPostsIds = $entityManager->createQueryBuilder()->select('n.wpPostId')
|
$wpPostsIds = $entityManager->createQueryBuilder()->select('n.wpPostId')
|
||||||
->from(NewsletterEntity::class, 'n')
|
->from(NewsletterEntity::class, 'n')
|
||||||
->where('n.id IN (:ids)')
|
->where('n.id IN (:ids)')
|
||||||
|
@ -38,11 +38,13 @@ class AbandonedCartContent {
|
|||||||
// Do not display the block if not an automatic email
|
// Do not display the block if not an automatic email
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
$groupOption = $newsletter->getOptions()->filter(function (NewsletterOptionEntity $newsletterOption) {
|
$groupOption = $newsletter->getOptions()->filter(function (NewsletterOptionEntity $newsletterOption = null) {
|
||||||
|
if (!$newsletterOption) return false;
|
||||||
$optionField = $newsletterOption->getOptionField();
|
$optionField = $newsletterOption->getOptionField();
|
||||||
return $optionField && $optionField->getName() === 'group';
|
return $optionField && $optionField->getName() === 'group';
|
||||||
})->first();
|
})->first();
|
||||||
$eventOption = $newsletter->getOptions()->filter(function (NewsletterOptionEntity $newsletterOption) {
|
$eventOption = $newsletter->getOptions()->filter(function (NewsletterOptionEntity $newsletterOption = null) {
|
||||||
|
if (!$newsletterOption) return false;
|
||||||
$optionField = $newsletterOption->getOptionField();
|
$optionField = $newsletterOption->getOptionField();
|
||||||
return $optionField && $optionField->getName() === 'event';
|
return $optionField && $optionField->getName() === 'event';
|
||||||
})->first();
|
})->first();
|
||||||
|
@ -79,7 +79,7 @@ class WooCommerceBlocksIntegration {
|
|||||||
);
|
);
|
||||||
$block = $this->wp->registerBlockTypeFromMetadata(Env::$assetsPath . '/dist/js/marketing-optin-block');
|
$block = $this->wp->registerBlockTypeFromMetadata(Env::$assetsPath . '/dist/js/marketing-optin-block');
|
||||||
// We need to force the script to load in the footer. register_block_type always adds the script to the header.
|
// We need to force the script to load in the footer. register_block_type always adds the script to the header.
|
||||||
if ($block instanceof \WP_Block_Type && $block->editor_script) { // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
if ($block instanceof \WP_Block_Type && isset($block->editor_script) && $block->editor_script) { // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||||
$wpScripts = $this->wp->getWpScripts();
|
$wpScripts = $this->wp->getWpScripts();
|
||||||
$wpScripts->add_data($block->editor_script, 'group', 1); // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
$wpScripts->add_data($block->editor_script, 'group', 1); // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,9 @@ class FilterHelper {
|
|||||||
return $this->getTableForEntity(SubscriberEntity::class);
|
return $this->getTableForEntity(SubscriberEntity::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param class-string<object> $entityClass
|
||||||
|
*/
|
||||||
public function getTableForEntity(string $entityClass): string {
|
public function getTableForEntity(string $entityClass): string {
|
||||||
return $this->entityManager->getClassMetadata($entityClass)->getTableName();
|
return $this->entityManager->getClassMetadata($entityClass)->getTableName();
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,9 @@ class WooCommerceAverageSpent implements Filter {
|
|||||||
$orderStatsAlias = $this->wooFilterHelper->applyOrderStatusFilter($queryBuilder);
|
$orderStatsAlias = $this->wooFilterHelper->applyOrderStatusFilter($queryBuilder);
|
||||||
|
|
||||||
if ($timeframe !== DynamicSegmentFilterData::TIMEFRAME_ALL_TIME) {
|
if ($timeframe !== DynamicSegmentFilterData::TIMEFRAME_ALL_TIME) {
|
||||||
$days = intval($filterData->getParam('days'));
|
/** @var int $days */
|
||||||
|
$days = $filterData->getParam('days');
|
||||||
|
$days = intval($days);
|
||||||
$date = Carbon::now()->subDays($days);
|
$date = Carbon::now()->subDays($days);
|
||||||
$dateParam = $this->filterHelper->getUniqueParameterName('date');
|
$dateParam = $this->filterHelper->getUniqueParameterName('date');
|
||||||
$queryBuilder
|
$queryBuilder
|
||||||
|
@ -38,8 +38,12 @@ class WooCommerceNumberOfOrders implements Filter {
|
|||||||
global $wpdb;
|
global $wpdb;
|
||||||
$subscribersTable = $this->entityManager->getClassMetadata(SubscriberEntity::class)->getTableName();
|
$subscribersTable = $this->entityManager->getClassMetadata(SubscriberEntity::class)->getTableName();
|
||||||
$filterData = $filter->getFilterData();
|
$filterData = $filter->getFilterData();
|
||||||
$type = strval($filterData->getParam('number_of_orders_type'));
|
/** @var string $type - for PHPStan because strval() doesn't accept a value of mixed */
|
||||||
$count = intval($filterData->getParam('number_of_orders_count'));
|
$type = $filterData->getParam('number_of_orders_type');
|
||||||
|
$type = strval($type);
|
||||||
|
/** @var string $count - for PHPStan because intval() doesn't accept a value of mixed */
|
||||||
|
$count = $filterData->getParam('number_of_orders_count');
|
||||||
|
$count = intval($count);
|
||||||
$isAllTime = $filterData->getParam('timeframe') === DynamicSegmentFilterData::TIMEFRAME_ALL_TIME;
|
$isAllTime = $filterData->getParam('timeframe') === DynamicSegmentFilterData::TIMEFRAME_ALL_TIME;
|
||||||
$parameterSuffix = $filter->getId() ?? Security::generateRandomString();
|
$parameterSuffix = $filter->getId() ?? Security::generateRandomString();
|
||||||
$collation = $this->collationChecker->getCollateIfNeeded(
|
$collation = $this->collationChecker->getCollateIfNeeded(
|
||||||
|
@ -31,10 +31,18 @@ class WooCommerceNumberOfReviews implements Filter {
|
|||||||
$commentMetaTable = $this->filterHelper->getPrefixedTable('commentmeta');
|
$commentMetaTable = $this->filterHelper->getPrefixedTable('commentmeta');
|
||||||
$filterData = $filter->getFilterData();
|
$filterData = $filter->getFilterData();
|
||||||
$this->validateFilterData((array)$filterData->getData());
|
$this->validateFilterData((array)$filterData->getData());
|
||||||
$type = strval($filterData->getParam('count_type'));
|
/** @var string $type - for PHPStan because strval() doesn't accept a value of mixed */
|
||||||
$rating = strval($filterData->getParam('rating'));
|
$type = $filterData->getParam('count_type');
|
||||||
$days = intval($filterData->getParam('days'));
|
$type = strval($type);
|
||||||
$count = intval($filterData->getParam('count'));
|
/** @var string $rating - for PHPStan because strval() doesn't accept a value of mixed */
|
||||||
|
$rating = $filterData->getParam('rating');
|
||||||
|
$rating = strval($rating);
|
||||||
|
/** @var int $days - for PHPStan because intval() doesn't accept a value of mixed */
|
||||||
|
$days = $filterData->getParam('days');
|
||||||
|
$days = intval($days);
|
||||||
|
/** @var int $count - for PHPStan because intval() doesn't accept a value of mixed */
|
||||||
|
$count = $filterData->getParam('count');
|
||||||
|
$count = intval($count);
|
||||||
|
|
||||||
$subscribersTable = $this->filterHelper->getSubscribersTable();
|
$subscribersTable = $this->filterHelper->getSubscribersTable();
|
||||||
$collation = $this->collationChecker->getCollateIfNeeded(
|
$collation = $this->collationChecker->getCollateIfNeeded(
|
||||||
|
@ -104,6 +104,7 @@ class SegmentSubscribersRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$statement = $this->executeQuery($queryBuilder);
|
$statement = $this->executeQuery($queryBuilder);
|
||||||
|
/** @var string $result */
|
||||||
$result = $statement->fetchColumn();
|
$result = $statement->fetchColumn();
|
||||||
return (int)$result;
|
return (int)$result;
|
||||||
}
|
}
|
||||||
@ -121,6 +122,7 @@ class SegmentSubscribersRepository {
|
|||||||
$queryBuilder = $this->createDynamicStatisticsQueryBuilder();
|
$queryBuilder = $this->createDynamicStatisticsQueryBuilder();
|
||||||
$queryBuilder = $this->filterSubscribersInDynamicSegment($queryBuilder, $segment, null);
|
$queryBuilder = $this->filterSubscribersInDynamicSegment($queryBuilder, $segment, null);
|
||||||
$statement = $this->executeQuery($queryBuilder);
|
$statement = $this->executeQuery($queryBuilder);
|
||||||
|
/** @var array{all:string} $result */
|
||||||
$result = $statement->fetch();
|
$result = $statement->fetch();
|
||||||
return (int)$result['all'];
|
return (int)$result['all'];
|
||||||
}
|
}
|
||||||
|
@ -335,6 +335,7 @@ class SegmentsRepository extends Repository {
|
|||||||
->from($segmentFiltersTable, 'sf')
|
->from($segmentFiltersTable, 'sf')
|
||||||
->groupBy('sf.segment_id')
|
->groupBy('sf.segment_id')
|
||||||
->having('COUNT(sf.id) > 1');
|
->having('COUNT(sf.id) > 1');
|
||||||
|
/** @var null|int $result */
|
||||||
$result = $this->entityManager->getConnection()->createQueryBuilder()
|
$result = $this->entityManager->getConnection()->createQueryBuilder()
|
||||||
->select('count(*)')
|
->select('count(*)')
|
||||||
->from(sprintf('(%s) as subCounts', $qbInner->getSQL()))
|
->from(sprintf('(%s) as subCounts', $qbInner->getSQL()))
|
||||||
|
@ -329,7 +329,9 @@ class WooCommerce {
|
|||||||
$now = (Carbon::createFromTimestamp($this->wp->currentTime('timestamp')))->format('Y-m-d H:i:s');
|
$now = (Carbon::createFromTimestamp($this->wp->currentTime('timestamp')))->format('Y-m-d H:i:s');
|
||||||
$source = Source::WOOCOMMERCE_USER;
|
$source = Source::WOOCOMMERCE_USER;
|
||||||
foreach ($emails as $email) {
|
foreach ($emails as $email) {
|
||||||
$email = strval($this->connection->quote($email));
|
/** @var string $email */
|
||||||
|
$email = $this->connection->quote($email);
|
||||||
|
$email = strval($email);
|
||||||
$subscribersValues[] = "(1, {$email}, '{$status}', '{$now}', '{$now}', '{$source}')";
|
$subscribersValues[] = "(1, {$email}, '{$status}', '{$now}', '{$now}', '{$source}')";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ class API {
|
|||||||
|
|
||||||
public function sendMessages($messageBody) {
|
public function sendMessages($messageBody) {
|
||||||
$this->curlHandle = null;
|
$this->curlHandle = null;
|
||||||
add_action('requests-curl.before_request', [$this, 'setCurlHandle'], 10, 2);
|
add_action('requests-curl.before_request', [$this, 'setCurlHandle'], 10, 1);
|
||||||
add_action('requests-curl.after_request', [$this, 'logCurlInformation'], 10, 2);
|
add_action('requests-curl.after_request', [$this, 'logCurlInformation'], 10, 2);
|
||||||
$result = $this->request(
|
$result = $this->request(
|
||||||
$this->urlMessages,
|
$this->urlMessages,
|
||||||
|
@ -72,6 +72,7 @@ class StatisticsWooCommercePurchasesRepository extends Repository {
|
|||||||
|
|
||||||
// The "SELECT MIN(click_id)..." sub-query is used to count each purchase only once.
|
// The "SELECT MIN(click_id)..." sub-query is used to count each purchase only once.
|
||||||
// In the data we track a purchase to multiple newsletters if clicks from multiple newsletters occurred.
|
// In the data we track a purchase to multiple newsletters if clicks from multiple newsletters occurred.
|
||||||
|
/** @var array<int, array{revenue: float|int, campaign_id:int, orders_count:int}> $data */
|
||||||
$data = $this->entityManager->getConnection()->executeQuery('
|
$data = $this->entityManager->getConnection()->executeQuery('
|
||||||
SELECT
|
SELECT
|
||||||
SUM(swp.order_price_total) AS revenue,
|
SUM(swp.order_price_total) AS revenue,
|
||||||
|
@ -63,20 +63,30 @@ class ImportExportRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param class-string<object> $className
|
||||||
* @return ClassMetadata<object>
|
* @return ClassMetadata<object>
|
||||||
*/
|
*/
|
||||||
protected function getClassMetadata(string $className): ClassMetadata {
|
protected function getClassMetadata(string $className): ClassMetadata {
|
||||||
return $this->entityManager->getClassMetadata($className);
|
return $this->entityManager->getClassMetadata($className);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param class-string<object> $className
|
||||||
|
*/
|
||||||
protected function getTableName(string $className): string {
|
protected function getTableName(string $className): string {
|
||||||
return $this->getClassMetadata($className)->getTableName();
|
return $this->getClassMetadata($className)->getTableName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param class-string<object> $className
|
||||||
|
*/
|
||||||
protected function getTableColumns(string $className): array {
|
protected function getTableColumns(string $className): array {
|
||||||
return $this->getClassMetadata($className)->getColumnNames();
|
return $this->getClassMetadata($className)->getColumnNames();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param class-string<object> $className
|
||||||
|
*/
|
||||||
public function insertMultiple(
|
public function insertMultiple(
|
||||||
string $className,
|
string $className,
|
||||||
array $columns,
|
array $columns,
|
||||||
@ -109,6 +119,9 @@ class ImportExportRepository {
|
|||||||
return $count;
|
return $count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param class-string<object> $className
|
||||||
|
*/
|
||||||
public function updateMultiple(
|
public function updateMultiple(
|
||||||
string $className,
|
string $className,
|
||||||
array $columns,
|
array $columns,
|
||||||
@ -218,7 +231,6 @@ class ImportExportRepository {
|
|||||||
private function createSubscribersQueryBuilder(int $limit, int $offset): QueryBuilder {
|
private function createSubscribersQueryBuilder(int $limit, int $offset): QueryBuilder {
|
||||||
$subscriberSegmentTable = $this->getTableName(SubscriberSegmentEntity::class);
|
$subscriberSegmentTable = $this->getTableName(SubscriberSegmentEntity::class);
|
||||||
$subscriberTable = $this->getTableName(SubscriberEntity::class);
|
$subscriberTable = $this->getTableName(SubscriberEntity::class);
|
||||||
$segmentTable = $this->getTableName(SegmentEntity::class);
|
|
||||||
|
|
||||||
return $this->entityManager->getConnection()->createQueryBuilder()
|
return $this->entityManager->getConnection()->createQueryBuilder()
|
||||||
->select("
|
->select("
|
||||||
@ -278,6 +290,9 @@ class ImportExportRepository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param class-string<object> $className
|
||||||
|
*/
|
||||||
private function getIdsByEmail(string $className, array $columns, array $data): array {
|
private function getIdsByEmail(string $className, array $columns, array $data): array {
|
||||||
$tableName = $this->getTableName($className);
|
$tableName = $this->getTableName($className);
|
||||||
$emailIndex = array_search('email', $columns);
|
$emailIndex = array_search('email', $columns);
|
||||||
|
@ -86,7 +86,7 @@ class SubscriberStatisticsRepository extends Repository {
|
|||||||
->andWhere('stats.sentAt >= :dateTime')
|
->andWhere('stats.sentAt >= :dateTime')
|
||||||
->setParameter('dateTime', $startTime);
|
->setParameter('dateTime', $startTime);
|
||||||
}
|
}
|
||||||
return $queryBuilder
|
return (int)$queryBuilder
|
||||||
->getQuery()
|
->getQuery()
|
||||||
->getSingleScalarResult();
|
->getSingleScalarResult();
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ class SubscriberIPsRepository extends Repository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getCountByIPAndCreatedAtAfterTimeInSeconds(string $ip, int $seconds): int {
|
public function getCountByIPAndCreatedAtAfterTimeInSeconds(string $ip, int $seconds): int {
|
||||||
return $this->entityManager->createQueryBuilder()
|
return (int)$this->entityManager->createQueryBuilder()
|
||||||
->select('COUNT(sip)')
|
->select('COUNT(sip)')
|
||||||
->from(SubscriberIPEntity::class, 'sip')
|
->from(SubscriberIPEntity::class, 'sip')
|
||||||
->where('sip.ip = :ip')
|
->where('sip.ip = :ip')
|
||||||
|
@ -124,6 +124,7 @@ class SubscribersEmailCountsController {
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** @var array{0: array{count:int, max:int}} $subscribersInRange */
|
||||||
$subscribersInRange = $result->fetchAllAssociative();
|
$subscribersInRange = $result->fetchAllAssociative();
|
||||||
|
|
||||||
return [intval($subscribersInRange[0]['count']), intval($subscribersInRange[0]['max'])];
|
return [intval($subscribersInRange[0]['count']), intval($subscribersInRange[0]['max'])];
|
||||||
|
@ -43,6 +43,7 @@ class RecaptchaValidator implements CaptchaValidator {
|
|||||||
if ($this->wp->isWpError($response)) {
|
if ($this->wp->isWpError($response)) {
|
||||||
throw new ValidationError(__('Error while validating the CAPTCHA.', 'mailpoet'));
|
throw new ValidationError(__('Error while validating the CAPTCHA.', 'mailpoet'));
|
||||||
}
|
}
|
||||||
|
/** @var \stdClass $response */
|
||||||
$response = json_decode($this->wp->wpRemoteRetrieveBody($response));
|
$response = json_decode($this->wp->wpRemoteRetrieveBody($response));
|
||||||
if (empty($response->success)) {
|
if (empty($response->success)) {
|
||||||
throw new ValidationError(__('Error while validating the CAPTCHA.', 'mailpoet'));
|
throw new ValidationError(__('Error while validating the CAPTCHA.', 'mailpoet'));
|
||||||
|
@ -72,11 +72,13 @@ class Sending {
|
|||||||
SendingQueue $queue = null
|
SendingQueue $queue = null
|
||||||
) {
|
) {
|
||||||
if (!$task instanceof ScheduledTask) {
|
if (!$task instanceof ScheduledTask) {
|
||||||
|
/** @var ScheduledTask $task */
|
||||||
$task = ScheduledTask::create();
|
$task = ScheduledTask::create();
|
||||||
$task->type = self::TASK_TYPE;
|
$task->type = self::TASK_TYPE;
|
||||||
$task->save();
|
$task->save();
|
||||||
}
|
}
|
||||||
if (!$queue instanceof SendingQueue) {
|
if (!$queue instanceof SendingQueue) {
|
||||||
|
/** @var SendingQueue $queue */
|
||||||
$queue = SendingQueue::create();
|
$queue = SendingQueue::create();
|
||||||
$queue->newsletterId = 0;
|
$queue->newsletterId = 0;
|
||||||
$queue->taskId = $task->id;
|
$queue->taskId = $task->id;
|
||||||
|
@ -221,6 +221,7 @@ class Functions extends AbstractExtension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getSendingFrequency() {
|
public function getSendingFrequency() {
|
||||||
|
/** @var string[] $args */
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$value = (int)array_shift($args);
|
$value = (int)array_shift($args);
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ class Handlebars extends AbstractExtension {
|
|||||||
|
|
||||||
public function generatePartial($env, $context) {
|
public function generatePartial($env, $context) {
|
||||||
// get arguments (minus env & $context)
|
// get arguments (minus env & $context)
|
||||||
|
/** @var array{0:string, 1:array|string, 2:string} $args */
|
||||||
$args = array_slice(func_get_args(), 2);
|
$args = array_slice(func_get_args(), 2);
|
||||||
$argsCount = count($args);
|
$argsCount = count($args);
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@ class I18n extends AbstractExtension {
|
|||||||
|
|
||||||
public function localize() {
|
public function localize() {
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
|
/** @var array $translations */
|
||||||
$translations = array_shift($args);
|
$translations = array_shift($args);
|
||||||
$output = [];
|
$output = [];
|
||||||
foreach ($translations as $key => $translation) {
|
foreach ($translations as $key => $translation) {
|
||||||
@ -82,6 +83,7 @@ class I18n extends AbstractExtension {
|
|||||||
|
|
||||||
public function date() {
|
public function date() {
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
|
/** @var int|null $date */
|
||||||
$date = (isset($args[0])) ? $args[0] : null;
|
$date = (isset($args[0])) ? $args[0] : null;
|
||||||
$dateFormat = (isset($args[1])) ? $args[1] : WPFunctions::get()->getOption('date_format');
|
$dateFormat = (isset($args[1])) ? $args[1] : WPFunctions::get()->getOption('date_format');
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ class DOM {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reattach cut_element and right siblings to grandparent
|
// Reattach cut_element and right siblings to grandparent
|
||||||
/* @phpstan-ignore-next-line Because there is a wrong annotation in the library tburry/pquery */
|
|
||||||
$grandparent = $parent->parent;
|
$grandparent = $parent->parent;
|
||||||
$indexAfterParent = $parent->index() + 1;
|
$indexAfterParent = $parent->index() + 1;
|
||||||
$right->move($grandparent, $indexAfterParent);
|
$right->move($grandparent, $indexAfterParent);
|
||||||
|
@ -28,11 +28,11 @@ if (!class_exists('ProgressBar', false)) {
|
|||||||
$this->filename = Env::$tempPath . '/' . $filename;
|
$this->filename = Env::$tempPath . '/' . $filename;
|
||||||
$this->url = Env::$tempUrl . '/' . $filename;
|
$this->url = Env::$tempUrl . '/' . $filename;
|
||||||
$counters = $this->readProgress();
|
$counters = $this->readProgress();
|
||||||
if (isset($counters->total)) {
|
if (isset($counters['total'])) {
|
||||||
$this->totalCount = $counters->total;
|
$this->totalCount = $counters['total'];
|
||||||
}
|
}
|
||||||
if (isset($counters->current)) {
|
if (isset($counters['current'])) {
|
||||||
$this->currentCount = $counters->current;
|
$this->currentCount = $counters['current'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +56,9 @@ if (!class_exists('ProgressBar', false)) {
|
|||||||
}
|
}
|
||||||
$jsonContent = file_get_contents($this->filename);
|
$jsonContent = file_get_contents($this->filename);
|
||||||
if (is_string($jsonContent)) {
|
if (is_string($jsonContent)) {
|
||||||
return json_decode($jsonContent);
|
/** @var array $data */
|
||||||
|
$data = json_decode($jsonContent, true);
|
||||||
|
return $data;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ class Functions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param bool|array $crop
|
* @param bool|array{string, string} $crop
|
||||||
*/
|
*/
|
||||||
public function addImageSize($name, $width = 0, $height = 0, $crop = false) {
|
public function addImageSize($name, $width = 0, $height = 0, $crop = false) {
|
||||||
return add_image_size($name, $width, $height, $crop);
|
return add_image_size($name, $width, $height, $crop);
|
||||||
@ -99,11 +99,11 @@ class Functions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function addScreenOption($option, $args = []) {
|
public function addScreenOption($option, $args = []) {
|
||||||
return add_screen_option($option, $args);
|
add_screen_option($option, $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addShortcode($tag, callable $callback) {
|
public function addShortcode($tag, callable $callback) {
|
||||||
return add_shortcode($tag, $callback);
|
add_shortcode($tag, $callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -483,7 +483,7 @@ class Functions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function statusHeader($code, $description = '') {
|
public function statusHeader($code, $description = '') {
|
||||||
return status_header($code, $description);
|
status_header($code, $description);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function stripslashesDeep($value) {
|
public function stripslashesDeep($value) {
|
||||||
@ -519,7 +519,7 @@ class Functions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function wpEnqueueMedia(array $args = []) {
|
public function wpEnqueueMedia(array $args = []) {
|
||||||
return wp_enqueue_media($args);
|
wp_enqueue_media($args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function wpEnqueueScript($handle, $src = '', array $deps = [], $ver = false, $inFooter = false) {
|
public function wpEnqueueScript($handle, $src = '', array $deps = [], $ver = false, $inFooter = false) {
|
||||||
@ -660,7 +660,7 @@ class Functions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $action
|
* @param 'hot_categories'|'hot_tags'|'plugin_information'|'query_plugins' $action
|
||||||
* @param array|object $args
|
* @param array|object $args
|
||||||
* @return object|array|WP_Error
|
* @return object|array|WP_Error
|
||||||
*/
|
*/
|
||||||
@ -814,7 +814,7 @@ class Functions {
|
|||||||
return wp_register_script($handle, $src, $deps, $ver, $in_footer);
|
return wp_register_script($handle, $src, $deps, $ver, $in_footer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function wpSetScriptTranslations(string $handle, string $domain = 'default', string $path = null): bool {
|
public function wpSetScriptTranslations(string $handle, string $domain = 'default', string $path = ''): bool {
|
||||||
return wp_set_script_translations($handle, $domain, $path);
|
return wp_set_script_translations($handle, $domain, $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,11 +2,9 @@
|
|||||||
|
|
||||||
namespace MailPoet\WooCommerce;
|
namespace MailPoet\WooCommerce;
|
||||||
|
|
||||||
use MailPoet\Entities\StatisticsUnsubscribeEntity;
|
|
||||||
use MailPoet\Entities\SubscriberEntity;
|
use MailPoet\Entities\SubscriberEntity;
|
||||||
use MailPoet\Segments\SegmentsRepository;
|
use MailPoet\Segments\SegmentsRepository;
|
||||||
use MailPoet\Settings\SettingsController;
|
use MailPoet\Settings\SettingsController;
|
||||||
use MailPoet\Statistics\Track\Unsubscribes;
|
|
||||||
use MailPoet\Subscribers\ConfirmationEmailMailer;
|
use MailPoet\Subscribers\ConfirmationEmailMailer;
|
||||||
use MailPoet\Subscribers\Source;
|
use MailPoet\Subscribers\Source;
|
||||||
use MailPoet\Subscribers\SubscriberSegmentRepository;
|
use MailPoet\Subscribers\SubscriberSegmentRepository;
|
||||||
@ -61,9 +59,6 @@ class Subscription {
|
|||||||
/** @var SubscribersRepository */
|
/** @var SubscribersRepository */
|
||||||
private $subscribersRepository;
|
private $subscribersRepository;
|
||||||
|
|
||||||
/** @var Unsubscribes */
|
|
||||||
private $unsubscribesTracker;
|
|
||||||
|
|
||||||
/** @var SegmentsRepository */
|
/** @var SegmentsRepository */
|
||||||
private $segmentsRepository;
|
private $segmentsRepository;
|
||||||
|
|
||||||
@ -76,7 +71,6 @@ class Subscription {
|
|||||||
WPFunctions $wp,
|
WPFunctions $wp,
|
||||||
Helper $wcHelper,
|
Helper $wcHelper,
|
||||||
SubscribersRepository $subscribersRepository,
|
SubscribersRepository $subscribersRepository,
|
||||||
Unsubscribes $unsubscribesTracker,
|
|
||||||
SegmentsRepository $segmentsRepository,
|
SegmentsRepository $segmentsRepository,
|
||||||
SubscriberSegmentRepository $subscriberSegmentRepository
|
SubscriberSegmentRepository $subscriberSegmentRepository
|
||||||
) {
|
) {
|
||||||
@ -85,7 +79,6 @@ class Subscription {
|
|||||||
$this->wcHelper = $wcHelper;
|
$this->wcHelper = $wcHelper;
|
||||||
$this->confirmationEmailMailer = $confirmationEmailMailer;
|
$this->confirmationEmailMailer = $confirmationEmailMailer;
|
||||||
$this->subscribersRepository = $subscribersRepository;
|
$this->subscribersRepository = $subscribersRepository;
|
||||||
$this->unsubscribesTracker = $unsubscribesTracker;
|
|
||||||
$this->segmentsRepository = $segmentsRepository;
|
$this->segmentsRepository = $segmentsRepository;
|
||||||
$this->subscriberSegmentRepository = $subscriberSegmentRepository;
|
$this->subscriberSegmentRepository = $subscriberSegmentRepository;
|
||||||
}
|
}
|
||||||
@ -262,15 +255,4 @@ class Subscription {
|
|||||||
// ignore errors
|
// ignore errors
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function updateSubscriberStatus(SubscriberEntity $subscriber) {
|
|
||||||
$segmentsCount = $subscriber->getSubscriberSegments(SubscriberEntity::STATUS_SUBSCRIBED)->count();
|
|
||||||
|
|
||||||
if (!$segmentsCount) {
|
|
||||||
$subscriber->setStatus(SubscriberEntity::STATUS_UNSUBSCRIBED);
|
|
||||||
$this->subscribersRepository->persist($subscriber);
|
|
||||||
$this->subscribersRepository->flush();
|
|
||||||
$this->unsubscribesTracker->track((int)$subscriber->getId(), StatisticsUnsubscribeEntity::SOURCE_ORDER_CHECKOUT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ define('DB_HOST', 'localhost');
|
|||||||
define('DB_NAME', 'wordpress');
|
define('DB_NAME', 'wordpress');
|
||||||
define('DB_USER', 'wordpress');
|
define('DB_USER', 'wordpress');
|
||||||
define('DB_PASSWORD', '12345');
|
define('DB_PASSWORD', '12345');
|
||||||
|
define('MAILPOET_PREMIUM_VERSION', '1.0.0');
|
||||||
|
|
||||||
// Define Database Tables constants
|
// Define Database Tables constants
|
||||||
$dbConfig = new \MailPoet\Config\Database();
|
$dbConfig = new \MailPoet\Config\Database();
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
<?php declare(strict_types = 1);
|
|
||||||
|
|
||||||
$config = [];
|
|
||||||
$phpVersion = (int)getenv('ANALYSIS_PHP_VERSION') ?: PHP_VERSION_ID;
|
|
||||||
$config['parameters']['phpVersion'] = $phpVersion;
|
|
||||||
|
|
||||||
# PHPStan gets smarter when runs on PHP8 and some type checks added because of PHP8 are reported as unnecessary when we run PHPStan on PHP7
|
|
||||||
# see https://github.com/phpstan/phpstan/issues/4060
|
|
||||||
if ($phpVersion < 80000) {
|
|
||||||
$config['parameters']['ignoreErrors'][] = [
|
|
||||||
'message' => '#^Cannot access offset \\(int\\|string\\) on array\\<string#',
|
|
||||||
'path' => __DIR__ . '/../../lib/Features/FeatureFlagsController.php',
|
|
||||||
'count' => 1,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $config;
|
|
@ -145,6 +145,21 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Config/Populator.php
|
path: ../../lib/Config/Populator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Binary operation \"\\.\" between non-falsy-string and array\\|string results in an error\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: ../../lib/Config/Populator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Binary operation \"\\.\" between '`t1`\\.`' and array\\|string results in an error\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: ../../lib/Config/Populator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Part \\$table \\(array\\|string\\) of encapsed string cannot be cast to string\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: ../../lib/Config/Populator.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#2 \\$args of method MailPoet\\\\WP\\\\Functions\\:\\:wpRemotePost\\(\\) expects array, mixed given\\.$#"
|
message: "#^Parameter \\#2 \\$args of method MailPoet\\\\WP\\\\Functions\\:\\:wpRemotePost\\(\\) expects array, mixed given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -155,21 +170,11 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Cron/CronHelper.php
|
path: ../../lib/Cron/CronHelper.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Expression in empty\\(\\) is not falsy\\.$#"
|
|
||||||
count: 2
|
|
||||||
path: ../../lib/Cron/CronWorkerRunner.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#2 \\$str of function explode expects string, class\\-string\\|false given\\.$#"
|
message: "#^Parameter \\#2 \\$str of function explode expects string, class\\-string\\|false given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Cron/Daemon.php
|
path: ../../lib/Cron/Daemon.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot access offset 0 on mixed\\.$#"
|
|
||||||
count: 2
|
|
||||||
path: ../../lib/Cron/Workers/Beamer.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method MailPoet\\\\Cron\\\\Workers\\\\SendingQueue\\\\SendingThrottlingHandler\\:\\:getMaxBatchSize\\(\\) should return int but returns mixed\\.$#"
|
message: "#^Method MailPoet\\\\Cron\\\\Workers\\\\SendingQueue\\\\SendingThrottlingHandler\\:\\:getMaxBatchSize\\(\\) should return int but returns mixed\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -270,26 +275,11 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Form/DisplayFormInWPContent.php
|
path: ../../lib/Form/DisplayFormInWPContent.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Form/FormsRepository.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 2
|
|
||||||
path: ../../lib/Form/Listing/FormListingRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Expression on left side of \\?\\? is not nullable\\.$#"
|
message: "#^Expression on left side of \\?\\? is not nullable\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Form/Renderer.php
|
path: ../../lib/Form/Renderer.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Listing/ListingRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method MailPoet\\\\Listing\\\\ListingRepository\\:\\:getData\\(\\) should return array but returns mixed\\.$#"
|
message: "#^Method MailPoet\\\\Listing\\\\ListingRepository\\:\\:getData\\(\\) should return array but returns mixed\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -300,16 +290,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Models/Subscriber.php
|
path: ../../lib/Models/Subscriber.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$priority of method MailPoet\\\\WP\\\\Functions\\:\\:addAction\\(\\) expects int, mixed given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Newsletter/AutomatedLatestContent.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$priority of method MailPoet\\\\WP\\\\Functions\\:\\:removeAction\\(\\) expects int, mixed given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Newsletter/AutomatedLatestContent.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Variable \\$terms in empty\\(\\) always exists and is not falsy\\.$#"
|
message: "#^Variable \\$terms in empty\\(\\) always exists and is not falsy\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -325,16 +305,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Newsletter/AutomaticEmailsRepository.php
|
path: ../../lib/Newsletter/AutomaticEmailsRepository.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Newsletter/AutomaticEmailsRepository.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Property MailPoet\\\\Newsletter\\\\Editor\\\\PostTransformer\\:\\:\\$withLayout is never read, only written\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Newsletter/Editor/PostTransformer.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#1 \\$str of function strip_tags expects string, mixed given\\.$#"
|
message: "#^Parameter \\#1 \\$str of function strip_tags expects string, mixed given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -367,7 +337,7 @@ parameters:
|
|||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
message: "#^Cannot cast mixed to int\\.$#"
|
||||||
count: 3
|
count: 1
|
||||||
path: ../../lib/Newsletter/Listing/NewsletterListingRepository.php
|
path: ../../lib/Newsletter/Listing/NewsletterListingRepository.php
|
||||||
|
|
||||||
-
|
-
|
||||||
@ -391,7 +361,12 @@ parameters:
|
|||||||
path: ../../lib/Newsletter/NewsletterSaveController.php
|
path: ../../lib/Newsletter/NewsletterSaveController.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
message: "#^Cannot access offset string on non-empty-array\\<string, int\\>|int\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: ../../lib/Newsletter/NewslettersRepository.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 $array of function array_sum expects array, array\\<string, int\\>|int given\\.$#"
|
||||||
count: 2
|
count: 2
|
||||||
path: ../../lib/Newsletter/NewslettersRepository.php
|
path: ../../lib/Newsletter/NewslettersRepository.php
|
||||||
|
|
||||||
@ -430,16 +405,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Newsletter/Shortcodes/Categories/Link.php
|
path: ../../lib/Newsletter/Shortcodes/Categories/Link.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$priority of method MailPoet\\\\WP\\\\Functions\\:\\:addAction\\(\\) expects int, mixed given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Newsletter/Shortcodes/Categories/Newsletter.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$priority of method MailPoet\\\\WP\\\\Functions\\:\\:removeAction\\(\\) expects int, mixed given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Newsletter/Shortcodes/Categories/Newsletter.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
|
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -457,7 +422,7 @@ parameters:
|
|||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
message: "#^Cannot cast mixed to int\\.$#"
|
||||||
count: 3
|
count: 2
|
||||||
path: ../../lib/Newsletter/Statistics/NewsletterStatisticsRepository.php
|
path: ../../lib/Newsletter/Statistics/NewsletterStatisticsRepository.php
|
||||||
|
|
||||||
-
|
-
|
||||||
@ -465,16 +430,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Newsletter/Statistics/NewsletterStatisticsRepository.php
|
path: ../../lib/Newsletter/Statistics/NewsletterStatisticsRepository.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Else branch is unreachable because previous condition is always true\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Newsletter/ViewInBrowser/ViewInBrowserRenderer.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/NewsletterTemplates/NewsletterTemplatesRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method MailPoet\\\\NewsletterTemplates\\\\NewsletterTemplatesRepository\\:\\:findAllForListing\\(\\) should return array\\<MailPoet\\\\Entities\\\\NewsletterTemplateEntity\\> but returns mixed\\.$#"
|
message: "#^Method MailPoet\\\\NewsletterTemplates\\\\NewsletterTemplatesRepository\\:\\:findAllForListing\\(\\) should return array\\<MailPoet\\\\Entities\\\\NewsletterTemplateEntity\\> but returns mixed\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -580,21 +535,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Segments/DynamicSegments/Filters/WooCommerceTotalSpent.php
|
path: ../../lib/Segments/DynamicSegments/Filters/WooCommerceTotalSpent.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 2
|
|
||||||
path: ../../lib/Segments/SegmentListingRepository.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot access offset 'all' on mixed\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Segments/SegmentSubscribersRepository.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 3
|
|
||||||
path: ../../lib/Segments/SegmentSubscribersRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method MailPoet\\\\Segments\\\\SegmentSubscribersRepository\\:\\:getSubscribersGlobalStatusStatisticsCount\\(\\) should return array but returns mixed\\.$#"
|
message: "#^Method MailPoet\\\\Segments\\\\SegmentSubscribersRepository\\:\\:getSubscribersGlobalStatusStatisticsCount\\(\\) should return array but returns mixed\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -615,11 +555,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Segments/SegmentSubscribersRepository.php
|
path: ../../lib/Segments/SegmentSubscribersRepository.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Segments/SegmentsRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Cannot access offset 'id' on mixed\\.$#"
|
message: "#^Cannot access offset 'id' on mixed\\.$#"
|
||||||
count: 3
|
count: 3
|
||||||
@ -685,11 +620,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Settings/Hosts.php
|
path: ../../lib/Settings/Hosts.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to float\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Statistics/StatisticsOpensRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method MailPoet\\\\Subscribers\\\\ImportExport\\\\Import\\\\MailChimp\\:\\:getApiData\\(\\) should return array\\|null but returns mixed\\.$#"
|
message: "#^Method MailPoet\\\\Subscribers\\\\ImportExport\\\\Import\\\\MailChimp\\:\\:getApiData\\(\\) should return array\\|null but returns mixed\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -710,26 +640,11 @@ parameters:
|
|||||||
count: 2
|
count: 2
|
||||||
path: ../../lib/Subscribers/InactiveSubscribersController.php
|
path: ../../lib/Subscribers/InactiveSubscribersController.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 3
|
|
||||||
path: ../../lib/Subscribers/Statistics/SubscriberStatisticsRepository.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method MailPoet\\\\Subscribers\\\\Statistics\\\\SubscriberStatisticsRepository\\:\\:getTotalSentCount\\(\\) should return int but returns mixed\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Subscribers/Statistics/SubscriberStatisticsRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method MailPoet\\\\Subscribers\\\\SubscriberIPsRepository\\:\\:findOneByIPAndCreatedAtAfterTimeInSeconds\\(\\) should return MailPoet\\\\Entities\\\\SubscriberIPEntity\\|null but returns mixed\\.$#"
|
message: "#^Method MailPoet\\\\Subscribers\\\\SubscriberIPsRepository\\:\\:findOneByIPAndCreatedAtAfterTimeInSeconds\\(\\) should return MailPoet\\\\Entities\\\\SubscriberIPEntity\\|null but returns mixed\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Subscribers/SubscriberIPsRepository.php
|
path: ../../lib/Subscribers/SubscriberIPsRepository.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method MailPoet\\\\Subscribers\\\\SubscriberIPsRepository\\:\\:getCountByIPAndCreatedAtAfterTimeInSeconds\\(\\) should return int but returns mixed\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Subscribers/SubscriberIPsRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
|
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -756,7 +671,7 @@ parameters:
|
|||||||
path: ../../lib/Subscribers/SubscribersRepository.php
|
path: ../../lib/Subscribers/SubscribersRepository.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method MailPoet\\\\Subscribers\\\\SubscribersRepository\\:\\:findIdsOfDeletedByEmails\\(\\) should return array\\<int\\> but returns array\\<array\\<string, int\\>\\>\\.$#"
|
message: "#^Method MailPoet\\\\Subscribers\\\\SubscribersRepository\\:\\:findIdsOfDeletedByEmails\\(\\) should return array\\<int\\> but returns array\\<int, array\\<string, int\\>\\>\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Subscribers/SubscribersRepository.php
|
path: ../../lib/Subscribers/SubscribersRepository.php
|
||||||
|
|
||||||
@ -820,11 +735,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Tracy/DIPanel/DIPanel.php
|
path: ../../lib/Tracy/DIPanel/DIPanel.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$priority of method MailPoet\\\\WP\\\\Functions\\:\\:addAction\\(\\) expects int, mixed given\\.$#"
|
|
||||||
count: 4
|
|
||||||
path: ../../lib/Util/ConflictResolver.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#2 \\$str of function explode expects string, mixed given\\.$#"
|
message: "#^Parameter \\#2 \\$str of function explode expects string, mixed given\\.$#"
|
||||||
count: 2
|
count: 2
|
||||||
@ -835,16 +745,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Util/DBCollationChecker.php
|
path: ../../lib/Util/DBCollationChecker.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^While loop condition is always true\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Util/DOM.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method MailPoet\\\\Util\\\\ProgressBar\\:\\:readProgress\\(\\) should return array\\|false but returns mixed\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Util/ProgressBar.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, int given\\.$#"
|
message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, int given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -865,11 +765,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/WP/Functions.php
|
path: ../../lib/WP/Functions.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Expression on left side of \\?\\? is not nullable\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/WooCommerce/Helper.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Property MailPoet\\\\Test\\\\Doctrine\\\\EventListeners\\\\TimestampEntity\\:\\:\\$id is never written, only read\\.$#"
|
message: "#^Property MailPoet\\\\Test\\\\Doctrine\\\\EventListeners\\\\TimestampEntity\\:\\:\\$id is never written, only read\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -900,3 +795,18 @@ parameters:
|
|||||||
message: "#^Function str_(\\w+) not found.$#"
|
message: "#^Function str_(\\w+) not found.$#"
|
||||||
count: 4
|
count: 4
|
||||||
path: ../../lib/Automation/Integrations/Core/Filters/StringFilter.php
|
path: ../../lib/Automation/Integrations/Core/Filters/StringFilter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$args of function get_comments expects array\\{author_email\\?\\: string, author_url\\?\\: string, author__in\\?\\: array\\<int\\>, author__not_in\\?\\: array\\<int\\>, comment__in\\?\\: array\\<int\\>, comment__not_in\\?\\: array\\<int\\>, count\\?\\: bool, date_query\\?\\: array, \\.\\.\\.\\}, array\\|string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: ../../lib/Automation/Engine/WordPress.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$args of function get_terms expects array\\{taxonomy\\?\\: array\\<string\\>\\|string, object_ids\\?\\: array\\<int\\>\\|int, orderby\\?\\: string, order\\?\\: string, hide_empty\\?\\: bool\\|int, include\\?\\: array\\<int\\>\\|string, exclude\\?\\: array\\<int\\>\\|string, exclude_tree\\?\\: array\\<int\\>\\|string, \\.\\.\\.\\}, array\\|string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: ../../lib/Automation/Engine/WordPress.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Binary operation \"\\.\" between non-falsy-string and string\\|Stringable results in an error\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: ../../lib/Doctrine/Validator/ValidationException.php
|
||||||
|
@ -145,6 +145,21 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Config/Populator.php
|
path: ../../lib/Config/Populator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Binary operation \"\\.\" between non-falsy-string and array\\|string results in an error\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: ../../lib/Config/Populator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Binary operation \"\\.\" between '`t1`\\.`' and array\\|string results in an error\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: ../../lib/Config/Populator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Part \\$table \\(array\\|string\\) of encapsed string cannot be cast to string\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: ../../lib/Config/Populator.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#2 \\$args of method MailPoet\\\\WP\\\\Functions\\:\\:wpRemotePost\\(\\) expects array, mixed given\\.$#"
|
message: "#^Parameter \\#2 \\$args of method MailPoet\\\\WP\\\\Functions\\:\\:wpRemotePost\\(\\) expects array, mixed given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -155,21 +170,11 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Cron/CronHelper.php
|
path: ../../lib/Cron/CronHelper.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Expression in empty\\(\\) is not falsy\\.$#"
|
|
||||||
count: 2
|
|
||||||
path: ../../lib/Cron/CronWorkerRunner.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#2 \\$string of function explode expects string, class\\-string\\|false given\\.$#"
|
message: "#^Parameter \\#2 \\$string of function explode expects string, class\\-string\\|false given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Cron/Daemon.php
|
path: ../../lib/Cron/Daemon.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot access offset 0 on mixed\\.$#"
|
|
||||||
count: 2
|
|
||||||
path: ../../lib/Cron/Workers/Beamer.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method MailPoet\\\\Cron\\\\Workers\\\\SendingQueue\\\\SendingThrottlingHandler\\:\\:getMaxBatchSize\\(\\) should return int but returns mixed\\.$#"
|
message: "#^Method MailPoet\\\\Cron\\\\Workers\\\\SendingQueue\\\\SendingThrottlingHandler\\:\\:getMaxBatchSize\\(\\) should return int but returns mixed\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -270,26 +275,11 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Form/DisplayFormInWPContent.php
|
path: ../../lib/Form/DisplayFormInWPContent.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Form/FormsRepository.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 2
|
|
||||||
path: ../../lib/Form/Listing/FormListingRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Expression on left side of \\?\\? is not nullable\\.$#"
|
message: "#^Expression on left side of \\?\\? is not nullable\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Form/Renderer.php
|
path: ../../lib/Form/Renderer.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Listing/ListingRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method MailPoet\\\\Listing\\\\ListingRepository\\:\\:getData\\(\\) should return array but returns mixed\\.$#"
|
message: "#^Method MailPoet\\\\Listing\\\\ListingRepository\\:\\:getData\\(\\) should return array but returns mixed\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -300,16 +290,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Models/Subscriber.php
|
path: ../../lib/Models/Subscriber.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$priority of method MailPoet\\\\WP\\\\Functions\\:\\:addAction\\(\\) expects int, mixed given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Newsletter/AutomatedLatestContent.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$priority of method MailPoet\\\\WP\\\\Functions\\:\\:removeAction\\(\\) expects int, mixed given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Newsletter/AutomatedLatestContent.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Variable \\$terms in empty\\(\\) always exists and is not falsy\\.$#"
|
message: "#^Variable \\$terms in empty\\(\\) always exists and is not falsy\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -325,16 +305,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Newsletter/AutomaticEmailsRepository.php
|
path: ../../lib/Newsletter/AutomaticEmailsRepository.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Newsletter/AutomaticEmailsRepository.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Property MailPoet\\\\Newsletter\\\\Editor\\\\PostTransformer\\:\\:\\$withLayout is never read, only written\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Newsletter/Editor/PostTransformer.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#1 \\$string of function strip_tags expects string, mixed given\\.$#"
|
message: "#^Parameter \\#1 \\$string of function strip_tags expects string, mixed given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -367,7 +337,7 @@ parameters:
|
|||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
message: "#^Cannot cast mixed to int\\.$#"
|
||||||
count: 3
|
count: 1
|
||||||
path: ../../lib/Newsletter/Listing/NewsletterListingRepository.php
|
path: ../../lib/Newsletter/Listing/NewsletterListingRepository.php
|
||||||
|
|
||||||
-
|
-
|
||||||
@ -390,11 +360,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Newsletter/NewsletterSaveController.php
|
path: ../../lib/Newsletter/NewsletterSaveController.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 2
|
|
||||||
path: ../../lib/Newsletter/NewslettersRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method MailPoet\\\\Newsletter\\\\Renderer\\\\Renderer\\:\\:postProcessTemplate\\(\\) should return string but returns mixed\\.$#"
|
message: "#^Method MailPoet\\\\Newsletter\\\\Renderer\\\\Renderer\\:\\:postProcessTemplate\\(\\) should return string but returns mixed\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -430,16 +395,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Newsletter/Shortcodes/Categories/Link.php
|
path: ../../lib/Newsletter/Shortcodes/Categories/Link.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$priority of method MailPoet\\\\WP\\\\Functions\\:\\:addAction\\(\\) expects int, mixed given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Newsletter/Shortcodes/Categories/Newsletter.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$priority of method MailPoet\\\\WP\\\\Functions\\:\\:removeAction\\(\\) expects int, mixed given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Newsletter/Shortcodes/Categories/Newsletter.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
|
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -457,7 +412,7 @@ parameters:
|
|||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
message: "#^Cannot cast mixed to int\\.$#"
|
||||||
count: 3
|
count: 2
|
||||||
path: ../../lib/Newsletter/Statistics/NewsletterStatisticsRepository.php
|
path: ../../lib/Newsletter/Statistics/NewsletterStatisticsRepository.php
|
||||||
|
|
||||||
-
|
-
|
||||||
@ -465,16 +420,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Newsletter/Statistics/NewsletterStatisticsRepository.php
|
path: ../../lib/Newsletter/Statistics/NewsletterStatisticsRepository.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Else branch is unreachable because previous condition is always true\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Newsletter/ViewInBrowser/ViewInBrowserRenderer.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/NewsletterTemplates/NewsletterTemplatesRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method MailPoet\\\\NewsletterTemplates\\\\NewsletterTemplatesRepository\\:\\:findAllForListing\\(\\) should return array\\<MailPoet\\\\Entities\\\\NewsletterTemplateEntity\\> but returns mixed\\.$#"
|
message: "#^Method MailPoet\\\\NewsletterTemplates\\\\NewsletterTemplatesRepository\\:\\:findAllForListing\\(\\) should return array\\<MailPoet\\\\Entities\\\\NewsletterTemplateEntity\\> but returns mixed\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -580,21 +525,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Segments/DynamicSegments/Filters/WooCommerceTotalSpent.php
|
path: ../../lib/Segments/DynamicSegments/Filters/WooCommerceTotalSpent.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 2
|
|
||||||
path: ../../lib/Segments/SegmentListingRepository.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot access offset 'all' on mixed\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Segments/SegmentSubscribersRepository.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 3
|
|
||||||
path: ../../lib/Segments/SegmentSubscribersRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method MailPoet\\\\Segments\\\\SegmentSubscribersRepository\\:\\:getSubscribersGlobalStatusStatisticsCount\\(\\) should return array but returns mixed\\.$#"
|
message: "#^Method MailPoet\\\\Segments\\\\SegmentSubscribersRepository\\:\\:getSubscribersGlobalStatusStatisticsCount\\(\\) should return array but returns mixed\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -615,11 +545,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Segments/SegmentSubscribersRepository.php
|
path: ../../lib/Segments/SegmentSubscribersRepository.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Segments/SegmentsRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Cannot access offset 'id' on mixed\\.$#"
|
message: "#^Cannot access offset 'id' on mixed\\.$#"
|
||||||
count: 3
|
count: 3
|
||||||
@ -685,11 +610,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Settings/Hosts.php
|
path: ../../lib/Settings/Hosts.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to float\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Statistics/StatisticsOpensRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method MailPoet\\\\Subscribers\\\\ImportExport\\\\Import\\\\MailChimp\\:\\:getApiData\\(\\) should return array\\|null but returns mixed\\.$#"
|
message: "#^Method MailPoet\\\\Subscribers\\\\ImportExport\\\\Import\\\\MailChimp\\:\\:getApiData\\(\\) should return array\\|null but returns mixed\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -710,26 +630,11 @@ parameters:
|
|||||||
count: 2
|
count: 2
|
||||||
path: ../../lib/Subscribers/InactiveSubscribersController.php
|
path: ../../lib/Subscribers/InactiveSubscribersController.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Cannot cast mixed to int\\.$#"
|
|
||||||
count: 3
|
|
||||||
path: ../../lib/Subscribers/Statistics/SubscriberStatisticsRepository.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method MailPoet\\\\Subscribers\\\\Statistics\\\\SubscriberStatisticsRepository\\:\\:getTotalSentCount\\(\\) should return int but returns mixed\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Subscribers/Statistics/SubscriberStatisticsRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method MailPoet\\\\Subscribers\\\\SubscriberIPsRepository\\:\\:findOneByIPAndCreatedAtAfterTimeInSeconds\\(\\) should return MailPoet\\\\Entities\\\\SubscriberIPEntity\\|null but returns mixed\\.$#"
|
message: "#^Method MailPoet\\\\Subscribers\\\\SubscriberIPsRepository\\:\\:findOneByIPAndCreatedAtAfterTimeInSeconds\\(\\) should return MailPoet\\\\Entities\\\\SubscriberIPEntity\\|null but returns mixed\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Subscribers/SubscriberIPsRepository.php
|
path: ../../lib/Subscribers/SubscriberIPsRepository.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method MailPoet\\\\Subscribers\\\\SubscriberIPsRepository\\:\\:getCountByIPAndCreatedAtAfterTimeInSeconds\\(\\) should return int but returns mixed\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Subscribers/SubscriberIPsRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
|
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -756,7 +661,7 @@ parameters:
|
|||||||
path: ../../lib/Subscribers/SubscribersRepository.php
|
path: ../../lib/Subscribers/SubscribersRepository.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method MailPoet\\\\Subscribers\\\\SubscribersRepository\\:\\:findIdsOfDeletedByEmails\\(\\) should return array\\<int\\> but returns array\\<array\\<string, int\\>\\>\\.$#"
|
message: "#^Method MailPoet\\\\Subscribers\\\\SubscribersRepository\\:\\:findIdsOfDeletedByEmails\\(\\) should return array\\<int\\> but returns array\\<int, array\\<string, int\\>\\>\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Subscribers/SubscribersRepository.php
|
path: ../../lib/Subscribers/SubscribersRepository.php
|
||||||
|
|
||||||
@ -825,11 +730,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Tracy/DIPanel/DIPanel.php
|
path: ../../lib/Tracy/DIPanel/DIPanel.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$priority of method MailPoet\\\\WP\\\\Functions\\:\\:addAction\\(\\) expects int, mixed given\\.$#"
|
|
||||||
count: 4
|
|
||||||
path: ../../lib/Util/ConflictResolver.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#2 \\$string of function explode expects string, mixed given\\.$#"
|
message: "#^Parameter \\#2 \\$string of function explode expects string, mixed given\\.$#"
|
||||||
count: 2
|
count: 2
|
||||||
@ -840,16 +740,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Util/DBCollationChecker.php
|
path: ../../lib/Util/DBCollationChecker.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^While loop condition is always true\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Util/DOM.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Method MailPoet\\\\Util\\\\ProgressBar\\:\\:readProgress\\(\\) should return array\\|false but returns mixed\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/Util/ProgressBar.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, int given\\.$#"
|
message: "#^Parameter \\#1 \\$length of function random_bytes expects int\\<1, max\\>, int given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -870,11 +760,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/WP/Functions.php
|
path: ../../lib/WP/Functions.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Expression on left side of \\?\\? is not nullable\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/WooCommerce/Helper.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Property MailPoet\\\\Test\\\\Doctrine\\\\EventListeners\\\\TimestampEntity\\:\\:\\$id is never written, only read\\.$#"
|
message: "#^Property MailPoet\\\\Test\\\\Doctrine\\\\EventListeners\\\\TimestampEntity\\:\\:\\$id is never written, only read\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@ -899,3 +784,23 @@ parameters:
|
|||||||
message: "#^Method MailPoet\\\\Newsletter\\\\NewslettersRepository\\:\\:getStandardNewsletterList\\(\\) should return array\\<MailPoet\\\\Entities\\\\NewsletterEntity\\> but returns mixed\\.$#"
|
message: "#^Method MailPoet\\\\Newsletter\\\\NewslettersRepository\\:\\:getStandardNewsletterList\\(\\) should return array\\<MailPoet\\\\Entities\\\\NewsletterEntity\\> but returns mixed\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: ../../lib/Newsletter/NewslettersRepository.php
|
path: ../../lib/Newsletter/NewslettersRepository.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Cannot access offset string on non-empty-array\\<string, int\\>|int\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: ../../lib/Newsletter/NewslettersRepository.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 $array of function array_sum expects array, array\\<string, int\\>|int given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: ../../lib/Newsletter/NewslettersRepository.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$args of function get_comments expects array\\{author_email\\?\\: string, author_url\\?\\: string, author__in\\?\\: array\\<int\\>, author__not_in\\?\\: array\\<int\\>, comment__in\\?\\: array\\<int\\>, comment__not_in\\?\\: array\\<int\\>, count\\?\\: bool, date_query\\?\\: array, \\.\\.\\.\\}, array\\|string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: ../../lib/Automation/Engine/WordPress.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$args of function get_terms expects array\\{taxonomy\\?\\: array\\<string\\>\\|string, object_ids\\?\\: array\\<int\\>\\|int, orderby\\?\\: string, order\\?\\: string, hide_empty\\?\\: bool\\|int, include\\?\\: array\\<int\\>\\|string, exclude\\?\\: array\\<int\\>\\|string, exclude_tree\\?\\: array\\<int\\>\\|string, \\.\\.\\.\\}, array\\|string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: ../../lib/Automation/Engine/WordPress.php
|
||||||
|
@ -28,7 +28,6 @@ parameters:
|
|||||||
maximumNumberOfProcesses: 4
|
maximumNumberOfProcesses: 4
|
||||||
ignoreErrors:
|
ignoreErrors:
|
||||||
- '#Function members_register_.+ not found#'
|
- '#Function members_register_.+ not found#'
|
||||||
- '#Call to an undefined method MailPoetVendor\\Idiorm\\IdiormResultSet::set\(\)#'
|
|
||||||
- '#Argument of an invalid type MailPoetVendor\\pQuery\\IQuery supplied for foreach, only iterables are supported#'
|
- '#Argument of an invalid type MailPoetVendor\\pQuery\\IQuery supplied for foreach, only iterables are supported#'
|
||||||
|
|
||||||
# exclude level 6 errors (but keep them for Automation)
|
# exclude level 6 errors (but keep them for Automation)
|
||||||
@ -92,11 +91,6 @@ parameters:
|
|||||||
message: '/function add_(sub)?menu_page expects callable\(\): mixed, ''''\|\(callable\(\): mixed\) given/'
|
message: '/function add_(sub)?menu_page expects callable\(\): mixed, ''''\|\(callable\(\): mixed\) given/'
|
||||||
count: 2
|
count: 2
|
||||||
path: ../../lib/WP/Functions.php
|
path: ../../lib/WP/Functions.php
|
||||||
-
|
|
||||||
# WP Stubs contain incorrect definition form apply_filters: apply_filters( string $tag, array $args )
|
|
||||||
message: "#^Function apply_filters invoked with 3 parameters, 2 required\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../lib/EmailEditor/Engine/Renderer/Renderer.php
|
|
||||||
|
|
||||||
reportUnmatchedIgnoredErrors: true
|
reportUnmatchedIgnoredErrors: true
|
||||||
dynamicConstantNames:
|
dynamicConstantNames:
|
||||||
@ -104,6 +98,7 @@ parameters:
|
|||||||
- MAILPOET_PREMIUM_VERSION
|
- MAILPOET_PREMIUM_VERSION
|
||||||
doctrine:
|
doctrine:
|
||||||
objectManagerLoader: create-entity-manager.php
|
objectManagerLoader: create-entity-manager.php
|
||||||
|
allowNullablePropertyForRequiredField: false
|
||||||
|
|
||||||
# exclude level 6 errors
|
# exclude level 6 errors
|
||||||
checkMissingIterableValueType: false
|
checkMissingIterableValueType: false
|
||||||
@ -112,6 +107,7 @@ parameters:
|
|||||||
excludePaths:
|
excludePaths:
|
||||||
analyseAndScan:
|
analyseAndScan:
|
||||||
- ../../lib/Config/PopulatorData/Templates # analysis of templates is extremely slow, let's skip them for now
|
- ../../lib/Config/PopulatorData/Templates # analysis of templates is extremely slow, let's skip them for now
|
||||||
|
- ../../lib/Models # Old models are deprecated and will be removed soon
|
||||||
- ../../tests/_support/_generated
|
- ../../tests/_support/_generated
|
||||||
- ../../tests/integration/Models # Old models are deprecated and will be removed soon
|
- ../../tests/integration/Models # Old models are deprecated and will be removed soon
|
||||||
- ../../tests/unit/Entities/SubscriberEntityTest.php
|
- ../../tests/unit/Entities/SubscriberEntityTest.php
|
||||||
@ -122,5 +118,4 @@ includes:
|
|||||||
- vendor/phpstan/phpstan-phpunit/extension.neon
|
- vendor/phpstan/phpstan-phpunit/extension.neon
|
||||||
- vendor/phpstan/phpstan-doctrine/rules.neon
|
- vendor/phpstan/phpstan-doctrine/rules.neon
|
||||||
- vendor/szepeviktor/phpstan-wordpress/extension.neon
|
- vendor/szepeviktor/phpstan-wordpress/extension.neon
|
||||||
- php-version-dependent-config.php # PHP version detection + configuraton dependent on PHP version
|
|
||||||
- phpstan-baseline-fix-lib.php # include baseline files
|
- phpstan-baseline-fix-lib.php # include baseline files
|
||||||
|
Reference in New Issue
Block a user