@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Ffcms\Core\App as MainApp; |
| 6 | 6 | use Ffcms\Core\Arch\ActiveModel; |
| 7 | 7 | use Ffcms\Core\Helper\Type\Arr; |
| 8 | -use Ffcms\Core\Helper\Type\Str; |
|
| 9 | 8 | |
| 10 | 9 | class Role extends ActiveModel |
| 11 | 10 | { |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | use Ffcms\Core\App; |
| 10 | 10 | use Ffcms\Core\Exception\SyntaxException; |
| 11 | 11 | use Ffcms\Core\Helper\FileSystem\File; |
| 12 | -use Ffcms\Core\Helper\Type\Arr; |
|
| 13 | 12 | use Ffcms\Core\Helper\Type\Integer; |
| 14 | 13 | use Ffcms\Core\Helper\Type\Str; |
| 15 | 14 | |
@@ -32,13 +32,13 @@ discard block |
||
| 32 | 32 | // cache some data |
| 33 | 33 | $rootSize = App::$Cache->get('root.size'); |
| 34 | 34 | if ($rootSize === null) { |
| 35 | - $rootSize = round(Directory::getSize('/') / (1024*1000), 2) . ' mb'; |
|
| 35 | + $rootSize = round(Directory::getSize('/') / (1024 * 1000), 2) . ' mb'; |
|
| 36 | 36 | App::$Cache->set('root.size', $rootSize, 60 * 60 * 24); // 24 hours caching |
| 37 | 37 | } |
| 38 | 38 | $loadAvg = App::$Cache->get('load.average'); |
| 39 | 39 | if ($loadAvg === null) { |
| 40 | 40 | $loadAvg = Environment::loadAverage(); |
| 41 | - App::$Cache->set('load.average', $loadAvg, 60*5); // 5 min cache |
|
| 41 | + App::$Cache->set('load.average', $loadAvg, 60 * 5); // 5 min cache |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $stats = [ |
@@ -145,9 +145,9 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public function actionDeleteroute() |
| 147 | 147 | { |
| 148 | - $type = (string)App::$Request->query->get('type'); |
|
| 149 | - $loader = (string)App::$Request->query->get('loader'); |
|
| 150 | - $source = Str::lowerCase((string)App::$Request->query->get('path')); |
|
| 148 | + $type = (string) App::$Request->query->get('type'); |
|
| 149 | + $loader = (string) App::$Request->query->get('loader'); |
|
| 150 | + $source = Str::lowerCase((string) App::$Request->query->get('path')); |
|
| 151 | 151 | |
| 152 | 152 | $model = new EntityDeleteRoute($type, $loader, $source); |
| 153 | 153 | if ($model->send()) { |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Extend\Core\Arch\FrontAppController; |
| 6 | 6 | use Ffcms\Core\Arch\View; |
| 7 | -use Apps\Model\Front\User; |
|
| 8 | 7 | |
| 9 | 8 | |
| 10 | 9 | class Main extends FrontAppController |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | use Ffcms\Core\Helper\Date; |
| 10 | 10 | use Ffcms\Core\Helper\FileSystem\Directory; |
| 11 | 11 | use Ffcms\Core\Helper\FileSystem\File; |
| 12 | -use Ffcms\Core\Helper\Type\Integer; |
|
| 13 | 12 | use Ffcms\Core\Helper\Type\Obj; |
| 14 | 13 | use Ffcms\Core\Helper\Serialize; |
| 15 | 14 | use Ffcms\Core\Helper\Type\Str; |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | - * Set model properties from active record data |
|
| 47 | - */ |
|
| 46 | + * Set model properties from active record data |
|
| 47 | + */ |
|
| 48 | 48 | public function before() |
| 49 | 49 | { |
| 50 | 50 | // is new item? |
@@ -105,8 +105,8 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
| 108 | - * Labels |
|
| 109 | - */ |
|
| 108 | + * Labels |
|
| 109 | + */ |
|
| 110 | 110 | public function labels() |
| 111 | 111 | { |
| 112 | 112 | return [ |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function rules() |
| 83 | 83 | { |
| 84 | - $res = [ |
|
| 84 | + $res = [ |
|
| 85 | 85 | ['title.' . App::$Request->getLanguage(), 'required'], |
| 86 | 86 | ['text.' . App::$Request->getLanguage(), 'required', null, true, true], |
| 87 | 87 | ['text', 'used', null, true, true], |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | $this->_content->meta_description = Serialize::encode(App::$Security->strip_tags($this->metaDescription)); |
| 143 | 143 | $this->_content->source = App::$Security->strip_tags($this->source); |
| 144 | 144 | // check if rating is changed |
| 145 | - if ((int)$this->addRating !== 0) { |
|
| 146 | - $this->_content->rating += (int)$this->addRating; |
|
| 145 | + if ((int) $this->addRating !== 0) { |
|
| 146 | + $this->_content->rating += (int) $this->addRating; |
|
| 147 | 147 | } |
| 148 | 148 | // check if special comment hash is exist |
| 149 | 149 | if ($this->_new || Str::length($this->_content->comment_hash) < 32) { |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $data = ContentCategory::getSortedCategories(); |
| 182 | 182 | $response = []; |
| 183 | 183 | foreach ($data as $key=>$val) { |
| 184 | - $response[] = (string)$key; |
|
| 184 | + $response[] = (string) $key; |
|
| 185 | 185 | } |
| 186 | 186 | return $response; |
| 187 | 187 | } |
@@ -10,6 +10,9 @@ |
||
| 10 | 10 | { |
| 11 | 11 | public $message; |
| 12 | 12 | |
| 13 | + /** |
|
| 14 | + * @param string $type |
|
| 15 | + */ |
|
| 13 | 16 | public function createObject($name, $type) |
| 14 | 17 | { |
| 15 | 18 | $singleName = false; |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Apps\Model\Front\Profile; |
| 4 | 4 | |
| 5 | -use Apps\ActiveRecord\Blacklist; |
|
| 6 | 5 | use Apps\ActiveRecord\WallPost as WallRecords; |
| 7 | 6 | use Ffcms\Core\App; |
| 8 | 7 | use Ffcms\Core\Interfaces\iUser; |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Ffcms\Core\App; |
| 6 | 6 | use Ffcms\Core\Arch\Model; |
| 7 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 8 | 7 | use Ffcms\Core\Helper\Type\Str; |
| 9 | 8 | use Ffcms\Core\Interfaces\iUser; |
| 10 | 9 | |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | } else { |
| 72 | 72 | // set level marker based on slashes count in pathway |
| 73 | 73 | $slashCount = Str::entryCount($path, '/'); |
| 74 | - for ($i=-1; $i <= $slashCount; $i++) { |
|
| 74 | + for ($i = -1; $i <= $slashCount; $i++) { |
|
| 75 | 75 | $title .= '--'; |
| 76 | 76 | } |
| 77 | 77 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // convert id to real integer |
| 26 | - $user_id = (int)$user_id; |
|
| 26 | + $user_id = (int) $user_id; |
|
| 27 | 27 | |
| 28 | 28 | if (!Obj::isInt($user_id) || $user_id < 1) { |
| 29 | 29 | return null; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function getId() |
| 53 | 53 | { |
| 54 | - return (int)$this->id; |
|
| 54 | + return (int) $this->id; |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | // get data from session |
| 75 | 75 | $session_token = MainApp::$Session->get('ff_user_token', null); |
| 76 | - $session_id = (int)MainApp::$Session->get('ff_user_id', 0); |
|
| 76 | + $session_id = (int) MainApp::$Session->get('ff_user_id', 0); |
|
| 77 | 77 | |
| 78 | 78 | // validate session data |
| 79 | 79 | if (null === $session_token || $session_id < 1 || Str::length($session_token) < 64) { |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | // convert id to real integer |
| 110 | - $id = (int)$id; |
|
| 110 | + $id = (int) $id; |
|
| 111 | 111 | |
| 112 | 112 | $find = MainApp::$Memory->get('user.counter.cache.' . $id); |
| 113 | 113 | if ($find === null) { |
@@ -163,7 +163,7 @@ |
||
| 163 | 163 | /** |
| 164 | 164 | * Get user person like a object via email |
| 165 | 165 | * @param string $email |
| 166 | - * @return null|static |
|
| 166 | + * @return null|ActiveModel |
|
| 167 | 167 | */ |
| 168 | 168 | public static function getIdentityViaEmail($email) |
| 169 | 169 | { |