From: fabrixxm Date: Wed, 21 Nov 2018 15:36:29 +0000 (+0100) Subject: Code standards X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cbb5124d59dcdf2cc5a4e3eb10fe4655b5328388;p=friendica.git Code standards --- diff --git a/src/Model/Photo.php b/src/Model/Photo.php index 3c22c52bc1..3e0d5e40ac 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -125,7 +125,7 @@ class Photo extends BaseObject $data = ""; if ($photo["backend-class"] == "") { // legacy data storage in "data" column - $i = self::selectFirst(["data"], ["id"=>$photo["id"]]); + $i = self::selectFirst(["data"], ["id" => $photo["id"]]); if ($i === false) { return null; } @@ -168,7 +168,7 @@ class Photo extends BaseObject $fields = self::getFields(); $values = array_fill(0, count($fields), ""); $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["type"] = $mimetype; $photo["cacheable"] = false; diff --git a/src/Model/Storage/IStorage.php b/src/Model/Storage/IStorage.php index 93298050d5..deacb8ffc9 100644 --- a/src/Model/Storage/IStorage.php +++ b/src/Model/Storage/IStorage.php @@ -19,7 +19,7 @@ interface IStorage 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 $ref Data referece. Optional. * @return string Saved data referece diff --git a/src/Model/Storage/SystemResource.php b/src/Model/Storage/SystemResource.php index b54aabf6a4..354b1e3284 100644 --- a/src/Model/Storage/SystemResource.php +++ b/src/Model/Storage/SystemResource.php @@ -30,7 +30,7 @@ class SystemResource implements IStorage } - public static function put($data, $filename="") + public static function put($data, $filename = "") { throw new \BadMethodCallException(); } diff --git a/src/Module/Photo.php b/src/Module/Photo.php index 13d9253767..a175f7c090 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -150,7 +150,7 @@ class Photo extends BaseModule } $photo = MPhoto::selectFirst([], ["scale" => $scale, "uid" => $uid, "profile" => 1]); - if ($photo===false) { + if ($photo === false) { $photo = MPhoto::createPhotoForSystemResource($default); } return $photo;