mirror of
https://github.com/friendica/friendica
synced 2024-11-10 03:42:53 +00:00
Code standards
This commit is contained in:
parent
ea0cd6c919
commit
cbb5124d59
4 changed files with 5 additions and 5 deletions
|
@ -125,7 +125,7 @@ class Photo extends BaseObject
|
||||||
$data = "";
|
$data = "";
|
||||||
if ($photo["backend-class"] == "") {
|
if ($photo["backend-class"] == "") {
|
||||||
// legacy data storage in "data" column
|
// legacy data storage in "data" column
|
||||||
$i = self::selectFirst(["data"], ["id"=>$photo["id"]]);
|
$i = self::selectFirst(["data"], ["id" => $photo["id"]]);
|
||||||
if ($i === false) {
|
if ($i === false) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ class Photo extends BaseObject
|
||||||
$fields = self::getFields();
|
$fields = self::getFields();
|
||||||
$values = array_fill(0, count($fields), "");
|
$values = array_fill(0, count($fields), "");
|
||||||
$photo = array_combine($fields, $values);
|
$photo = array_combine($fields, $values);
|
||||||
$photo["backend-class"] = "\Friendica\Model\Storage\SystemResource";
|
$photo["backend-class"] = \Friendica\Model\Storage\SystemResource::class;
|
||||||
$photo["backend-ref"] = $filename;
|
$photo["backend-ref"] = $filename;
|
||||||
$photo["type"] = $mimetype;
|
$photo["type"] = $mimetype;
|
||||||
$photo["cacheable"] = false;
|
$photo["cacheable"] = false;
|
||||||
|
|
|
@ -19,7 +19,7 @@ interface IStorage
|
||||||
public static function get($ref);
|
public static function get($ref);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Put data in backend as $ref. If $ref is not defiend a new reference is created.
|
* @brief Put data in backend as $ref. If $ref is not defined a new reference is created.
|
||||||
* @param string $data Data to save
|
* @param string $data Data to save
|
||||||
* @param string $ref Data referece. Optional.
|
* @param string $ref Data referece. Optional.
|
||||||
* @return string Saved data referece
|
* @return string Saved data referece
|
||||||
|
|
|
@ -30,7 +30,7 @@ class SystemResource implements IStorage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function put($data, $filename="")
|
public static function put($data, $filename = "")
|
||||||
{
|
{
|
||||||
throw new \BadMethodCallException();
|
throw new \BadMethodCallException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,7 +150,7 @@ class Photo extends BaseModule
|
||||||
}
|
}
|
||||||
|
|
||||||
$photo = MPhoto::selectFirst([], ["scale" => $scale, "uid" => $uid, "profile" => 1]);
|
$photo = MPhoto::selectFirst([], ["scale" => $scale, "uid" => $uid, "profile" => 1]);
|
||||||
if ($photo===false) {
|
if ($photo === false) {
|
||||||
$photo = MPhoto::createPhotoForSystemResource($default);
|
$photo = MPhoto::createPhotoForSystemResource($default);
|
||||||
}
|
}
|
||||||
return $photo;
|
return $photo;
|
||||||
|
|
Loading…
Reference in a new issue