Unverified Commit a5f202d3 authored by alexpott's avatar alexpott
Browse files

Issue #3257654 by mondrake: Fix PHPStan L0 failures that cannot be included in baseline

(cherry picked from commit a0b2090a)
parent 5bff9c8e
......@@ -73,6 +73,8 @@ public function guessMimeType(string $path) : ?string {
return $mime_type;
}
}
return NULL;
}
/**
......
......@@ -118,6 +118,7 @@ public function isEmpty() {
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset) {
$this->ensureComputedValue();
return parent::offsetExists($offset);
......
......@@ -30,6 +30,7 @@ public function get($index) {
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset) {
// For consistency with what happens in get(), we force offsetExists() to
// be TRUE for delta 0.
......
......@@ -113,6 +113,7 @@ public function getIds() {
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function count($refresh = FALSE) {
// We do not want this source plugin to have a cacheable count.
// @see \Drupal\migrate_cache_counts_test\Plugin\migrate\source\CacheableEmbeddedDataSource
......
......@@ -18,6 +18,7 @@ class CacheableEmbeddedDataSource extends EmbeddedDataSource {
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function count($refresh = FALSE) {
return SourcePluginBase::count($refresh);
}
......
......@@ -242,6 +242,7 @@ public function query() {
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function count($refresh = FALSE) {
// If no translations are included, then a simple query is possible.
if (!$this->configuration['include_translations']) {
......
......@@ -17,11 +17,9 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE
// Enforce a recoverable error.
$callable = function (ErrorContainer $container) {
};
$callable(1);
}
else {
return parent::get($id, $invalidBehavior);
return $callable(1);
}
return parent::get($id, $invalidBehavior);
}
}
......@@ -436,7 +436,7 @@ public function methodWithParameter($parameter) {
class TestServiceComplexMethod {
public function complexMethod(string $parameter, callable $function, TestServiceNoMethod $test_service = NULL, array &$elements = []): array {
return [];
}
}
......@@ -444,7 +444,7 @@ public function complexMethod(string $parameter, callable $function, TestService
class TestServiceNullableTypehintSelf {
public function typehintSelf(?self $parameter): ?self {
return NULL;
}
}
......
......@@ -51,9 +51,13 @@ public function testProcessLegacy() {
class NewMimeTypeGuesser implements MimeTypeGuesserInterface {
public function guessMimeType(string $string): string {}
public function guessMimeType(string $string): string {
return '';
}
public function isGuesserSupported(): bool {}
public function isGuesserSupported(): bool {
return TRUE;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment