From 0770b5ed17c914026495853b96579cb529060640 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 3 May 2019 16:33:54 -0700 Subject: [PATCH] Api4/Afform.php - Fix callback notation. Cleanup style. --- ext/afform/core/Civi/Api4/Afform.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ext/afform/core/Civi/Api4/Afform.php b/ext/afform/core/Civi/Api4/Afform.php index 8856f3bbe1..d32fa0f60e 100644 --- a/ext/afform/core/Civi/Api4/Afform.php +++ b/ext/afform/core/Civi/Api4/Afform.php @@ -15,7 +15,7 @@ use Civi\Api4\Generic\BasicUpdateAction; class Afform extends AbstractEntity { /** - * @return BasicGetAction + * @return \Civi\Api4\Generic\BasicGetAction */ public static function get() { return new BasicGetAction('Afform', __FUNCTION__, function(BasicGetAction $action) { @@ -47,14 +47,14 @@ class Afform extends AbstractEntity { } /** - * @return BasicBatchAction + * @return \Civi\Api4\Generic\BasicBatchAction */ public static function revert() { return new BasicBatchAction('Afform', __FUNCTION__, ['name'], function($item, BasicBatchAction $action) { $scanner = \Civi::service('afform_scanner'); $files = [ \CRM_Afform_AfformScanner::METADATA_FILE, - \CRM_Afform_AfformScanner::LAYOUT_FILE + \CRM_Afform_AfformScanner::LAYOUT_FILE, ]; foreach ($files as $file) { @@ -77,10 +77,10 @@ class Afform extends AbstractEntity { } /** - * @return BasicUpdateAction + * @return \Civi\Api4\Generic\BasicUpdateAction */ public static function update() { - $save = function ($item, BasicUpdateAction $action) { + return new BasicUpdateAction('Afform', __FUNCTION__, 'name', function ($item, BasicUpdateAction $action) { /** @var \CRM_Afform_AfformScanner $scanner */ $scanner = \Civi::service('afform_scanner'); $converter = new \CRM_Afform_ArrayHtml(); @@ -130,8 +130,7 @@ class Afform extends AbstractEntity { // FIXME if asset-caching is enabled, then flush the asset cache. return $updates; - }; - return new BasicUpdateAction('Afform', __FUNCTION__, $save, 'name'); + }); } public static function getFields() { -- 2.25.1