Property and type handling improvements from Scrutinizer

This commit is contained in:
nathangray 2019-03-21 09:08:25 -06:00
parent 672c407804
commit d45070f322
3 changed files with 7 additions and 5 deletions

View File

@ -17,8 +17,8 @@ use EGroupware\Api;
* @property-read string $app app whos category to change (Categories->app_name)
* @property-read array $set category data to set, value of null or "" to remove
* @property-read array $old old values to record
* @property-read int $cat_id Category ID
* @property-read string $cat_name Category name at the time of the change
* @property int $cat_id Category ID
* @property string $cat_name Category name at the time of the change
*/
class admin_cmd_category extends admin_cmd
{

View File

@ -14,6 +14,8 @@ use EGroupware\Api;
/**
* admin command: change the password of a given user
*
* @property int $account Account ID
*/
class admin_cmd_change_pw extends admin_cmd
{

View File

@ -16,9 +16,9 @@ use EGroupware\Api;
*
* @property-read string $app app whos category to delete (Categories->app_name)
* @property-read array $set category data to set, value of null or "" to remove
* @property-read array $old old values to record
* @property array $old old values to record
* @property-read int $cat_id category ID to delete
* @property-read string $cat_name Category name at the time of the change
* @property string $cat_name Category name at the time of the change
* @property-read boolean $subs Delete subs as well
*/
class admin_cmd_delete_category extends admin_cmd
@ -62,7 +62,7 @@ class admin_cmd_delete_category extends admin_cmd
protected function exec($check_only=false)
{
$cats = new Api\Categories('',$this->app);
if(!$this->old && $this->cat_id)
if(empty($this->old) && $this->cat_id)
{
$this->old = $cats->read($this->cat_id);
}