Make PHP code linter happz again

Signed-off-by: Christian Wolf <github@christianwolf.email>
This commit is contained in:
Christian Wolf 2024-02-13 10:21:56 +01:00
Родитель a4638e1a93
Коммит 446cc80277
5 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -92,7 +92,7 @@ class RecipeImplementation {
$json = $this->service->getRecipeById($id);
if (null === $json) {
if ($json === null) {
return new JSONResponse($id, Http::STATUS_NOT_FOUND);
}

Просмотреть файл

@ -44,7 +44,7 @@ class FixToolsFilter extends AbstractJSONFilter {
throw new InvalidRecipeException($this->l->t('Could not parse recipe tools. Expected array or string.'));
}
$tools = array();
$tools = [];
if (!is_array($json[self::TOOLS])) {
$t = trim($json[self::TOOLS]);

Просмотреть файл

@ -20,7 +20,7 @@ class JsonService {
* @param bool $uniqueType If false, also accept JSON objects that contain multiple types as @type.
* @return bool true, if $obj is an object and optionally satisfies the type check
*/
public function isSchemaObject($obj, string $type = null, bool $checkContext = true, bool $uniqueType = true): bool {
public function isSchemaObject($obj, ?string $type = null, bool $checkContext = true, bool $uniqueType = true): bool {
if (!is_array($obj)) {
// Objects must bve encoded as arrays in JSON
return false;

Просмотреть файл

@ -88,7 +88,7 @@ class ConfigImplementationTest extends TestCase {
'folder' => $folder,
'update_interval' => $interval,
'print_image' => $printImage,
'visibleInfoBlocks' => array(),
'visibleInfoBlocks' => [],
];
$this->userFolder->method('getPath')->willReturn($folder);

Просмотреть файл

@ -204,7 +204,7 @@ class RecipeImplementationTest extends TestCase {
$this->urlGenerator->method('linkToRoute')->with(
'cookbook.recipe.image',
$this->callback(function ($p) use ($ids) {
return isset($p['id']) && isset($p['size']) && false !== array_search($p['id'], $ids);
return isset($p['id']) && isset($p['size']) && array_search($p['id'], $ids) !== false;
})
)->willReturnCallback(function ($name, $p) use ($ret) {
// return $ret[$idx[$p['id']]];