Skip to content
Open
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: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COPY composer.json /src/
RUN composer install --ignore-platform-reqs --optimize-autoloader \
--no-plugins --no-scripts --prefer-dist

FROM php:8.3.3-cli-alpine3.19 as final
FROM php:8.4.21-cli-alpine3.23 as final

LABEL maintainer="team@appwrite.io"

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
},
"minimum-stability": "stable",
"require": {
"php": ">=8.0",
"php": ">=8.4",
"utopia-php/fetch": "^1.1",
"utopia-php/database": "5.*",
"utopia-php/query": "0.1.*"
"utopia-php/query": "^0.3.2"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"utopia-php/cache": "1.*",
"phpstan/phpstan": "1.*",
"phpstan/phpstan": "^2.0",
"laravel/pint": "1.*"
},
"autoload": {
Expand Down
390 changes: 183 additions & 207 deletions composer.lock

Large diffs are not rendered by default.

199 changes: 199 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
parameters:
ignoreErrors:
-
message: '#^Call to function is_array\(\) with array\<string, mixed\> will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset ''agg_val'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset ''agg_value'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset ''bucket'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset ''metric'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 3
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset ''ping'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset ''total'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 6
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset ''uptime'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset ''version'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot access offset 0 on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 7
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot cast mixed to float\.$#'
identifier: cast.double
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot cast mixed to int\.$#'
identifier: cast.int
count: 9
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Cannot cast mixed to string\.$#'
identifier: cast.string
count: 5
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Method Utopia\\Usage\\Adapter\\ClickHouse\:\:getTimeSeriesFromTable\(\) should return array\<string, array\{total\: float, data\: array\<array\{value\: float, date\: string\}\>\}\> but returns array\<array\{total\: 0\|float, data\: list\<array\{value\: float, date\: string\}\>\}\>\.$#'
identifier: return.type
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Parameter \#1 \$input of class Utopia\\Usage\\Metric constructor expects array\<string, mixed\>, array\<mixed\> given\.$#'
identifier: argument.type
count: 2
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Part \$metricName \(mixed\) of encapsed string cannot be cast to string\.$#'
identifier: encapsedStringPart.nonString
count: 1
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Possibly invalid array key type mixed\.$#'
identifier: offsetAccess.invalidOffset
count: 10
path: src/Usage/Adapter/ClickHouse.php

-
message: '#^Method Utopia\\Usage\\Metric\:\:getTags\(\) should return array\<string, mixed\> but returns array\<mixed\>\.$#'
identifier: return.type
count: 1
path: src/Usage/Metric.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<Utopia\\Usage\\Metric\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/Usage/Adapter/ClickHouseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<string, array\{total\: float, data\: array\<array\{value\: float, date\: string\}\>\}\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/Usage/Adapter/ClickHouseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<string, int\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 2
path: tests/Usage/Adapter/ClickHouseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<string, mixed\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/Usage/Adapter/ClickHouseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\{healthy\: bool, host\: string, port\: int, database\: string, secure\: bool, version\?\: string, uptime\?\: int, error\?\: string, \.\.\.\} will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/Usage/Adapter/ClickHouseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\{request_count\: int, keep_alive_enabled\: bool, compression_enabled\: bool, query_logging_enabled\: bool, max_retries\: int, retry_delay\: int, async_inserts\: bool, async_insert_wait\: bool\} will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/Usage/Adapter/ClickHouseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsInt\(\) with int will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 3
path: tests/Usage/Adapter/ClickHouseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 2
path: tests/Usage/Adapter/ClickHouseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<string, array\{total\: float, data\: array\<array\{value\: float, date\: string\}\>\}\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/Usage/Adapter/DatabaseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<string, int\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 2
path: tests/Usage/Adapter/DatabaseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<string, mixed\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/Usage/Adapter/DatabaseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\{healthy\: bool, database\?\: string, collection\?\: string, error\?\: string\} will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 1
path: tests/Usage/Adapter/DatabaseTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<int, array\<string, mixed\>\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 4
path: tests/Usage/MetricTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array\<string, mixed\> will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 2
path: tests/Usage/MetricTest.php

-
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
identifier: method.alreadyNarrowedType
count: 6
path: tests/Usage/MetricTest.php
Comment thread
greptile-apps[bot] marked this conversation as resolved.
8 changes: 8 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
includes:
- phpstan-baseline.neon

parameters:
level: max
paths:
- src
- tests
Loading
Loading