Skip to content

Commit

Permalink
Merge branch 'pu/ps/phpcs' into '2024.11'
Browse files Browse the repository at this point in the history
conf(composer): add phpcs command

See merge request tine20/tine20!4843
  • Loading branch information
pschuele committed Jan 29, 2024
2 parents d24b0f6 + d8db3e0 commit 1cc3d34
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
7 changes: 6 additions & 1 deletion tine20/Bookmarks/Frontend/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ public function getDefaultBookmarksContainers(): array
{
$user = Tinebase_Core::getUser();
try {
$defaultBookmarksContainers = Tinebase_Container::getInstance()->getPersonalContainer($user, Bookmarks_Model_Bookmark::class, $user, Tinebase_Model_Grants::GRANT_ADMIN);
$defaultBookmarksContainers = Tinebase_Container::getInstance()->getPersonalContainer(
$user,
Bookmarks_Model_Bookmark::class,
$user,
Tinebase_Model_Grants::GRANT_ADMIN
);
} catch (Tinebase_Exception_NotFound $e) {
return [];
}
Expand Down
6 changes: 4 additions & 2 deletions tine20/Setup/SchemaTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ public static function getConfig(array $models = [])
try {
/** @var Tinebase_Record_Interface $modelName */
foreach ($mappingDriver->getAllClassNames($models) as $modelName) {
if (null !== ($modelConfig = $modelName::getConfiguration()) &&
null !== ($tblName = $modelConfig->getTableName())) {
if (
null !== ($modelConfig = $modelName::getConfiguration()) &&
null !== ($tblName = $modelConfig->getTableName())
) {
$tableNames[] = SQL_TABLE_PREFIX . $tblName;
}
}
Expand Down
18 changes: 11 additions & 7 deletions tine20/Tasks/Setup/Update/16.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Tasks_Setup_Update_16
*
Expand Down Expand Up @@ -26,10 +27,10 @@
*/
class Tasks_Setup_Update_16 extends Setup_Update_Abstract
{
const RELEASE016_UPDATE000 = __CLASS__ . '::update000';
const RELEASE016_UPDATE001 = __CLASS__ . '::update001';
const RELEASE016_UPDATE002 = __CLASS__ . '::update002';
const RELEASE016_UPDATE003 = __CLASS__ . '::update003';
protected const RELEASE016_UPDATE000 = __CLASS__ . '::update000';
protected const RELEASE016_UPDATE001 = __CLASS__ . '::update001';
protected const RELEASE016_UPDATE002 = __CLASS__ . '::update002';
protected const RELEASE016_UPDATE003 = __CLASS__ . '::update003';

static protected $_allUpdates = [
self::PRIO_NORMAL_APP_STRUCTURE => [
Expand Down Expand Up @@ -85,7 +86,8 @@ public function update002()
Tinebase_TransactionManager::getInstance()->rollBack();

$this->getDb()->update(
SQL_TABLE_PREFIX . Tasks_Model_Task::TABLE_NAME, ['percent' => 0],
SQL_TABLE_PREFIX . Tasks_Model_Task::TABLE_NAME,
['percent' => 0],
'`percent` is null'
);

Expand All @@ -111,12 +113,14 @@ public function update003(): void

Tinebase_PersistentFilter::getInstance()->deleteByFilter(
Tinebase_Model_Filter_FilterGroup::getFilterForModel(
Tinebase_Model_PersistentFilterFilter::class, [
Tinebase_Model_PersistentFilterFilter::class,
[
['field' => 'model', 'operator' => 'equals', 'value' => 'Tasks_Model_TaskFilter'],
['field' => 'application_id', 'operator' => 'equals', 'value' =>
Tinebase_Application::getInstance()->getApplicationByName('Tasks')->getId()],
['field' => 'name', 'operator' => 'startswith', 'value' => 'To be done for me'],
], _options: ['ignoreAcl' => true]
],
_options: ['ignoreAcl' => true]
)
);

Expand Down
3 changes: 2 additions & 1 deletion tine20/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@
"scripts": {
"test": "./vendor/bin/phing phpunit-prepare phpunit-exec",
"phpunit": "./vendor/bin/phing phpunit-prepare phpunit-exec",
"build": "./vendor/bin/phing"
"build": "./vendor/bin/phing",
"phpcs": "./vendor/bin/phpcs -s --standard=PSR12 --report=full --exclude=PSR1.Classes.ClassDeclaration,Squiz.Classes.ValidClassName,PSR2.Classes.PropertyDeclaration,PSR2.Methods.MethodDeclaration --extensions=php --ignore=vendor,library,Tinebase/views/autodiscover,Tinebase/js,config.inc.php --basepath=. ."
},
"support": {
"issues": "https://github.com/tine20/Tine-2.0-Open-Source-Groupware-and-CRM/issues",
Expand Down

0 comments on commit 1cc3d34

Please sign in to comment.