@@ -98,7 +98,7 @@ |
||
98 | 98 | |
99 | 99 | // check validator |
100 | 100 | if (!is_callable($validator)) { |
101 | - throw new Exception('Validator for field ' . $options['id'] . ' is not callable'); |
|
101 | + throw new Exception('Validator for field '.$options['id'].' is not callable'); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | if ($options['type'] == 'one-one') { |
70 | 70 | if (empty($options['local'])) { |
71 | - $options['local'] = $relationship . 'ID'; |
|
71 | + $options['local'] = $relationship.'ID'; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | if (empty($options['foreign'])) { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | if (empty($options['foreign'])) { |
83 | - $options['foreign'] = $classShortName. 'ID'; |
|
83 | + $options['foreign'] = $classShortName.'ID'; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | if (!isset($options['indexField'])) { |
@@ -142,12 +142,12 @@ discard block |
||
142 | 142 | } |
143 | 143 | |
144 | 144 | if (empty($options['linkLocal'])) { |
145 | - $options['linkLocal'] = $classShortName . 'ID'; |
|
145 | + $options['linkLocal'] = $classShortName.'ID'; |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | if (empty($options['linkForeign'])) { |
149 | 149 | $foreignShortname = basename(str_replace('\\', '/', $options['class']::$rootClass)); |
150 | - $options['linkForeign'] = $foreignShortname . 'ID'; |
|
150 | + $options['linkForeign'] = $foreignShortname.'ID'; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | if (empty($options['local'])) { |
@@ -66,7 +66,7 @@ |
||
66 | 66 | ]; |
67 | 67 | |
68 | 68 | if ($options['order']) { |
69 | - $query .= ' ORDER BY ' . join(',', static::_mapFieldOrder($options['order'])); |
|
69 | + $query .= ' ORDER BY '.join(',', static::_mapFieldOrder($options['order'])); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | if ($options['limit']) { |
@@ -11,7 +11,7 @@ |
||
11 | 11 | throw new \Exception(json_last_error_msg()); |
12 | 12 | } |
13 | 13 | header('Content-type: application/javascript; charset=utf-8', true); |
14 | - echo 'var data = ' . $JSON; |
|
14 | + echo 'var data = '.$JSON; |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | public static function translateAndRespond($data) |
@@ -84,8 +84,8 @@ |
||
84 | 84 | |
85 | 85 | |
86 | 86 | /** |
87 | - * @var array $validators Validation checks |
|
88 | - */ |
|
87 | + * @var array $validators Validation checks |
|
88 | + */ |
|
89 | 89 | public static $validators = []; |
90 | 90 | |
91 | 91 | /** |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | static::$tableName, |
721 | 721 | join(',', $set), |
722 | 722 | ], |
723 | - [static::class,'handleError'] |
|
723 | + [static::class, 'handleError'] |
|
724 | 724 | ); |
725 | 725 | $this->_record[static::$primaryKey ? static::$primaryKey : 'ID'] = DB::insertID(); |
726 | 726 | $this->_isPhantom = false; |
@@ -734,7 +734,7 @@ discard block |
||
734 | 734 | static::_cn(static::$primaryKey ? static::$primaryKey : 'ID'), |
735 | 735 | $this->getPrimaryKeyValue(), |
736 | 736 | ], |
737 | - [static::class,'handleError'] |
|
737 | + [static::class, 'handleError'] |
|
738 | 738 | ); |
739 | 739 | |
740 | 740 | $this->_isUpdated = true; |
@@ -792,7 +792,7 @@ discard block |
||
792 | 792 | static::$tableName, |
793 | 793 | static::_cn(static::$primaryKey ? static::$primaryKey : 'ID'), |
794 | 794 | $id, |
795 | - ], [static::class,'handleError']); |
|
795 | + ], [static::class, 'handleError']); |
|
796 | 796 | |
797 | 797 | return DB::affectedRows() > 0; |
798 | 798 | } |
@@ -880,9 +880,9 @@ discard block |
||
880 | 880 | |
881 | 881 | if ($cacheIndex) { |
882 | 882 | $key = sprintf('%s/%s:%s', static::$tableName, $field, $value); |
883 | - return DB::oneRecordCached($key, $query, $params, [static::class,'handleError']); |
|
883 | + return DB::oneRecordCached($key, $query, $params, [static::class, 'handleError']); |
|
884 | 884 | } else { |
885 | - return DB::oneRecord($query, $params, [static::class,'handleError']); |
|
885 | + return DB::oneRecord($query, $params, [static::class, 'handleError']); |
|
886 | 886 | } |
887 | 887 | } |
888 | 888 | |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | join(') AND (', $conditions), |
929 | 929 | $order ? 'ORDER BY '.join(',', $order) : '', |
930 | 930 | ], |
931 | - [static::class,'handleError'] |
|
931 | + [static::class, 'handleError'] |
|
932 | 932 | ); |
933 | 933 | } |
934 | 934 | |
@@ -941,7 +941,7 @@ discard block |
||
941 | 941 | */ |
942 | 942 | public static function getByQuery($query, $params = []) |
943 | 943 | { |
944 | - return static::instantiateRecord(DB::oneRecord($query, $params, [static::class,'handleError'])); |
|
944 | + return static::instantiateRecord(DB::oneRecord($query, $params, [static::class, 'handleError'])); |
|
945 | 945 | } |
946 | 946 | |
947 | 947 | /** |
@@ -1024,7 +1024,7 @@ discard block |
||
1024 | 1024 | return ', '.$value.' AS '.$key; |
1025 | 1025 | } |
1026 | 1026 | } else { |
1027 | - return ', ' . $columns; |
|
1027 | + return ', '.$columns; |
|
1028 | 1028 | } |
1029 | 1029 | } |
1030 | 1030 | } |
@@ -1038,7 +1038,7 @@ discard block |
||
1038 | 1038 | public static function buildHaving($having) |
1039 | 1039 | { |
1040 | 1040 | if (!empty($having)) { |
1041 | - return ' HAVING (' . (is_array($having) ? join(') AND (', static::_mapConditions($having)) : $having) . ')'; |
|
1041 | + return ' HAVING ('.(is_array($having) ? join(') AND (', static::_mapConditions($having)) : $having).')'; |
|
1042 | 1042 | } |
1043 | 1043 | } |
1044 | 1044 | |
@@ -1088,7 +1088,7 @@ discard block |
||
1088 | 1088 | ]; |
1089 | 1089 | |
1090 | 1090 | if ($options['order']) { |
1091 | - $query .= ' ORDER BY ' . join(',', static::_mapFieldOrder($options['order'])); |
|
1091 | + $query .= ' ORDER BY '.join(',', static::_mapFieldOrder($options['order'])); |
|
1092 | 1092 | } |
1093 | 1093 | |
1094 | 1094 | if ($options['limit']) { |
@@ -1096,9 +1096,9 @@ discard block |
||
1096 | 1096 | } |
1097 | 1097 | |
1098 | 1098 | if ($options['indexField']) { |
1099 | - return DB::table(static::_cn($options['indexField']), $query, $params, null, [static::class,'handleError']); |
|
1099 | + return DB::table(static::_cn($options['indexField']), $query, $params, null, [static::class, 'handleError']); |
|
1100 | 1100 | } else { |
1101 | - return DB::allRecords($query, $params, [static::class,'handleError']); |
|
1101 | + return DB::allRecords($query, $params, [static::class, 'handleError']); |
|
1102 | 1102 | } |
1103 | 1103 | } |
1104 | 1104 | |
@@ -1135,7 +1135,7 @@ discard block |
||
1135 | 1135 | ]; |
1136 | 1136 | |
1137 | 1137 | if ($options['order']) { |
1138 | - $query .= ' ORDER BY ' . join(',', static::_mapFieldOrder($options['order'])); |
|
1138 | + $query .= ' ORDER BY '.join(',', static::_mapFieldOrder($options['order'])); |
|
1139 | 1139 | } |
1140 | 1140 | |
1141 | 1141 | if ($options['limit']) { |
@@ -1143,9 +1143,9 @@ discard block |
||
1143 | 1143 | } |
1144 | 1144 | |
1145 | 1145 | if ($options['indexField']) { |
1146 | - return DB::table(static::_cn($options['indexField']), $query, $params, null, [static::class,'handleError']); |
|
1146 | + return DB::table(static::_cn($options['indexField']), $query, $params, null, [static::class, 'handleError']); |
|
1147 | 1147 | } else { |
1148 | - return DB::allRecords($query, $params, [static::class,'handleError']); |
|
1148 | + return DB::allRecords($query, $params, [static::class, 'handleError']); |
|
1149 | 1149 | } |
1150 | 1150 | } |
1151 | 1151 | |
@@ -1158,12 +1158,12 @@ discard block |
||
1158 | 1158 | */ |
1159 | 1159 | public static function getAllByQuery($query, $params = []) |
1160 | 1160 | { |
1161 | - return static::instantiateRecords(DB::allRecords($query, $params, [static::class,'handleError'])); |
|
1161 | + return static::instantiateRecords(DB::allRecords($query, $params, [static::class, 'handleError'])); |
|
1162 | 1162 | } |
1163 | 1163 | |
1164 | 1164 | public static function getTableByQuery($keyField, $query, $params = []) |
1165 | 1165 | { |
1166 | - return static::instantiateRecords(DB::table($keyField, $query, $params, [static::class,'handleError'])); |
|
1166 | + return static::instantiateRecords(DB::table($keyField, $query, $params, [static::class, 'handleError'])); |
|
1167 | 1167 | } |
1168 | 1168 | |
1169 | 1169 | |
@@ -1296,7 +1296,7 @@ discard block |
||
1296 | 1296 | { |
1297 | 1297 | static::init(); |
1298 | 1298 | if (!static::fieldExists($field)) { |
1299 | - throw new Exception('getColumnName called on nonexisting column: ' . get_called_class().'->'.$field); |
|
1299 | + throw new Exception('getColumnName called on nonexisting column: '.get_called_class().'->'.$field); |
|
1300 | 1300 | } |
1301 | 1301 | |
1302 | 1302 | return static::$_classFields[get_called_class()][$field]['columnName']; |
@@ -1731,7 +1731,7 @@ discard block |
||
1731 | 1731 | case 'boolean': |
1732 | 1732 | { |
1733 | 1733 | if (!isset($this->_convertedValues[$field])) { |
1734 | - $this->_convertedValues[$field] = (boolean)$value; |
|
1734 | + $this->_convertedValues[$field] = (boolean) $value; |
|
1735 | 1735 | } |
1736 | 1736 | |
1737 | 1737 | return $this->_convertedValues[$field]; |
@@ -1770,7 +1770,7 @@ discard block |
||
1770 | 1770 | |
1771 | 1771 | protected function _setBooleanValue($value) |
1772 | 1772 | { |
1773 | - return (boolean)$value; |
|
1773 | + return (boolean) $value; |
|
1774 | 1774 | } |
1775 | 1775 | |
1776 | 1776 | protected function _setDecimalValue($value) |
@@ -2010,7 +2010,7 @@ discard block |
||
2010 | 2010 | foreach ($order as $key => $value) { |
2011 | 2011 | if (is_string($key)) { |
2012 | 2012 | $columnName = static::_cn($key); |
2013 | - $direction = strtoupper($value)=='DESC' ? 'DESC' : 'ASC'; |
|
2013 | + $direction = strtoupper($value) == 'DESC' ? 'DESC' : 'ASC'; |
|
2014 | 2014 | } else { |
2015 | 2015 | $columnName = static::_cn($value); |
2016 | 2016 | $direction = 'ASC'; |
@@ -101,7 +101,7 @@ |
||
101 | 101 | // update session |
102 | 102 | $Session->setFields($sessionData); |
103 | 103 | if (function_exists('fastcgi_finish_request')) { |
104 | - register_shutdown_function(function (&$Session) { |
|
104 | + register_shutdown_function(function(&$Session) { |
|
105 | 105 | $Session->save(); |
106 | 106 | }, $Session); |
107 | 107 | } else { |
@@ -90,7 +90,7 @@ |
||
90 | 90 | $PreviewMedia = Media::createFromFile($previewPath, [ |
91 | 91 | 'ContextClass' => 'Media' |
92 | 92 | ,'ContextID' => $this->ID |
93 | - ,'Caption' => sprintf('%u sec preview (%us-%us)', static::$previewDuration, $startTime, $startTime+static::$previewDuration), |
|
93 | + ,'Caption' => sprintf('%u sec preview (%us-%us)', static::$previewDuration, $startTime, $startTime + static::$previewDuration), |
|
94 | 94 | ]); |
95 | 95 | |
96 | 96 | return $PreviewMedia; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | // extract video streams |
119 | - $videoStreams = array_filter($output['streams'], function ($streamInfo) { |
|
119 | + $videoStreams = array_filter($output['streams'], function($streamInfo) { |
|
120 | 120 | return $streamInfo['codec_type'] == 'video'; |
121 | 121 | }); |
122 | 122 | |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | $mediaInfo['streams'] = $output['streams']; |
129 | 129 | $mediaInfo['videoStream'] = array_shift($videoStreams); |
130 | 130 | |
131 | - $mediaInfo['width'] = (int)$mediaInfo['videoStream']['width']; |
|
132 | - $mediaInfo['height'] = (int)$mediaInfo['videoStream']['height']; |
|
133 | - $mediaInfo['duration'] = (double)$mediaInfo['videoStream']['duration']; |
|
131 | + $mediaInfo['width'] = (int) $mediaInfo['videoStream']['width']; |
|
132 | + $mediaInfo['height'] = (int) $mediaInfo['videoStream']['height']; |
|
133 | + $mediaInfo['duration'] = (double) $mediaInfo['videoStream']['duration']; |
|
134 | 134 | |
135 | 135 | return $mediaInfo; |
136 | 136 | } |
@@ -10,6 +10,6 @@ |
||
10 | 10 | use \Divergence\App as App; |
11 | 11 | |
12 | 12 | return [ |
13 | - 'debug' => file_exists(App::$App->ApplicationPath . '/.debug'), |
|
14 | - 'environment' => (file_exists(App::$App->ApplicationPath . '/.dev') ? 'dev' : 'production'), |
|
13 | + 'debug' => file_exists(App::$App->ApplicationPath.'/.debug'), |
|
14 | + 'environment' => (file_exists(App::$App->ApplicationPath.'/.dev') ? 'dev' : 'production'), |
|
15 | 15 | ]; |