Skip to content

Commit

Permalink
Merge pull request #12775 from jdalsem/scrutinizerissues
Browse files Browse the repository at this point in the history
Scrutinizerissues
  • Loading branch information
jdalsem committed Jul 25, 2019
2 parents 54dc6d4 + 03d71d8 commit 0a7b8f3
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 15 deletions.
Expand Up @@ -11,7 +11,7 @@
class EntitySortByClause extends OrderByClause {

/**
* @var string[]
* @var string
*/
public $property;

Expand Down
2 changes: 1 addition & 1 deletion engine/classes/Elgg/Page/PageOwnerService.php
Expand Up @@ -218,7 +218,7 @@ public function getPageOwnerGuid() {
/**
* Returns the page owner entity
*
* @return ElggEntity|false the current page owner or false if none.
* @return \ElggEntity|false the current page owner or false if none.
*/
public function getPageOwnerEntity() {
return $this->entity_table->get($this->getPageOwnerGuid());
Expand Down
7 changes: 2 additions & 5 deletions engine/classes/ElggData.php
Expand Up @@ -23,6 +23,8 @@ abstract class ElggData implements CollectionItemInterface,
* Blank entries for all database fields should be created by the constructor.
* Subclasses should add to this in their constructors.
* Any field not appearing in this will be viewed as metadata
*
* @var array
*/
protected $attributes = [];

Expand All @@ -34,11 +36,6 @@ abstract class ElggData implements CollectionItemInterface,
* @return void
*/
protected function initializeAttributes() {
// Create attributes array if not already created
if (!is_array($this->attributes)) {
$this->attributes = [];
}

$this->attributes['time_created'] = null;
}

Expand Down
2 changes: 1 addition & 1 deletion languages/en.php
Expand Up @@ -1472,7 +1472,7 @@
'email:request:email:body' => "Hi %s,
You requested to change your e-mail address on '%s'.
If you didn't request this change, please reset your password.
If you didn't request this change, you can ignore this email.
In order to confirm the e-mail address change, please click this link:
%s
Expand Down
4 changes: 4 additions & 0 deletions mod/embed/start.php
Expand Up @@ -162,6 +162,10 @@ function embed_set_thumbnail_url(\Elgg\Hook $hook) {
}

$entity = $hook->getEntityParam();
if (!$entity instanceof \ElggEntity) {
return;
}

$size = $hook->getParam('size');

$thumbnail = $entity->getIcon($size);
Expand Down
4 changes: 1 addition & 3 deletions mod/file/start.php
Expand Up @@ -212,13 +212,11 @@ function file_set_icon_url(\Elgg\Hook $hook) {
$base_type = 'none';
}

$type = $hook->getType();
$type = 'general';
if (isset($mapping[$mime])) {
$type = $mapping[$mime];
} elseif (isset($mapping[$base_type])) {
$type = $mapping[$base_type];
} else {
$type = 'general';
}

if ($size == 'large') {
Expand Down
2 changes: 1 addition & 1 deletion mod/pages/start.php
Expand Up @@ -252,7 +252,7 @@ function pages_container_permission_check(\Elgg\Hook $hook) {
}

$container = $hook->getParam('container');
$user = $hook->getUserParam('user');
$user = $hook->getUserParam();

if (!$user instanceof ElggUser) {
return;
Expand Down
Expand Up @@ -8,9 +8,8 @@
return elgg_error_response(elgg_echo('uservalidationbyemail:errors:unknown_users'));
}

$error = false;

elgg_call(ELGG_SHOW_DISABLED_ENTITIES, function () use ($user_guids, $error) {
$error = elgg_call(ELGG_SHOW_DISABLED_ENTITIES, function () use ($user_guids) {
$error = false;
foreach ($user_guids as $guid) {
$user = get_user($guid);
if (empty($user)) {
Expand All @@ -23,6 +22,7 @@
continue;
}
}
return $error;
});

if (count($user_guids) == 1) {
Expand Down

0 comments on commit 0a7b8f3

Please sign in to comment.