-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b62558
commit ad6f042
Showing
9 changed files
with
283 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# This workflow is provided via the organization template repository | ||
# | ||
# https://github.com/nextcloud/.github | ||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization | ||
|
||
name: Static analysis | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'lib/**' | ||
- 'templates/**' | ||
- 'tests/**' | ||
- 'vendor/**' | ||
- 'vendor-bin/**' | ||
- composer.lock | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- stable* | ||
|
||
concurrency: | ||
group: psalm-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
static-analysis: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
php-versions: [ '8.1', '8.2' ] | ||
server-versions: [ 'dev-master' ] | ||
fail-fast: false | ||
|
||
name: Nextcloud | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
|
||
- name: Set up php | ||
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
coverage: none | ||
ini-file: development | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer require --with-all-dependencies nextcloud/ocp:${{ matrix.server-versions }} | ||
- name: Run coding standards check | ||
run: composer run psalm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0"?> | ||
<psalm | ||
errorLevel="4" | ||
resolveFromConfigFile="true" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="https://getpsalm.org/schema/config" | ||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" | ||
errorBaseline="tests/psalm-baseline.xml" | ||
> | ||
<!-- | ||
SPDX-FileCopyrightText: Marcel Klehr <mklehr@gmx.net> | ||
SPDX-License-Identifier: CC0-1.0 | ||
--> | ||
<stubs> | ||
<file name="tests/stub.phpstub" preloadClasses="true"/> | ||
</stubs> | ||
<projectFiles> | ||
<directory name="lib" /> | ||
<ignoreFiles> | ||
<directory name="vendor" /> | ||
</ignoreFiles> | ||
</projectFiles> | ||
<extraFiles> | ||
<directory name="vendor" /> | ||
<ignoreFiles> | ||
<directory name="vendor/psalm" /> | ||
</ignoreFiles> | ||
</extraFiles> | ||
<issueHandlers> | ||
<UndefinedDocblockClass> | ||
<errorLevel type="suppress"> | ||
<referencedClass name="OC\AppFramework\OCS\BaseResponse"/> | ||
<referencedClass name="Doctrine\DBAL\Schema\Schema" /> | ||
<referencedClass name="Doctrine\DBAL\Schema\SchemaException" /> | ||
<referencedClass name="Doctrine\DBAL\Driver\Statement" /> | ||
<referencedClass name="Doctrine\DBAL\Schema\Table" /> | ||
</errorLevel> | ||
</UndefinedDocblockClass> | ||
</issueHandlers> | ||
</psalm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352"> | ||
<file src="lib/AppInfo/Application.php"> | ||
<InvalidArgument> | ||
<code>CwydTextProcessingProvider::class</code> | ||
</InvalidArgument> | ||
</file> | ||
<file src="lib/BackgroundJobs/IndexerJob.php"> | ||
<UndefinedClass> | ||
<code>\OC_Util</code> | ||
</UndefinedClass> | ||
</file> | ||
<file src="lib/Command/ScanFiles.php"> | ||
<UndefinedClass> | ||
<code>Command</code> | ||
</UndefinedClass> | ||
</file> | ||
<file src="lib/Service/LangRopeService.php"> | ||
<UndefinedClass> | ||
<code>\OCA\AppAPI\Db\ExApp</code> | ||
<code>\OCA\AppAPI\Service\AppAPIService</code> | ||
</UndefinedClass> | ||
</file> | ||
</files> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
namespace OC\Hooks { | ||
class Emitter { | ||
public function emit(string $class, string $value, array $option) {} | ||
/** Closure $closure */ | ||
public function listen(string $class, string $value, $closure) {} | ||
} | ||
} | ||
|
||
namespace OC { | ||
class SystemConfig { | ||
public function getKeys(); | ||
public function setValue($key, $value); | ||
public function setValues(array $configs); | ||
public function getValue($key, $default = ''); | ||
public function getFilteredValue($key, $default = ''); | ||
public function deleteValue($key); | ||
} | ||
} | ||
|
||
|
||
namespace OC\Files\Cache { | ||
class CacheQueryBuilder extends \OCP\DB\QueryBuilder\IQueryBuilder { | ||
public function __construct(\OCP\IDBCOnnection $db, \OC\SystemConfig $config, \Psr\Log\LoggerInterface $logger); | ||
public function selectFileCache(string $alias = null, bool $joinExtendedCache = true):CacheQueryBuilder; | ||
public function whereStorageId(int $storageId):CacheQueryBuilder; | ||
public function whereFileId(int $fileId):CacheQueryBuilder; | ||
public function wherePath(string $path):CacheQueryBuilder; | ||
public function whereParent(int $parent):CacheQueryBuilder; | ||
public function whereParentInParameter(string $parameter):CacheQueryBuilder; | ||
} | ||
} | ||
|
||
namespace Doctrine\DBAL { | ||
final class ParameterType | ||
{ | ||
/** | ||
* Represents the SQL NULL data type. | ||
*/ | ||
public const NULL = 0; | ||
|
||
/** | ||
* Represents the SQL INTEGER data type. | ||
*/ | ||
public const INTEGER = 1; | ||
|
||
/** | ||
* Represents the SQL CHAR, VARCHAR, or other string data type. | ||
* | ||
* @see \PDO::PARAM_STR | ||
*/ | ||
public const STRING = 2; | ||
|
||
/** | ||
* Represents the SQL large object data type. | ||
*/ | ||
public const LARGE_OBJECT = 3; | ||
|
||
/** | ||
* Represents a boolean data type. | ||
* | ||
* @see \PDO::PARAM_BOOL | ||
*/ | ||
public const BOOLEAN = 5; | ||
|
||
/** | ||
* Represents a binary string data type. | ||
*/ | ||
public const BINARY = 16; | ||
|
||
/** | ||
* Represents an ASCII string data type | ||
*/ | ||
public const ASCII = 17; | ||
|
||
/** | ||
* This class cannot be instantiated. | ||
* | ||
* @codeCoverageIgnore | ||
*/ | ||
private function __construct() | ||
{ | ||
} | ||
} | ||
|
||
final class ArrayParameterType | ||
{ | ||
/** | ||
* Represents an array of ints to be expanded by Doctrine SQL parsing. | ||
*/ | ||
public const INTEGER = ParameterType::INTEGER + Connection::ARRAY_PARAM_OFFSET; | ||
|
||
/** | ||
* Represents an array of strings to be expanded by Doctrine SQL parsing. | ||
*/ | ||
public const STRING = ParameterType::STRING + Connection::ARRAY_PARAM_OFFSET; | ||
|
||
/** | ||
* Represents an array of ascii strings to be expanded by Doctrine SQL parsing. | ||
*/ | ||
public const ASCII = ParameterType::ASCII + Connection::ARRAY_PARAM_OFFSET; | ||
|
||
/** | ||
* Represents an array of ascii strings to be expanded by Doctrine SQL parsing. | ||
*/ | ||
public const BINARY = ParameterType::BINARY + Connection::ARRAY_PARAM_OFFSET; | ||
|
||
/** | ||
* @internal | ||
* | ||
* @psalm-param self::* $type | ||
* | ||
* @psalm-return ParameterType::INTEGER|ParameterType::STRING|ParameterType::ASCII|ParameterType::BINARY | ||
*/ | ||
public static function toElementParameterType(int $type): int | ||
{ | ||
} | ||
|
||
private function __construct() | ||
{ | ||
} | ||
} | ||
|
||
class Connection { | ||
/** | ||
* Represents an array of ints to be expanded by Doctrine SQL parsing. | ||
*/ | ||
public const PARAM_INT_ARRAY = ParameterType::INTEGER + self::ARRAY_PARAM_OFFSET; | ||
|
||
/** | ||
* Represents an array of strings to be expanded by Doctrine SQL parsing. | ||
*/ | ||
public const PARAM_STR_ARRAY = ParameterType::STRING + self::ARRAY_PARAM_OFFSET; | ||
|
||
/** | ||
* Offset by which PARAM_* constants are detected as arrays of the param type. | ||
*/ | ||
public const ARRAY_PARAM_OFFSET = 100; | ||
} | ||
} |