Skip to content

Commit

Permalink
chore: Add Psalm
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
ChristophWurst committed Oct 31, 2023
1 parent 1b161c2 commit b8542ca
Show file tree
Hide file tree
Showing 6 changed files with 389 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ yarn-error.log*
js/
build/
coverage*
vendor/
/vendor
/vendor-bin/*/vendor

.php-cs-fixer.cache
composer.phar
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"platform": {
"php": "7.4"
},
"autoloader-suffix": "Contacts"
"autoloader-suffix": "Contacts",
"allow-plugins": {
"bamarni/composer-bin-plugin": true
}
},
"autoload": {
"psr-4": {
Expand All @@ -16,11 +19,13 @@
"cs:fix": "php-cs-fixer fix",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
"psalm": "psalm.phar",
"test:unit": "phpunit -c phpunit.xml --fail-on-warning",
"test:integration": "phpunit -c phpunit.integration.xml --fail-on-warning"
},
"require": {
"php": ">=7.4 <=8.3"
"php": ">=7.4 <=8.3",
"bamarni/composer-bin-plugin": "^1.8"
},
"require-dev": {
"christophwurst/nextcloud_testing": "^0.12.4",
Expand Down
62 changes: 60 additions & 2 deletions composer.lock

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

61 changes: 61 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?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"
>
<projectFiles>
<directory name="lib" />
<ignoreFiles>
<directory name="vendor" />
<directory name="vendor-bin/psalm/vendor/nextcloud/ocp" />
</ignoreFiles>
</projectFiles>
<extraFiles>
<directory name="vendor" />
<directory name="vendor-bin/psalm/vendor/nextcloud/ocp" />
</extraFiles>
<issueHandlers>
<UndefinedClass>
<errorLevel type="suppress">
<referencedClass name="Doctrine\DBAL\Platforms\MySQLPlatform" />
<referencedClass name="Doctrine\DBAL\Platforms\PostgreSQL94Platform" />
<referencedClass name="Doctrine\DBAL\Platforms\SqlitePlatform" />
<referencedClass name="Doctrine\DBAL\Types\Type" />
<referencedClass name="Doctrine\DBAL\Types\Types" />
<referencedClass name="IPLib\Factory" />
<referencedClass name="IPLib\Address\IPv6" />
<referencedClass name="OC" />
<referencedClass name="OC\Security\CSP\ContentSecurityPolicyNonceManager" />
<referencedClass name="OCA\DAV\CardDAV\ContactsManage" />
<referencedClass name="Symfony\Component\Console\Command\Command" />
<referencedClass name="Symfony\Component\Console\Input\InputArgument" />
<referencedClass name="Symfony\Component\Console\Input\InputInterface" />
<referencedClass name="Symfony\Component\Console\Input\InputOption" />
<referencedClass name="Symfony\Component\Console\Output\OutputInterface" />
<referencedClass name="OCP\TextProcessing\IManager" />
<referencedClass name="OCP\TextProcessing\SummaryTaskType" />
<referencedClass name="OCP\TextProcessing\Task" />
<referencedClass name="OCP\TextProcessing\SummaryTaskType" />
</errorLevel>
</UndefinedClass>
<UndefinedDocblockClass>
<errorLevel type="suppress">
<referencedClass name="Doctrine\DBAL\Driver\Statement" />
<referencedClass name="Doctrine\DBAL\Platforms\AbstractPlatform" />
<referencedClass name="Doctrine\DBAL\Schema\Schema" />
<referencedClass name="Doctrine\DBAL\Schema\SchemaException" />
<referencedClass name="Doctrine\DBAL\Schema\Table" />
<referencedClass name="OC\Security\CSP\ContentSecurityPolicyNonceManager" />
<referencedClass name="Symfony\Component\Console\Output\OutputInterface" />
</errorLevel>
</UndefinedDocblockClass>
<UndefinedFunction>
<errorLevel type="suppress">
<referencedFunction name="str_contains" />
</errorLevel>
</UndefinedFunction>
</issueHandlers>
</psalm>
11 changes: 11 additions & 0 deletions vendor-bin/psalm/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"config": {
"platform": {
"php": "7.4"
}
},
"require": {
"psalm/phar": "^5.15",
"nextcloud/ocp": "25"
}
}
Loading

0 comments on commit b8542ca

Please sign in to comment.