Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
### Maintenance
- Add Typescript support
[#2059](https://github.com/nextcloud/cookbook/pull/2059) @seyfeb
- Update coding standards
[#2122](https://github.com/nextcloud/cookbook/pull/2122) @dependabot

## 0.11.0 - 2023-12-14

Expand Down
24 changes: 12 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/Controller/Implementation/RecipeImplementation.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function show($id) {

$json = $this->service->getRecipeById($id);

if (null === $json) {
if ($json === null) {
return new JSONResponse($id, Http::STATUS_NOT_FOUND);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Helper/Filter/JSON/FixToolsFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function apply(array &$json): bool {
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]);
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/JsonService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function testList(): void {
'folder' => $folder,
'update_interval' => $interval,
'print_image' => $printImage,
'visibleInfoBlocks' => array(),
'visibleInfoBlocks' => [],
];

$this->userFolder->method('getPath')->willReturn($folder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ private function getExpectedRecipes($recipes): array {
$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']]];
Expand Down