Fix easy errors found by PHPStan
[MAILPOET-2588]
This commit is contained in:
@ -27,13 +27,14 @@ class Analytics {
|
||||
$this->wp = new WPFunctions;
|
||||
}
|
||||
|
||||
/** @return array */
|
||||
/** @return array|null */
|
||||
function generateAnalytics() {
|
||||
if ($this->shouldSend()) {
|
||||
$data = $this->wp->applyFilters(self::ANALYTICS_FILTER, $this->reporter->getData());
|
||||
$this->recordDataSent();
|
||||
return $data;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/** @return boolean */
|
||||
|
@ -770,7 +770,7 @@ class MP2Migrator {
|
||||
* Import a subscriber custom field
|
||||
*
|
||||
* @param int $subscriber_id Subscriber ID
|
||||
* @param int $custom_field Custom field
|
||||
* @param array $custom_field Custom field
|
||||
* @param string $custom_field_value Custom field value
|
||||
* @return SubscriberCustomField
|
||||
*/
|
||||
|
@ -60,10 +60,12 @@ class MetadataCache extends CacheProvider {
|
||||
if ($result === false) {
|
||||
throw new \RuntimeException("Error while writing to '$filename'");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function doDelete($id) {
|
||||
@unlink($this->getFilename($id));
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function doFlush() {
|
||||
@ -72,6 +74,7 @@ class MetadataCache extends CacheProvider {
|
||||
@unlink($filename);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function doGetStats() {
|
||||
|
@ -342,8 +342,8 @@ class NewsletterEntity {
|
||||
}
|
||||
} catch (EntityNotFoundException $enf) {
|
||||
$this->setParent(null);
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -126,6 +126,7 @@ class ScheduledTask extends Model {
|
||||
ORM::get_db()->rollBack();
|
||||
throw $error;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function rescheduleProgressively() {
|
||||
|
@ -89,6 +89,7 @@ class Subscriber extends Model {
|
||||
SubscriberCustomField::deleteSubscriberRelations($this);
|
||||
return parent::delete();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function trash() {
|
||||
|
@ -42,7 +42,7 @@ class ApiPanel implements IBarPanel {
|
||||
}
|
||||
|
||||
static function init($endpoint, $request_method, $request_data) {
|
||||
Debugger::getBar()->addPanel(new static($endpoint, $request_method, $request_data));
|
||||
Debugger::getBar()->addPanel(new ApiPanel($endpoint, $request_method, $request_data));
|
||||
}
|
||||
|
||||
private function getEndpointName() {
|
||||
|
@ -38,7 +38,7 @@ class DIPanel implements IBarPanel {
|
||||
}
|
||||
|
||||
static function init() {
|
||||
Debugger::getBar()->addPanel(new static());
|
||||
Debugger::getBar()->addPanel(new DIPanel());
|
||||
}
|
||||
|
||||
private function loadServices() {
|
||||
|
@ -41,7 +41,7 @@ class DoctrinePanel implements IBarPanel {
|
||||
}
|
||||
|
||||
static function init(EntityManagerInterface $entity_manager) {
|
||||
Debugger::getBar()->addPanel(new static($entity_manager->getConnection()->getConfiguration()));
|
||||
Debugger::getBar()->addPanel(new DoctrinePanel($entity_manager->getConnection()->getConfiguration()));
|
||||
}
|
||||
|
||||
protected function formatSql($sql) {
|
||||
|
Reference in New Issue
Block a user