Skip to content

Commit

Permalink
phpcs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jensschuppe committed Dec 15, 2023
1 parent 463b223 commit 50205db
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
5 changes: 4 additions & 1 deletion CRM/Eck/Form/EntityType.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ public function preProcess() {
throw new Exception(E::ts('No ECK entity type given.'));
}
try {
$this->_entityType = EckEntityType::get(FALSE)->addWhere('name', '=', $this->_entityTypeName)->execute()->single();
$this->_entityType = EckEntityType::get(FALSE)
->addWhere('name', '=', $this->_entityTypeName)
->execute()
->single();
}
catch (Exception $exception) {
throw new Exception(E::ts('Invalid ECK entity type.'));
Expand Down
10 changes: 7 additions & 3 deletions CRM/Eck/Upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ public function upgrade_0010() {
* Implements hook_civicrm_upgrade_N().
*/
public function upgrade_0011() {
$entityTypes = CRM_Core_DAO::executeQuery(
'SELECT *, CONCAT("Eck_", name) AS entity_name, CONCAT("civicrm_eck_", LOWER(name)) AS table_name FROM `civicrm_eck_entity_type`;'
)->fetchAll();
$entityTypes = CRM_Core_DAO::executeQuery('
SELECT
*,
CONCAT("Eck_", name) AS entity_name,
CONCAT("civicrm_eck_", LOWER(name)) AS table_name
FROM `civicrm_eck_entity_type`;
')->fetchAll();

foreach ($entityTypes as $tableName => $entityType) {
$tableName = $entityType['table_name'];
Expand Down
10 changes: 5 additions & 5 deletions Civi/Api4/EckEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,39 +153,39 @@ public static function permissions(string $entityName):array {
[
Permissions::ADMINISTER_CIVICRM,
Permissions::ADMINISTER_ECK_ENTITIES,
]
],
],
'get' => [
Permissions::ACCESS_CIVICRM,
[
Permissions::ADMINISTER_ECK_ENTITIES,
Permissions::VIEW_ANY_ECK_ENTITY,
Permissions::getTypePermissionName(Permissions::ACTION_VIEW, $type),
]
],
],
'create' => [
Permissions::ACCESS_CIVICRM,
[
Permissions::ADMINISTER_ECK_ENTITIES,
Permissions::EDIT_ANY_ECK_ENTITY,
Permissions::getTypePermissionName(Permissions::ACTION_EDIT, $type),
]
],
],
'update' => [
Permissions::ACCESS_CIVICRM,
[
Permissions::ADMINISTER_ECK_ENTITIES,
Permissions::EDIT_ANY_ECK_ENTITY,
Permissions::getTypePermissionName(Permissions::ACTION_EDIT, $type),
]
],
],
'delete' => [
Permissions::ACCESS_CIVICRM,
[
Permissions::ADMINISTER_ECK_ENTITIES,
Permissions::DELETE_ANY_ECK_ENTITY,
Permissions::getTypePermissionName(Permissions::ACTION_DELETE, $type),
]
],
],
];
}
Expand Down
3 changes: 3 additions & 0 deletions tests/phpunit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// phpcs:disable
eval(cv('php:boot --level=classloader', 'phpcode'));
// phpcs:enable

// phpcs:disable PSR1.Files.SideEffects

// Allow autoloading of PHPUnit helper classes in this extension.
$loader = new \Composer\Autoload\ClassLoader();
$loader->add('CRM_', __DIR__);
Expand Down

0 comments on commit 50205db

Please sign in to comment.