@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | /** |
| 36 | 36 | * @since 9.0.0 |
| 37 | 37 | */ |
| 38 | - const EQ = ExpressionBuilder::EQ; |
|
| 38 | + const EQ = ExpressionBuilder::EQ; |
|
| 39 | 39 | /** |
| 40 | 40 | * @since 9.0.0 |
| 41 | 41 | */ |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | /** |
| 44 | 44 | * @since 9.0.0 |
| 45 | 45 | */ |
| 46 | - const LT = ExpressionBuilder::LT; |
|
| 46 | + const LT = ExpressionBuilder::LT; |
|
| 47 | 47 | /** |
| 48 | 48 | * @since 9.0.0 |
| 49 | 49 | */ |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | /** |
| 52 | 52 | * @since 9.0.0 |
| 53 | 53 | */ |
| 54 | - const GT = ExpressionBuilder::GT; |
|
| 54 | + const GT = ExpressionBuilder::GT; |
|
| 55 | 55 | /** |
| 56 | 56 | * @since 9.0.0 |
| 57 | 57 | */ |
@@ -32,336 +32,336 @@ |
||
| 32 | 32 | * @since 8.2.0 |
| 33 | 33 | */ |
| 34 | 34 | interface IExpressionBuilder { |
| 35 | - /** |
|
| 36 | - * @since 9.0.0 |
|
| 37 | - */ |
|
| 38 | - const EQ = ExpressionBuilder::EQ; |
|
| 39 | - /** |
|
| 40 | - * @since 9.0.0 |
|
| 41 | - */ |
|
| 42 | - const NEQ = ExpressionBuilder::NEQ; |
|
| 43 | - /** |
|
| 44 | - * @since 9.0.0 |
|
| 45 | - */ |
|
| 46 | - const LT = ExpressionBuilder::LT; |
|
| 47 | - /** |
|
| 48 | - * @since 9.0.0 |
|
| 49 | - */ |
|
| 50 | - const LTE = ExpressionBuilder::LTE; |
|
| 51 | - /** |
|
| 52 | - * @since 9.0.0 |
|
| 53 | - */ |
|
| 54 | - const GT = ExpressionBuilder::GT; |
|
| 55 | - /** |
|
| 56 | - * @since 9.0.0 |
|
| 57 | - */ |
|
| 58 | - const GTE = ExpressionBuilder::GTE; |
|
| 35 | + /** |
|
| 36 | + * @since 9.0.0 |
|
| 37 | + */ |
|
| 38 | + const EQ = ExpressionBuilder::EQ; |
|
| 39 | + /** |
|
| 40 | + * @since 9.0.0 |
|
| 41 | + */ |
|
| 42 | + const NEQ = ExpressionBuilder::NEQ; |
|
| 43 | + /** |
|
| 44 | + * @since 9.0.0 |
|
| 45 | + */ |
|
| 46 | + const LT = ExpressionBuilder::LT; |
|
| 47 | + /** |
|
| 48 | + * @since 9.0.0 |
|
| 49 | + */ |
|
| 50 | + const LTE = ExpressionBuilder::LTE; |
|
| 51 | + /** |
|
| 52 | + * @since 9.0.0 |
|
| 53 | + */ |
|
| 54 | + const GT = ExpressionBuilder::GT; |
|
| 55 | + /** |
|
| 56 | + * @since 9.0.0 |
|
| 57 | + */ |
|
| 58 | + const GTE = ExpressionBuilder::GTE; |
|
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * Creates a conjunction of the given boolean expressions. |
|
| 62 | - * |
|
| 63 | - * Example: |
|
| 64 | - * |
|
| 65 | - * [php] |
|
| 66 | - * // (u.type = ?) AND (u.role = ?) |
|
| 67 | - * $expr->andX('u.type = ?', 'u.role = ?')); |
|
| 68 | - * |
|
| 69 | - * @param mixed ...$x Optional clause. Defaults = null, but requires |
|
| 70 | - * at least one defined when converting to string. |
|
| 71 | - * |
|
| 72 | - * @return \OCP\DB\QueryBuilder\ICompositeExpression |
|
| 73 | - * @since 8.2.0 |
|
| 74 | - */ |
|
| 75 | - public function andX(...$x); |
|
| 60 | + /** |
|
| 61 | + * Creates a conjunction of the given boolean expressions. |
|
| 62 | + * |
|
| 63 | + * Example: |
|
| 64 | + * |
|
| 65 | + * [php] |
|
| 66 | + * // (u.type = ?) AND (u.role = ?) |
|
| 67 | + * $expr->andX('u.type = ?', 'u.role = ?')); |
|
| 68 | + * |
|
| 69 | + * @param mixed ...$x Optional clause. Defaults = null, but requires |
|
| 70 | + * at least one defined when converting to string. |
|
| 71 | + * |
|
| 72 | + * @return \OCP\DB\QueryBuilder\ICompositeExpression |
|
| 73 | + * @since 8.2.0 |
|
| 74 | + */ |
|
| 75 | + public function andX(...$x); |
|
| 76 | 76 | |
| 77 | - /** |
|
| 78 | - * Creates a disjunction of the given boolean expressions. |
|
| 79 | - * |
|
| 80 | - * Example: |
|
| 81 | - * |
|
| 82 | - * [php] |
|
| 83 | - * // (u.type = ?) OR (u.role = ?) |
|
| 84 | - * $qb->where($qb->expr()->orX('u.type = ?', 'u.role = ?')); |
|
| 85 | - * |
|
| 86 | - * @param mixed ...$x Optional clause. Defaults = null, but requires |
|
| 87 | - * at least one defined when converting to string. |
|
| 88 | - * |
|
| 89 | - * @return \OCP\DB\QueryBuilder\ICompositeExpression |
|
| 90 | - * @since 8.2.0 |
|
| 91 | - */ |
|
| 92 | - public function orX(...$x); |
|
| 77 | + /** |
|
| 78 | + * Creates a disjunction of the given boolean expressions. |
|
| 79 | + * |
|
| 80 | + * Example: |
|
| 81 | + * |
|
| 82 | + * [php] |
|
| 83 | + * // (u.type = ?) OR (u.role = ?) |
|
| 84 | + * $qb->where($qb->expr()->orX('u.type = ?', 'u.role = ?')); |
|
| 85 | + * |
|
| 86 | + * @param mixed ...$x Optional clause. Defaults = null, but requires |
|
| 87 | + * at least one defined when converting to string. |
|
| 88 | + * |
|
| 89 | + * @return \OCP\DB\QueryBuilder\ICompositeExpression |
|
| 90 | + * @since 8.2.0 |
|
| 91 | + */ |
|
| 92 | + public function orX(...$x); |
|
| 93 | 93 | |
| 94 | - /** |
|
| 95 | - * Creates a comparison expression. |
|
| 96 | - * |
|
| 97 | - * @param mixed $x The left expression. |
|
| 98 | - * @param string $operator One of the IExpressionBuilder::* constants. |
|
| 99 | - * @param mixed $y The right expression. |
|
| 100 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 101 | - * required when comparing text fields for oci compatibility |
|
| 102 | - * |
|
| 103 | - * @return string |
|
| 104 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 105 | - */ |
|
| 106 | - public function comparison($x, $operator, $y, $type = null); |
|
| 94 | + /** |
|
| 95 | + * Creates a comparison expression. |
|
| 96 | + * |
|
| 97 | + * @param mixed $x The left expression. |
|
| 98 | + * @param string $operator One of the IExpressionBuilder::* constants. |
|
| 99 | + * @param mixed $y The right expression. |
|
| 100 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 101 | + * required when comparing text fields for oci compatibility |
|
| 102 | + * |
|
| 103 | + * @return string |
|
| 104 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 105 | + */ |
|
| 106 | + public function comparison($x, $operator, $y, $type = null); |
|
| 107 | 107 | |
| 108 | - /** |
|
| 109 | - * Creates an equality comparison expression with the given arguments. |
|
| 110 | - * |
|
| 111 | - * First argument is considered the left expression and the second is the right expression. |
|
| 112 | - * When converted to string, it will generated a <left expr> = <right expr>. Example: |
|
| 113 | - * |
|
| 114 | - * [php] |
|
| 115 | - * // u.id = ? |
|
| 116 | - * $expr->eq('u.id', '?'); |
|
| 117 | - * |
|
| 118 | - * @param mixed $x The left expression. |
|
| 119 | - * @param mixed $y The right expression. |
|
| 120 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 121 | - * required when comparing text fields for oci compatibility |
|
| 122 | - * |
|
| 123 | - * @return string |
|
| 124 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 125 | - */ |
|
| 126 | - public function eq($x, $y, $type = null); |
|
| 108 | + /** |
|
| 109 | + * Creates an equality comparison expression with the given arguments. |
|
| 110 | + * |
|
| 111 | + * First argument is considered the left expression and the second is the right expression. |
|
| 112 | + * When converted to string, it will generated a <left expr> = <right expr>. Example: |
|
| 113 | + * |
|
| 114 | + * [php] |
|
| 115 | + * // u.id = ? |
|
| 116 | + * $expr->eq('u.id', '?'); |
|
| 117 | + * |
|
| 118 | + * @param mixed $x The left expression. |
|
| 119 | + * @param mixed $y The right expression. |
|
| 120 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 121 | + * required when comparing text fields for oci compatibility |
|
| 122 | + * |
|
| 123 | + * @return string |
|
| 124 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 125 | + */ |
|
| 126 | + public function eq($x, $y, $type = null); |
|
| 127 | 127 | |
| 128 | - /** |
|
| 129 | - * Creates a non equality comparison expression with the given arguments. |
|
| 130 | - * First argument is considered the left expression and the second is the right expression. |
|
| 131 | - * When converted to string, it will generated a <left expr> <> <right expr>. Example: |
|
| 132 | - * |
|
| 133 | - * [php] |
|
| 134 | - * // u.id <> 1 |
|
| 135 | - * $q->where($q->expr()->neq('u.id', '1')); |
|
| 136 | - * |
|
| 137 | - * @param mixed $x The left expression. |
|
| 138 | - * @param mixed $y The right expression. |
|
| 139 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 140 | - * required when comparing text fields for oci compatibility |
|
| 141 | - * |
|
| 142 | - * @return string |
|
| 143 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 144 | - */ |
|
| 145 | - public function neq($x, $y, $type = null); |
|
| 128 | + /** |
|
| 129 | + * Creates a non equality comparison expression with the given arguments. |
|
| 130 | + * First argument is considered the left expression and the second is the right expression. |
|
| 131 | + * When converted to string, it will generated a <left expr> <> <right expr>. Example: |
|
| 132 | + * |
|
| 133 | + * [php] |
|
| 134 | + * // u.id <> 1 |
|
| 135 | + * $q->where($q->expr()->neq('u.id', '1')); |
|
| 136 | + * |
|
| 137 | + * @param mixed $x The left expression. |
|
| 138 | + * @param mixed $y The right expression. |
|
| 139 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 140 | + * required when comparing text fields for oci compatibility |
|
| 141 | + * |
|
| 142 | + * @return string |
|
| 143 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 144 | + */ |
|
| 145 | + public function neq($x, $y, $type = null); |
|
| 146 | 146 | |
| 147 | - /** |
|
| 148 | - * Creates a lower-than comparison expression with the given arguments. |
|
| 149 | - * First argument is considered the left expression and the second is the right expression. |
|
| 150 | - * When converted to string, it will generated a <left expr> < <right expr>. Example: |
|
| 151 | - * |
|
| 152 | - * [php] |
|
| 153 | - * // u.id < ? |
|
| 154 | - * $q->where($q->expr()->lt('u.id', '?')); |
|
| 155 | - * |
|
| 156 | - * @param mixed $x The left expression. |
|
| 157 | - * @param mixed $y The right expression. |
|
| 158 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 159 | - * required when comparing text fields for oci compatibility |
|
| 160 | - * |
|
| 161 | - * @return string |
|
| 162 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 163 | - */ |
|
| 164 | - public function lt($x, $y, $type = null); |
|
| 147 | + /** |
|
| 148 | + * Creates a lower-than comparison expression with the given arguments. |
|
| 149 | + * First argument is considered the left expression and the second is the right expression. |
|
| 150 | + * When converted to string, it will generated a <left expr> < <right expr>. Example: |
|
| 151 | + * |
|
| 152 | + * [php] |
|
| 153 | + * // u.id < ? |
|
| 154 | + * $q->where($q->expr()->lt('u.id', '?')); |
|
| 155 | + * |
|
| 156 | + * @param mixed $x The left expression. |
|
| 157 | + * @param mixed $y The right expression. |
|
| 158 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 159 | + * required when comparing text fields for oci compatibility |
|
| 160 | + * |
|
| 161 | + * @return string |
|
| 162 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 163 | + */ |
|
| 164 | + public function lt($x, $y, $type = null); |
|
| 165 | 165 | |
| 166 | - /** |
|
| 167 | - * Creates a lower-than-equal comparison expression with the given arguments. |
|
| 168 | - * First argument is considered the left expression and the second is the right expression. |
|
| 169 | - * When converted to string, it will generated a <left expr> <= <right expr>. Example: |
|
| 170 | - * |
|
| 171 | - * [php] |
|
| 172 | - * // u.id <= ? |
|
| 173 | - * $q->where($q->expr()->lte('u.id', '?')); |
|
| 174 | - * |
|
| 175 | - * @param mixed $x The left expression. |
|
| 176 | - * @param mixed $y The right expression. |
|
| 177 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 178 | - * required when comparing text fields for oci compatibility |
|
| 179 | - * |
|
| 180 | - * @return string |
|
| 181 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 182 | - */ |
|
| 183 | - public function lte($x, $y, $type = null); |
|
| 166 | + /** |
|
| 167 | + * Creates a lower-than-equal comparison expression with the given arguments. |
|
| 168 | + * First argument is considered the left expression and the second is the right expression. |
|
| 169 | + * When converted to string, it will generated a <left expr> <= <right expr>. Example: |
|
| 170 | + * |
|
| 171 | + * [php] |
|
| 172 | + * // u.id <= ? |
|
| 173 | + * $q->where($q->expr()->lte('u.id', '?')); |
|
| 174 | + * |
|
| 175 | + * @param mixed $x The left expression. |
|
| 176 | + * @param mixed $y The right expression. |
|
| 177 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 178 | + * required when comparing text fields for oci compatibility |
|
| 179 | + * |
|
| 180 | + * @return string |
|
| 181 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 182 | + */ |
|
| 183 | + public function lte($x, $y, $type = null); |
|
| 184 | 184 | |
| 185 | - /** |
|
| 186 | - * Creates a greater-than comparison expression with the given arguments. |
|
| 187 | - * First argument is considered the left expression and the second is the right expression. |
|
| 188 | - * When converted to string, it will generated a <left expr> > <right expr>. Example: |
|
| 189 | - * |
|
| 190 | - * [php] |
|
| 191 | - * // u.id > ? |
|
| 192 | - * $q->where($q->expr()->gt('u.id', '?')); |
|
| 193 | - * |
|
| 194 | - * @param mixed $x The left expression. |
|
| 195 | - * @param mixed $y The right expression. |
|
| 196 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 197 | - * required when comparing text fields for oci compatibility |
|
| 198 | - * |
|
| 199 | - * @return string |
|
| 200 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 201 | - */ |
|
| 202 | - public function gt($x, $y, $type = null); |
|
| 185 | + /** |
|
| 186 | + * Creates a greater-than comparison expression with the given arguments. |
|
| 187 | + * First argument is considered the left expression and the second is the right expression. |
|
| 188 | + * When converted to string, it will generated a <left expr> > <right expr>. Example: |
|
| 189 | + * |
|
| 190 | + * [php] |
|
| 191 | + * // u.id > ? |
|
| 192 | + * $q->where($q->expr()->gt('u.id', '?')); |
|
| 193 | + * |
|
| 194 | + * @param mixed $x The left expression. |
|
| 195 | + * @param mixed $y The right expression. |
|
| 196 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 197 | + * required when comparing text fields for oci compatibility |
|
| 198 | + * |
|
| 199 | + * @return string |
|
| 200 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 201 | + */ |
|
| 202 | + public function gt($x, $y, $type = null); |
|
| 203 | 203 | |
| 204 | - /** |
|
| 205 | - * Creates a greater-than-equal comparison expression with the given arguments. |
|
| 206 | - * First argument is considered the left expression and the second is the right expression. |
|
| 207 | - * When converted to string, it will generated a <left expr> >= <right expr>. Example: |
|
| 208 | - * |
|
| 209 | - * [php] |
|
| 210 | - * // u.id >= ? |
|
| 211 | - * $q->where($q->expr()->gte('u.id', '?')); |
|
| 212 | - * |
|
| 213 | - * @param mixed $x The left expression. |
|
| 214 | - * @param mixed $y The right expression. |
|
| 215 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 216 | - * required when comparing text fields for oci compatibility |
|
| 217 | - * |
|
| 218 | - * @return string |
|
| 219 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 220 | - */ |
|
| 221 | - public function gte($x, $y, $type = null); |
|
| 204 | + /** |
|
| 205 | + * Creates a greater-than-equal comparison expression with the given arguments. |
|
| 206 | + * First argument is considered the left expression and the second is the right expression. |
|
| 207 | + * When converted to string, it will generated a <left expr> >= <right expr>. Example: |
|
| 208 | + * |
|
| 209 | + * [php] |
|
| 210 | + * // u.id >= ? |
|
| 211 | + * $q->where($q->expr()->gte('u.id', '?')); |
|
| 212 | + * |
|
| 213 | + * @param mixed $x The left expression. |
|
| 214 | + * @param mixed $y The right expression. |
|
| 215 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 216 | + * required when comparing text fields for oci compatibility |
|
| 217 | + * |
|
| 218 | + * @return string |
|
| 219 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 220 | + */ |
|
| 221 | + public function gte($x, $y, $type = null); |
|
| 222 | 222 | |
| 223 | - /** |
|
| 224 | - * Creates an IS NULL expression with the given arguments. |
|
| 225 | - * |
|
| 226 | - * @param string $x The field in string format to be restricted by IS NULL. |
|
| 227 | - * |
|
| 228 | - * @return string |
|
| 229 | - * @since 8.2.0 |
|
| 230 | - */ |
|
| 231 | - public function isNull($x); |
|
| 223 | + /** |
|
| 224 | + * Creates an IS NULL expression with the given arguments. |
|
| 225 | + * |
|
| 226 | + * @param string $x The field in string format to be restricted by IS NULL. |
|
| 227 | + * |
|
| 228 | + * @return string |
|
| 229 | + * @since 8.2.0 |
|
| 230 | + */ |
|
| 231 | + public function isNull($x); |
|
| 232 | 232 | |
| 233 | - /** |
|
| 234 | - * Creates an IS NOT NULL expression with the given arguments. |
|
| 235 | - * |
|
| 236 | - * @param string $x The field in string format to be restricted by IS NOT NULL. |
|
| 237 | - * |
|
| 238 | - * @return string |
|
| 239 | - * @since 8.2.0 |
|
| 240 | - */ |
|
| 241 | - public function isNotNull($x); |
|
| 233 | + /** |
|
| 234 | + * Creates an IS NOT NULL expression with the given arguments. |
|
| 235 | + * |
|
| 236 | + * @param string $x The field in string format to be restricted by IS NOT NULL. |
|
| 237 | + * |
|
| 238 | + * @return string |
|
| 239 | + * @since 8.2.0 |
|
| 240 | + */ |
|
| 241 | + public function isNotNull($x); |
|
| 242 | 242 | |
| 243 | - /** |
|
| 244 | - * Creates a LIKE() comparison expression with the given arguments. |
|
| 245 | - * |
|
| 246 | - * @param string $x Field in string format to be inspected by LIKE() comparison. |
|
| 247 | - * @param mixed $y Argument to be used in LIKE() comparison. |
|
| 248 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 249 | - * required when comparing text fields for oci compatibility |
|
| 250 | - * |
|
| 251 | - * @return string |
|
| 252 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 253 | - */ |
|
| 254 | - public function like($x, $y, $type = null); |
|
| 243 | + /** |
|
| 244 | + * Creates a LIKE() comparison expression with the given arguments. |
|
| 245 | + * |
|
| 246 | + * @param string $x Field in string format to be inspected by LIKE() comparison. |
|
| 247 | + * @param mixed $y Argument to be used in LIKE() comparison. |
|
| 248 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 249 | + * required when comparing text fields for oci compatibility |
|
| 250 | + * |
|
| 251 | + * @return string |
|
| 252 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 253 | + */ |
|
| 254 | + public function like($x, $y, $type = null); |
|
| 255 | 255 | |
| 256 | - /** |
|
| 257 | - * Creates a NOT LIKE() comparison expression with the given arguments. |
|
| 258 | - * |
|
| 259 | - * @param string $x Field in string format to be inspected by NOT LIKE() comparison. |
|
| 260 | - * @param mixed $y Argument to be used in NOT LIKE() comparison. |
|
| 261 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 262 | - * required when comparing text fields for oci compatibility |
|
| 263 | - * |
|
| 264 | - * @return string |
|
| 265 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 266 | - */ |
|
| 267 | - public function notLike($x, $y, $type = null); |
|
| 256 | + /** |
|
| 257 | + * Creates a NOT LIKE() comparison expression with the given arguments. |
|
| 258 | + * |
|
| 259 | + * @param string $x Field in string format to be inspected by NOT LIKE() comparison. |
|
| 260 | + * @param mixed $y Argument to be used in NOT LIKE() comparison. |
|
| 261 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 262 | + * required when comparing text fields for oci compatibility |
|
| 263 | + * |
|
| 264 | + * @return string |
|
| 265 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 266 | + */ |
|
| 267 | + public function notLike($x, $y, $type = null); |
|
| 268 | 268 | |
| 269 | - /** |
|
| 270 | - * Creates a ILIKE() comparison expression with the given arguments. |
|
| 271 | - * |
|
| 272 | - * @param string $x Field in string format to be inspected by ILIKE() comparison. |
|
| 273 | - * @param mixed $y Argument to be used in ILIKE() comparison. |
|
| 274 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 275 | - * required when comparing text fields for oci compatibility |
|
| 276 | - * |
|
| 277 | - * @return string |
|
| 278 | - * @since 9.0.0 |
|
| 279 | - */ |
|
| 280 | - public function iLike($x, $y, $type = null); |
|
| 269 | + /** |
|
| 270 | + * Creates a ILIKE() comparison expression with the given arguments. |
|
| 271 | + * |
|
| 272 | + * @param string $x Field in string format to be inspected by ILIKE() comparison. |
|
| 273 | + * @param mixed $y Argument to be used in ILIKE() comparison. |
|
| 274 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 275 | + * required when comparing text fields for oci compatibility |
|
| 276 | + * |
|
| 277 | + * @return string |
|
| 278 | + * @since 9.0.0 |
|
| 279 | + */ |
|
| 280 | + public function iLike($x, $y, $type = null); |
|
| 281 | 281 | |
| 282 | - /** |
|
| 283 | - * Creates a IN () comparison expression with the given arguments. |
|
| 284 | - * |
|
| 285 | - * @param string $x The field in string format to be inspected by IN() comparison. |
|
| 286 | - * @param string|array $y The placeholder or the array of values to be used by IN() comparison. |
|
| 287 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 288 | - * required when comparing text fields for oci compatibility |
|
| 289 | - * |
|
| 290 | - * @return string |
|
| 291 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 292 | - */ |
|
| 293 | - public function in($x, $y, $type = null); |
|
| 282 | + /** |
|
| 283 | + * Creates a IN () comparison expression with the given arguments. |
|
| 284 | + * |
|
| 285 | + * @param string $x The field in string format to be inspected by IN() comparison. |
|
| 286 | + * @param string|array $y The placeholder or the array of values to be used by IN() comparison. |
|
| 287 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 288 | + * required when comparing text fields for oci compatibility |
|
| 289 | + * |
|
| 290 | + * @return string |
|
| 291 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 292 | + */ |
|
| 293 | + public function in($x, $y, $type = null); |
|
| 294 | 294 | |
| 295 | - /** |
|
| 296 | - * Creates a NOT IN () comparison expression with the given arguments. |
|
| 297 | - * |
|
| 298 | - * @param string $x The field in string format to be inspected by NOT IN() comparison. |
|
| 299 | - * @param string|array $y The placeholder or the array of values to be used by NOT IN() comparison. |
|
| 300 | - * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 301 | - * required when comparing text fields for oci compatibility |
|
| 302 | - * |
|
| 303 | - * @return string |
|
| 304 | - * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 305 | - */ |
|
| 306 | - public function notIn($x, $y, $type = null); |
|
| 295 | + /** |
|
| 296 | + * Creates a NOT IN () comparison expression with the given arguments. |
|
| 297 | + * |
|
| 298 | + * @param string $x The field in string format to be inspected by NOT IN() comparison. |
|
| 299 | + * @param string|array $y The placeholder or the array of values to be used by NOT IN() comparison. |
|
| 300 | + * @param mixed|null $type one of the IQueryBuilder::PARAM_* constants |
|
| 301 | + * required when comparing text fields for oci compatibility |
|
| 302 | + * |
|
| 303 | + * @return string |
|
| 304 | + * @since 8.2.0 - Parameter $type was added in 9.0.0 |
|
| 305 | + */ |
|
| 306 | + public function notIn($x, $y, $type = null); |
|
| 307 | 307 | |
| 308 | - /** |
|
| 309 | - * Creates a $x = '' statement, because Oracle needs a different check |
|
| 310 | - * |
|
| 311 | - * @param string $x The field in string format to be inspected by the comparison. |
|
| 312 | - * @return string |
|
| 313 | - * @since 13.0.0 |
|
| 314 | - */ |
|
| 315 | - public function emptyString($x); |
|
| 308 | + /** |
|
| 309 | + * Creates a $x = '' statement, because Oracle needs a different check |
|
| 310 | + * |
|
| 311 | + * @param string $x The field in string format to be inspected by the comparison. |
|
| 312 | + * @return string |
|
| 313 | + * @since 13.0.0 |
|
| 314 | + */ |
|
| 315 | + public function emptyString($x); |
|
| 316 | 316 | |
| 317 | - /** |
|
| 318 | - * Creates a `$x <> ''` statement, because Oracle needs a different check |
|
| 319 | - * |
|
| 320 | - * @param string $x The field in string format to be inspected by the comparison. |
|
| 321 | - * @return string |
|
| 322 | - * @since 13.0.0 |
|
| 323 | - */ |
|
| 324 | - public function nonEmptyString($x); |
|
| 317 | + /** |
|
| 318 | + * Creates a `$x <> ''` statement, because Oracle needs a different check |
|
| 319 | + * |
|
| 320 | + * @param string $x The field in string format to be inspected by the comparison. |
|
| 321 | + * @return string |
|
| 322 | + * @since 13.0.0 |
|
| 323 | + */ |
|
| 324 | + public function nonEmptyString($x); |
|
| 325 | 325 | |
| 326 | 326 | |
| 327 | - /** |
|
| 328 | - * Creates a bitwise AND comparison |
|
| 329 | - * |
|
| 330 | - * @param string|ILiteral $x The field or value to check |
|
| 331 | - * @param int $y Bitmap that must be set |
|
| 332 | - * @return IQueryFunction |
|
| 333 | - * @since 12.0.0 |
|
| 334 | - */ |
|
| 335 | - public function bitwiseAnd($x, $y); |
|
| 327 | + /** |
|
| 328 | + * Creates a bitwise AND comparison |
|
| 329 | + * |
|
| 330 | + * @param string|ILiteral $x The field or value to check |
|
| 331 | + * @param int $y Bitmap that must be set |
|
| 332 | + * @return IQueryFunction |
|
| 333 | + * @since 12.0.0 |
|
| 334 | + */ |
|
| 335 | + public function bitwiseAnd($x, $y); |
|
| 336 | 336 | |
| 337 | - /** |
|
| 338 | - * Creates a bitwise OR comparison |
|
| 339 | - * |
|
| 340 | - * @param string|ILiteral $x The field or value to check |
|
| 341 | - * @param int $y Bitmap that must be set |
|
| 342 | - * @return IQueryFunction |
|
| 343 | - * @since 12.0.0 |
|
| 344 | - */ |
|
| 345 | - public function bitwiseOr($x, $y); |
|
| 337 | + /** |
|
| 338 | + * Creates a bitwise OR comparison |
|
| 339 | + * |
|
| 340 | + * @param string|ILiteral $x The field or value to check |
|
| 341 | + * @param int $y Bitmap that must be set |
|
| 342 | + * @return IQueryFunction |
|
| 343 | + * @since 12.0.0 |
|
| 344 | + */ |
|
| 345 | + public function bitwiseOr($x, $y); |
|
| 346 | 346 | |
| 347 | - /** |
|
| 348 | - * Quotes a given input parameter. |
|
| 349 | - * |
|
| 350 | - * @param mixed $input The parameter to be quoted. |
|
| 351 | - * @param mixed|null $type One of the IQueryBuilder::PARAM_* constants |
|
| 352 | - * |
|
| 353 | - * @return string |
|
| 354 | - * @since 8.2.0 |
|
| 355 | - */ |
|
| 356 | - public function literal($input, $type = null); |
|
| 347 | + /** |
|
| 348 | + * Quotes a given input parameter. |
|
| 349 | + * |
|
| 350 | + * @param mixed $input The parameter to be quoted. |
|
| 351 | + * @param mixed|null $type One of the IQueryBuilder::PARAM_* constants |
|
| 352 | + * |
|
| 353 | + * @return string |
|
| 354 | + * @since 8.2.0 |
|
| 355 | + */ |
|
| 356 | + public function literal($input, $type = null); |
|
| 357 | 357 | |
| 358 | - /** |
|
| 359 | - * Returns a IQueryFunction that casts the column to the given type |
|
| 360 | - * |
|
| 361 | - * @param string $column |
|
| 362 | - * @param mixed $type One of IQueryBuilder::PARAM_* |
|
| 363 | - * @return string |
|
| 364 | - * @since 9.0.0 |
|
| 365 | - */ |
|
| 366 | - public function castColumn($column, $type); |
|
| 358 | + /** |
|
| 359 | + * Returns a IQueryFunction that casts the column to the given type |
|
| 360 | + * |
|
| 361 | + * @param string $column |
|
| 362 | + * @param mixed $type One of IQueryBuilder::PARAM_* |
|
| 363 | + * @return string |
|
| 364 | + * @since 9.0.0 |
|
| 365 | + */ |
|
| 366 | + public function castColumn($column, $type); |
|
| 367 | 367 | } |
@@ -29,44 +29,44 @@ |
||
| 29 | 29 | * @since 8.0.0 |
| 30 | 30 | */ |
| 31 | 31 | interface ICertificateManager { |
| 32 | - /** |
|
| 33 | - * Returns all certificates trusted by the user |
|
| 34 | - * |
|
| 35 | - * @return \OCP\ICertificate[] |
|
| 36 | - * @since 8.0.0 |
|
| 37 | - */ |
|
| 38 | - public function listCertificates(); |
|
| 32 | + /** |
|
| 33 | + * Returns all certificates trusted by the user |
|
| 34 | + * |
|
| 35 | + * @return \OCP\ICertificate[] |
|
| 36 | + * @since 8.0.0 |
|
| 37 | + */ |
|
| 38 | + public function listCertificates(); |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @param string $certificate the certificate data |
|
| 42 | - * @param string $name the filename for the certificate |
|
| 43 | - * @return \OCP\ICertificate |
|
| 44 | - * @throws \Exception If the certificate could not get added |
|
| 45 | - * @since 8.0.0 - since 8.1.0 throws exception instead of returning false |
|
| 46 | - */ |
|
| 47 | - public function addCertificate($certificate, $name); |
|
| 40 | + /** |
|
| 41 | + * @param string $certificate the certificate data |
|
| 42 | + * @param string $name the filename for the certificate |
|
| 43 | + * @return \OCP\ICertificate |
|
| 44 | + * @throws \Exception If the certificate could not get added |
|
| 45 | + * @since 8.0.0 - since 8.1.0 throws exception instead of returning false |
|
| 46 | + */ |
|
| 47 | + public function addCertificate($certificate, $name); |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * @param string $name |
|
| 51 | - * @since 8.0.0 |
|
| 52 | - */ |
|
| 53 | - public function removeCertificate($name); |
|
| 49 | + /** |
|
| 50 | + * @param string $name |
|
| 51 | + * @since 8.0.0 |
|
| 52 | + */ |
|
| 53 | + public function removeCertificate($name); |
|
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * Get the path to the certificate bundle for this user |
|
| 57 | - * |
|
| 58 | - * @param string $uid (optional) user to get the certificate bundle for, use `null` to get the system bundle (since 9.0.0) |
|
| 59 | - * @return string |
|
| 60 | - * @since 8.0.0 |
|
| 61 | - */ |
|
| 62 | - public function getCertificateBundle($uid = ''); |
|
| 55 | + /** |
|
| 56 | + * Get the path to the certificate bundle for this user |
|
| 57 | + * |
|
| 58 | + * @param string $uid (optional) user to get the certificate bundle for, use `null` to get the system bundle (since 9.0.0) |
|
| 59 | + * @return string |
|
| 60 | + * @since 8.0.0 |
|
| 61 | + */ |
|
| 62 | + public function getCertificateBundle($uid = ''); |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * Get the full local path to the certificate bundle for this user |
|
| 66 | - * |
|
| 67 | - * @param string $uid (optional) user to get the certificate bundle for, use `null` to get the system bundle |
|
| 68 | - * @return string |
|
| 69 | - * @since 9.0.0 |
|
| 70 | - */ |
|
| 71 | - public function getAbsoluteBundlePath($uid = ''); |
|
| 64 | + /** |
|
| 65 | + * Get the full local path to the certificate bundle for this user |
|
| 66 | + * |
|
| 67 | + * @param string $uid (optional) user to get the certificate bundle for, use `null` to get the system bundle |
|
| 68 | + * @return string |
|
| 69 | + * @since 9.0.0 |
|
| 70 | + */ |
|
| 71 | + public function getAbsoluteBundlePath($uid = ''); |
|
| 72 | 72 | } |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | * @since 9.0.0 |
| 85 | 85 | */ |
| 86 | 86 | public function getGroups() { |
| 87 | - return array_map(function ($group) { |
|
| 87 | + return array_map(function($group) { |
|
| 88 | 88 | /** @var \OCP\IGroup $group */ |
| 89 | 89 | return $group->getGID(); |
| 90 | 90 | }, $this->groups); |
@@ -32,61 +32,61 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | class ManagerEvent extends Event { |
| 34 | 34 | |
| 35 | - const EVENT_APP_ENABLE = 'OCP\App\IAppManager::enableApp'; |
|
| 36 | - const EVENT_APP_ENABLE_FOR_GROUPS = 'OCP\App\IAppManager::enableAppForGroups'; |
|
| 37 | - const EVENT_APP_DISABLE = 'OCP\App\IAppManager::disableApp'; |
|
| 35 | + const EVENT_APP_ENABLE = 'OCP\App\IAppManager::enableApp'; |
|
| 36 | + const EVENT_APP_ENABLE_FOR_GROUPS = 'OCP\App\IAppManager::enableAppForGroups'; |
|
| 37 | + const EVENT_APP_DISABLE = 'OCP\App\IAppManager::disableApp'; |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * @since 9.1.0 |
|
| 41 | - */ |
|
| 42 | - const EVENT_APP_UPDATE = 'OCP\App\IAppManager::updateApp'; |
|
| 39 | + /** |
|
| 40 | + * @since 9.1.0 |
|
| 41 | + */ |
|
| 42 | + const EVENT_APP_UPDATE = 'OCP\App\IAppManager::updateApp'; |
|
| 43 | 43 | |
| 44 | - /** @var string */ |
|
| 45 | - protected $event; |
|
| 46 | - /** @var string */ |
|
| 47 | - protected $appID; |
|
| 48 | - /** @var \OCP\IGroup[]|null */ |
|
| 49 | - protected $groups; |
|
| 44 | + /** @var string */ |
|
| 45 | + protected $event; |
|
| 46 | + /** @var string */ |
|
| 47 | + protected $appID; |
|
| 48 | + /** @var \OCP\IGroup[]|null */ |
|
| 49 | + protected $groups; |
|
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * DispatcherEvent constructor. |
|
| 53 | - * |
|
| 54 | - * @param string $event |
|
| 55 | - * @param $appID |
|
| 56 | - * @param \OCP\IGroup[]|null $groups |
|
| 57 | - * @since 9.0.0 |
|
| 58 | - */ |
|
| 59 | - public function __construct($event, $appID, array $groups = null) { |
|
| 60 | - $this->event = $event; |
|
| 61 | - $this->appID = $appID; |
|
| 62 | - $this->groups = $groups; |
|
| 63 | - } |
|
| 51 | + /** |
|
| 52 | + * DispatcherEvent constructor. |
|
| 53 | + * |
|
| 54 | + * @param string $event |
|
| 55 | + * @param $appID |
|
| 56 | + * @param \OCP\IGroup[]|null $groups |
|
| 57 | + * @since 9.0.0 |
|
| 58 | + */ |
|
| 59 | + public function __construct($event, $appID, array $groups = null) { |
|
| 60 | + $this->event = $event; |
|
| 61 | + $this->appID = $appID; |
|
| 62 | + $this->groups = $groups; |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | - /** |
|
| 66 | - * @return string |
|
| 67 | - * @since 9.0.0 |
|
| 68 | - */ |
|
| 69 | - public function getEvent() { |
|
| 70 | - return $this->event; |
|
| 71 | - } |
|
| 65 | + /** |
|
| 66 | + * @return string |
|
| 67 | + * @since 9.0.0 |
|
| 68 | + */ |
|
| 69 | + public function getEvent() { |
|
| 70 | + return $this->event; |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - /** |
|
| 74 | - * @return string |
|
| 75 | - * @since 9.0.0 |
|
| 76 | - */ |
|
| 77 | - public function getAppID() { |
|
| 78 | - return $this->appID; |
|
| 79 | - } |
|
| 73 | + /** |
|
| 74 | + * @return string |
|
| 75 | + * @since 9.0.0 |
|
| 76 | + */ |
|
| 77 | + public function getAppID() { |
|
| 78 | + return $this->appID; |
|
| 79 | + } |
|
| 80 | 80 | |
| 81 | - /** |
|
| 82 | - * returns the group Ids |
|
| 83 | - * @return string[] |
|
| 84 | - * @since 9.0.0 |
|
| 85 | - */ |
|
| 86 | - public function getGroups() { |
|
| 87 | - return array_map(function ($group) { |
|
| 88 | - /** @var \OCP\IGroup $group */ |
|
| 89 | - return $group->getGID(); |
|
| 90 | - }, $this->groups); |
|
| 91 | - } |
|
| 81 | + /** |
|
| 82 | + * returns the group Ids |
|
| 83 | + * @return string[] |
|
| 84 | + * @since 9.0.0 |
|
| 85 | + */ |
|
| 86 | + public function getGroups() { |
|
| 87 | + return array_map(function ($group) { |
|
| 88 | + /** @var \OCP\IGroup $group */ |
|
| 89 | + return $group->getGID(); |
|
| 90 | + }, $this->groups); |
|
| 91 | + } |
|
| 92 | 92 | } |
@@ -29,31 +29,31 @@ |
||
| 29 | 29 | * @since 8.1.0 |
| 30 | 30 | */ |
| 31 | 31 | interface IProvider { |
| 32 | - /** |
|
| 33 | - * @return string Regex with the mimetypes that are supported by this provider |
|
| 34 | - * @since 8.1.0 |
|
| 35 | - */ |
|
| 36 | - public function getMimeType(); |
|
| 32 | + /** |
|
| 33 | + * @return string Regex with the mimetypes that are supported by this provider |
|
| 34 | + * @since 8.1.0 |
|
| 35 | + */ |
|
| 36 | + public function getMimeType(); |
|
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * Check if a preview can be generated for $path |
|
| 40 | - * |
|
| 41 | - * @param \OCP\Files\FileInfo $file |
|
| 42 | - * @return bool |
|
| 43 | - * @since 8.1.0 |
|
| 44 | - */ |
|
| 45 | - public function isAvailable(\OCP\Files\FileInfo $file); |
|
| 38 | + /** |
|
| 39 | + * Check if a preview can be generated for $path |
|
| 40 | + * |
|
| 41 | + * @param \OCP\Files\FileInfo $file |
|
| 42 | + * @return bool |
|
| 43 | + * @since 8.1.0 |
|
| 44 | + */ |
|
| 45 | + public function isAvailable(\OCP\Files\FileInfo $file); |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * get thumbnail for file at path $path |
|
| 49 | - * |
|
| 50 | - * @param string $path Path of file |
|
| 51 | - * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image |
|
| 52 | - * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image |
|
| 53 | - * @param bool $scalingup Disable/Enable upscaling of previews |
|
| 54 | - * @param \OC\Files\View $fileview fileview object of user folder |
|
| 55 | - * @return bool|\OCP\IImage false if no preview was generated |
|
| 56 | - * @since 8.1.0 |
|
| 57 | - */ |
|
| 58 | - public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview); |
|
| 47 | + /** |
|
| 48 | + * get thumbnail for file at path $path |
|
| 49 | + * |
|
| 50 | + * @param string $path Path of file |
|
| 51 | + * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image |
|
| 52 | + * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image |
|
| 53 | + * @param bool $scalingup Disable/Enable upscaling of previews |
|
| 54 | + * @param \OC\Files\View $fileview fileview object of user folder |
|
| 55 | + * @return bool|\OCP\IImage false if no preview was generated |
|
| 56 | + * @since 8.1.0 |
|
| 57 | + */ |
|
| 58 | + public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview); |
|
| 59 | 59 | } |
@@ -37,55 +37,55 @@ |
||
| 37 | 37 | * @since 8.1.0 |
| 38 | 38 | */ |
| 39 | 39 | interface IMemcache extends ICache { |
| 40 | - /** |
|
| 41 | - * Set a value in the cache if it's not already stored |
|
| 42 | - * |
|
| 43 | - * @param string $key |
|
| 44 | - * @param mixed $value |
|
| 45 | - * @param int $ttl Time To Live in seconds. Defaults to 60*60*24 |
|
| 46 | - * @return bool |
|
| 47 | - * @since 8.1.0 |
|
| 48 | - */ |
|
| 49 | - public function add($key, $value, $ttl = 0); |
|
| 40 | + /** |
|
| 41 | + * Set a value in the cache if it's not already stored |
|
| 42 | + * |
|
| 43 | + * @param string $key |
|
| 44 | + * @param mixed $value |
|
| 45 | + * @param int $ttl Time To Live in seconds. Defaults to 60*60*24 |
|
| 46 | + * @return bool |
|
| 47 | + * @since 8.1.0 |
|
| 48 | + */ |
|
| 49 | + public function add($key, $value, $ttl = 0); |
|
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * Increase a stored number |
|
| 53 | - * |
|
| 54 | - * @param string $key |
|
| 55 | - * @param int $step |
|
| 56 | - * @return int | bool |
|
| 57 | - * @since 8.1.0 |
|
| 58 | - */ |
|
| 59 | - public function inc($key, $step = 1); |
|
| 51 | + /** |
|
| 52 | + * Increase a stored number |
|
| 53 | + * |
|
| 54 | + * @param string $key |
|
| 55 | + * @param int $step |
|
| 56 | + * @return int | bool |
|
| 57 | + * @since 8.1.0 |
|
| 58 | + */ |
|
| 59 | + public function inc($key, $step = 1); |
|
| 60 | 60 | |
| 61 | - /** |
|
| 62 | - * Decrease a stored number |
|
| 63 | - * |
|
| 64 | - * @param string $key |
|
| 65 | - * @param int $step |
|
| 66 | - * @return int | bool |
|
| 67 | - * @since 8.1.0 |
|
| 68 | - */ |
|
| 69 | - public function dec($key, $step = 1); |
|
| 61 | + /** |
|
| 62 | + * Decrease a stored number |
|
| 63 | + * |
|
| 64 | + * @param string $key |
|
| 65 | + * @param int $step |
|
| 66 | + * @return int | bool |
|
| 67 | + * @since 8.1.0 |
|
| 68 | + */ |
|
| 69 | + public function dec($key, $step = 1); |
|
| 70 | 70 | |
| 71 | - /** |
|
| 72 | - * Compare and set |
|
| 73 | - * |
|
| 74 | - * @param string $key |
|
| 75 | - * @param mixed $old |
|
| 76 | - * @param mixed $new |
|
| 77 | - * @return bool |
|
| 78 | - * @since 8.1.0 |
|
| 79 | - */ |
|
| 80 | - public function cas($key, $old, $new); |
|
| 71 | + /** |
|
| 72 | + * Compare and set |
|
| 73 | + * |
|
| 74 | + * @param string $key |
|
| 75 | + * @param mixed $old |
|
| 76 | + * @param mixed $new |
|
| 77 | + * @return bool |
|
| 78 | + * @since 8.1.0 |
|
| 79 | + */ |
|
| 80 | + public function cas($key, $old, $new); |
|
| 81 | 81 | |
| 82 | - /** |
|
| 83 | - * Compare and delete |
|
| 84 | - * |
|
| 85 | - * @param string $key |
|
| 86 | - * @param mixed $old |
|
| 87 | - * @return bool |
|
| 88 | - * @since 8.1.0 |
|
| 89 | - */ |
|
| 90 | - public function cad($key, $old); |
|
| 82 | + /** |
|
| 83 | + * Compare and delete |
|
| 84 | + * |
|
| 85 | + * @param string $key |
|
| 86 | + * @param mixed $old |
|
| 87 | + * @return bool |
|
| 88 | + * @since 8.1.0 |
|
| 89 | + */ |
|
| 90 | + public function cad($key, $old); |
|
| 91 | 91 | } |
@@ -32,13 +32,13 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | interface IFile { |
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * get list of users with access to the file |
|
| 37 | - * |
|
| 38 | - * @param string $path to the file |
|
| 39 | - * @return array |
|
| 40 | - * @since 8.1.0 |
|
| 41 | - */ |
|
| 42 | - public function getAccessList($path); |
|
| 35 | + /** |
|
| 36 | + * get list of users with access to the file |
|
| 37 | + * |
|
| 38 | + * @param string $path to the file |
|
| 39 | + * @return array |
|
| 40 | + * @since 8.1.0 |
|
| 41 | + */ |
|
| 42 | + public function getAccessList($path); |
|
| 43 | 43 | |
| 44 | 44 | } |
@@ -34,67 +34,67 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | interface IManager { |
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Check if encryption is available (at least one encryption module needs to be enabled) |
|
| 39 | - * |
|
| 40 | - * @return bool true if enabled, false if not |
|
| 41 | - * @since 8.1.0 |
|
| 42 | - */ |
|
| 43 | - public function isEnabled(); |
|
| 37 | + /** |
|
| 38 | + * Check if encryption is available (at least one encryption module needs to be enabled) |
|
| 39 | + * |
|
| 40 | + * @return bool true if enabled, false if not |
|
| 41 | + * @since 8.1.0 |
|
| 42 | + */ |
|
| 43 | + public function isEnabled(); |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * Registers an callback function which must return an encryption module instance |
|
| 47 | - * |
|
| 48 | - * @param string $id |
|
| 49 | - * @param string $displayName |
|
| 50 | - * @param callable $callback |
|
| 51 | - * @throws ModuleAlreadyExistsException |
|
| 52 | - * @since 8.1.0 |
|
| 53 | - */ |
|
| 54 | - public function registerEncryptionModule($id, $displayName, callable $callback); |
|
| 45 | + /** |
|
| 46 | + * Registers an callback function which must return an encryption module instance |
|
| 47 | + * |
|
| 48 | + * @param string $id |
|
| 49 | + * @param string $displayName |
|
| 50 | + * @param callable $callback |
|
| 51 | + * @throws ModuleAlreadyExistsException |
|
| 52 | + * @since 8.1.0 |
|
| 53 | + */ |
|
| 54 | + public function registerEncryptionModule($id, $displayName, callable $callback); |
|
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * Unregisters an encryption module |
|
| 58 | - * |
|
| 59 | - * @param string $moduleId |
|
| 60 | - * @since 8.1.0 |
|
| 61 | - */ |
|
| 62 | - public function unregisterEncryptionModule($moduleId); |
|
| 56 | + /** |
|
| 57 | + * Unregisters an encryption module |
|
| 58 | + * |
|
| 59 | + * @param string $moduleId |
|
| 60 | + * @since 8.1.0 |
|
| 61 | + */ |
|
| 62 | + public function unregisterEncryptionModule($moduleId); |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * get a list of all encryption modules |
|
| 66 | - * |
|
| 67 | - * @return array [id => ['id' => $id, 'displayName' => $displayName, 'callback' => callback]] |
|
| 68 | - * @since 8.1.0 |
|
| 69 | - */ |
|
| 70 | - public function getEncryptionModules(); |
|
| 64 | + /** |
|
| 65 | + * get a list of all encryption modules |
|
| 66 | + * |
|
| 67 | + * @return array [id => ['id' => $id, 'displayName' => $displayName, 'callback' => callback]] |
|
| 68 | + * @since 8.1.0 |
|
| 69 | + */ |
|
| 70 | + public function getEncryptionModules(); |
|
| 71 | 71 | |
| 72 | 72 | |
| 73 | - /** |
|
| 74 | - * get a specific encryption module |
|
| 75 | - * |
|
| 76 | - * @param string $moduleId Empty to get the default module |
|
| 77 | - * @return IEncryptionModule |
|
| 78 | - * @throws ModuleDoesNotExistsException |
|
| 79 | - * @since 8.1.0 |
|
| 80 | - */ |
|
| 81 | - public function getEncryptionModule($moduleId = ''); |
|
| 73 | + /** |
|
| 74 | + * get a specific encryption module |
|
| 75 | + * |
|
| 76 | + * @param string $moduleId Empty to get the default module |
|
| 77 | + * @return IEncryptionModule |
|
| 78 | + * @throws ModuleDoesNotExistsException |
|
| 79 | + * @since 8.1.0 |
|
| 80 | + */ |
|
| 81 | + public function getEncryptionModule($moduleId = ''); |
|
| 82 | 82 | |
| 83 | - /** |
|
| 84 | - * get default encryption module Id |
|
| 85 | - * |
|
| 86 | - * @return string |
|
| 87 | - * @since 8.1.0 |
|
| 88 | - */ |
|
| 89 | - public function getDefaultEncryptionModuleId(); |
|
| 83 | + /** |
|
| 84 | + * get default encryption module Id |
|
| 85 | + * |
|
| 86 | + * @return string |
|
| 87 | + * @since 8.1.0 |
|
| 88 | + */ |
|
| 89 | + public function getDefaultEncryptionModuleId(); |
|
| 90 | 90 | |
| 91 | - /** |
|
| 92 | - * set default encryption module Id |
|
| 93 | - * |
|
| 94 | - * @param string $moduleId |
|
| 95 | - * @return string |
|
| 96 | - * @since 8.1.0 |
|
| 97 | - */ |
|
| 98 | - public function setDefaultEncryptionModule($moduleId); |
|
| 91 | + /** |
|
| 92 | + * set default encryption module Id |
|
| 93 | + * |
|
| 94 | + * @param string $moduleId |
|
| 95 | + * @return string |
|
| 96 | + * @since 8.1.0 |
|
| 97 | + */ |
|
| 98 | + public function setDefaultEncryptionModule($moduleId); |
|
| 99 | 99 | |
| 100 | 100 | } |
@@ -33,151 +33,151 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | interface IStorage { |
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * get user specific key |
|
| 38 | - * |
|
| 39 | - * @param string $uid ID if the user for whom we want the key |
|
| 40 | - * @param string $keyId id of the key |
|
| 41 | - * @param string $encryptionModuleId |
|
| 42 | - * |
|
| 43 | - * @return mixed key |
|
| 44 | - * @since 8.1.0 |
|
| 45 | - */ |
|
| 46 | - public function getUserKey($uid, $keyId, $encryptionModuleId); |
|
| 36 | + /** |
|
| 37 | + * get user specific key |
|
| 38 | + * |
|
| 39 | + * @param string $uid ID if the user for whom we want the key |
|
| 40 | + * @param string $keyId id of the key |
|
| 41 | + * @param string $encryptionModuleId |
|
| 42 | + * |
|
| 43 | + * @return mixed key |
|
| 44 | + * @since 8.1.0 |
|
| 45 | + */ |
|
| 46 | + public function getUserKey($uid, $keyId, $encryptionModuleId); |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * get file specific key |
|
| 50 | - * |
|
| 51 | - * @param string $path path to file |
|
| 52 | - * @param string $keyId id of the key |
|
| 53 | - * @param string $encryptionModuleId |
|
| 54 | - * |
|
| 55 | - * @return mixed key |
|
| 56 | - * @since 8.1.0 |
|
| 57 | - */ |
|
| 58 | - public function getFileKey($path, $keyId, $encryptionModuleId); |
|
| 48 | + /** |
|
| 49 | + * get file specific key |
|
| 50 | + * |
|
| 51 | + * @param string $path path to file |
|
| 52 | + * @param string $keyId id of the key |
|
| 53 | + * @param string $encryptionModuleId |
|
| 54 | + * |
|
| 55 | + * @return mixed key |
|
| 56 | + * @since 8.1.0 |
|
| 57 | + */ |
|
| 58 | + public function getFileKey($path, $keyId, $encryptionModuleId); |
|
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * get system-wide encryption keys not related to a specific user, |
|
| 62 | - * e.g something like a key for public link shares |
|
| 63 | - * |
|
| 64 | - * @param string $keyId id of the key |
|
| 65 | - * @param string $encryptionModuleId |
|
| 66 | - * |
|
| 67 | - * @return mixed key |
|
| 68 | - * @since 8.1.0 |
|
| 69 | - */ |
|
| 70 | - public function getSystemUserKey($keyId, $encryptionModuleId); |
|
| 60 | + /** |
|
| 61 | + * get system-wide encryption keys not related to a specific user, |
|
| 62 | + * e.g something like a key for public link shares |
|
| 63 | + * |
|
| 64 | + * @param string $keyId id of the key |
|
| 65 | + * @param string $encryptionModuleId |
|
| 66 | + * |
|
| 67 | + * @return mixed key |
|
| 68 | + * @since 8.1.0 |
|
| 69 | + */ |
|
| 70 | + public function getSystemUserKey($keyId, $encryptionModuleId); |
|
| 71 | 71 | |
| 72 | - /** |
|
| 73 | - * set user specific key |
|
| 74 | - * |
|
| 75 | - * @param string $uid ID if the user for whom we want the key |
|
| 76 | - * @param string $keyId id of the key |
|
| 77 | - * @param mixed $key |
|
| 78 | - * @param string $encryptionModuleId |
|
| 79 | - * @since 8.1.0 |
|
| 80 | - */ |
|
| 81 | - public function setUserKey($uid, $keyId, $key, $encryptionModuleId); |
|
| 72 | + /** |
|
| 73 | + * set user specific key |
|
| 74 | + * |
|
| 75 | + * @param string $uid ID if the user for whom we want the key |
|
| 76 | + * @param string $keyId id of the key |
|
| 77 | + * @param mixed $key |
|
| 78 | + * @param string $encryptionModuleId |
|
| 79 | + * @since 8.1.0 |
|
| 80 | + */ |
|
| 81 | + public function setUserKey($uid, $keyId, $key, $encryptionModuleId); |
|
| 82 | 82 | |
| 83 | - /** |
|
| 84 | - * set file specific key |
|
| 85 | - * |
|
| 86 | - * @param string $path path to file |
|
| 87 | - * @param string $keyId id of the key |
|
| 88 | - * @param mixed $key |
|
| 89 | - * @param string $encryptionModuleId |
|
| 90 | - * @since 8.1.0 |
|
| 91 | - */ |
|
| 92 | - public function setFileKey($path, $keyId, $key, $encryptionModuleId); |
|
| 83 | + /** |
|
| 84 | + * set file specific key |
|
| 85 | + * |
|
| 86 | + * @param string $path path to file |
|
| 87 | + * @param string $keyId id of the key |
|
| 88 | + * @param mixed $key |
|
| 89 | + * @param string $encryptionModuleId |
|
| 90 | + * @since 8.1.0 |
|
| 91 | + */ |
|
| 92 | + public function setFileKey($path, $keyId, $key, $encryptionModuleId); |
|
| 93 | 93 | |
| 94 | - /** |
|
| 95 | - * set system-wide encryption keys not related to a specific user, |
|
| 96 | - * e.g something like a key for public link shares |
|
| 97 | - * |
|
| 98 | - * @param string $keyId id of the key |
|
| 99 | - * @param mixed $key |
|
| 100 | - * @param string $encryptionModuleId |
|
| 101 | - * |
|
| 102 | - * @return mixed key |
|
| 103 | - * @since 8.1.0 |
|
| 104 | - */ |
|
| 105 | - public function setSystemUserKey($keyId, $key, $encryptionModuleId); |
|
| 94 | + /** |
|
| 95 | + * set system-wide encryption keys not related to a specific user, |
|
| 96 | + * e.g something like a key for public link shares |
|
| 97 | + * |
|
| 98 | + * @param string $keyId id of the key |
|
| 99 | + * @param mixed $key |
|
| 100 | + * @param string $encryptionModuleId |
|
| 101 | + * |
|
| 102 | + * @return mixed key |
|
| 103 | + * @since 8.1.0 |
|
| 104 | + */ |
|
| 105 | + public function setSystemUserKey($keyId, $key, $encryptionModuleId); |
|
| 106 | 106 | |
| 107 | - /** |
|
| 108 | - * delete user specific key |
|
| 109 | - * |
|
| 110 | - * @param string $uid ID if the user for whom we want to delete the key |
|
| 111 | - * @param string $keyId id of the key |
|
| 112 | - * @param string $encryptionModuleId |
|
| 113 | - * |
|
| 114 | - * @return boolean False when the key could not be deleted |
|
| 115 | - * @since 8.1.0 |
|
| 116 | - */ |
|
| 117 | - public function deleteUserKey($uid, $keyId, $encryptionModuleId); |
|
| 107 | + /** |
|
| 108 | + * delete user specific key |
|
| 109 | + * |
|
| 110 | + * @param string $uid ID if the user for whom we want to delete the key |
|
| 111 | + * @param string $keyId id of the key |
|
| 112 | + * @param string $encryptionModuleId |
|
| 113 | + * |
|
| 114 | + * @return boolean False when the key could not be deleted |
|
| 115 | + * @since 8.1.0 |
|
| 116 | + */ |
|
| 117 | + public function deleteUserKey($uid, $keyId, $encryptionModuleId); |
|
| 118 | 118 | |
| 119 | - /** |
|
| 120 | - * delete file specific key |
|
| 121 | - * |
|
| 122 | - * @param string $path path to file |
|
| 123 | - * @param string $keyId id of the key |
|
| 124 | - * @param string $encryptionModuleId |
|
| 125 | - * |
|
| 126 | - * @return boolean False when the key could not be deleted |
|
| 127 | - * @since 8.1.0 |
|
| 128 | - */ |
|
| 129 | - public function deleteFileKey($path, $keyId, $encryptionModuleId); |
|
| 119 | + /** |
|
| 120 | + * delete file specific key |
|
| 121 | + * |
|
| 122 | + * @param string $path path to file |
|
| 123 | + * @param string $keyId id of the key |
|
| 124 | + * @param string $encryptionModuleId |
|
| 125 | + * |
|
| 126 | + * @return boolean False when the key could not be deleted |
|
| 127 | + * @since 8.1.0 |
|
| 128 | + */ |
|
| 129 | + public function deleteFileKey($path, $keyId, $encryptionModuleId); |
|
| 130 | 130 | |
| 131 | - /** |
|
| 132 | - * delete all file keys for a given file |
|
| 133 | - * |
|
| 134 | - * @param string $path to the file |
|
| 135 | - * |
|
| 136 | - * @return boolean False when the keys could not be deleted |
|
| 137 | - * @since 8.1.0 |
|
| 138 | - */ |
|
| 139 | - public function deleteAllFileKeys($path); |
|
| 131 | + /** |
|
| 132 | + * delete all file keys for a given file |
|
| 133 | + * |
|
| 134 | + * @param string $path to the file |
|
| 135 | + * |
|
| 136 | + * @return boolean False when the keys could not be deleted |
|
| 137 | + * @since 8.1.0 |
|
| 138 | + */ |
|
| 139 | + public function deleteAllFileKeys($path); |
|
| 140 | 140 | |
| 141 | - /** |
|
| 142 | - * delete system-wide encryption keys not related to a specific user, |
|
| 143 | - * e.g something like a key for public link shares |
|
| 144 | - * |
|
| 145 | - * @param string $keyId id of the key |
|
| 146 | - * @param string $encryptionModuleId |
|
| 147 | - * |
|
| 148 | - * @return boolean False when the key could not be deleted |
|
| 149 | - * @since 8.1.0 |
|
| 150 | - */ |
|
| 151 | - public function deleteSystemUserKey($keyId, $encryptionModuleId); |
|
| 141 | + /** |
|
| 142 | + * delete system-wide encryption keys not related to a specific user, |
|
| 143 | + * e.g something like a key for public link shares |
|
| 144 | + * |
|
| 145 | + * @param string $keyId id of the key |
|
| 146 | + * @param string $encryptionModuleId |
|
| 147 | + * |
|
| 148 | + * @return boolean False when the key could not be deleted |
|
| 149 | + * @since 8.1.0 |
|
| 150 | + */ |
|
| 151 | + public function deleteSystemUserKey($keyId, $encryptionModuleId); |
|
| 152 | 152 | |
| 153 | - /** |
|
| 154 | - * copy keys if a file was renamed |
|
| 155 | - * |
|
| 156 | - * @param string $source |
|
| 157 | - * @param string $target |
|
| 158 | - * @return boolean |
|
| 159 | - * @since 8.1.0 |
|
| 160 | - */ |
|
| 161 | - public function renameKeys($source, $target); |
|
| 153 | + /** |
|
| 154 | + * copy keys if a file was renamed |
|
| 155 | + * |
|
| 156 | + * @param string $source |
|
| 157 | + * @param string $target |
|
| 158 | + * @return boolean |
|
| 159 | + * @since 8.1.0 |
|
| 160 | + */ |
|
| 161 | + public function renameKeys($source, $target); |
|
| 162 | 162 | |
| 163 | - /** |
|
| 164 | - * move keys if a file was renamed |
|
| 165 | - * |
|
| 166 | - * @param string $source |
|
| 167 | - * @param string $target |
|
| 168 | - * @return boolean |
|
| 169 | - * @since 8.1.0 |
|
| 170 | - */ |
|
| 171 | - public function copyKeys($source, $target); |
|
| 163 | + /** |
|
| 164 | + * move keys if a file was renamed |
|
| 165 | + * |
|
| 166 | + * @param string $source |
|
| 167 | + * @param string $target |
|
| 168 | + * @return boolean |
|
| 169 | + * @since 8.1.0 |
|
| 170 | + */ |
|
| 171 | + public function copyKeys($source, $target); |
|
| 172 | 172 | |
| 173 | - /** |
|
| 174 | - * backup keys of a given encryption module |
|
| 175 | - * |
|
| 176 | - * @param string $encryptionModuleId |
|
| 177 | - * @param string $purpose |
|
| 178 | - * @param string $uid |
|
| 179 | - * @return bool |
|
| 180 | - * @since 12.0.0 |
|
| 181 | - */ |
|
| 182 | - public function backupUserKeys($encryptionModuleId, $purpose, $uid); |
|
| 173 | + /** |
|
| 174 | + * backup keys of a given encryption module |
|
| 175 | + * |
|
| 176 | + * @param string $encryptionModuleId |
|
| 177 | + * @param string $purpose |
|
| 178 | + * @param string $uid |
|
| 179 | + * @return bool |
|
| 180 | + * @since 12.0.0 |
|
| 181 | + */ |
|
| 182 | + public function backupUserKeys($encryptionModuleId, $purpose, $uid); |
|
| 183 | 183 | } |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | /** |
| 47 | 47 | * @since 9.2.0 |
| 48 | 48 | */ |
| 49 | - const EVENT = self::class . ':' . 'PreviewRequested'; |
|
| 49 | + const EVENT = self::class.':'.'PreviewRequested'; |
|
| 50 | 50 | |
| 51 | 51 | const MODE_FILL = 'fill'; |
| 52 | 52 | const MODE_COVER = 'cover'; |
@@ -43,86 +43,86 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | interface IPreview { |
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * @since 9.2.0 |
|
| 48 | - */ |
|
| 49 | - const EVENT = self::class . ':' . 'PreviewRequested'; |
|
| 46 | + /** |
|
| 47 | + * @since 9.2.0 |
|
| 48 | + */ |
|
| 49 | + const EVENT = self::class . ':' . 'PreviewRequested'; |
|
| 50 | 50 | |
| 51 | - const MODE_FILL = 'fill'; |
|
| 52 | - const MODE_COVER = 'cover'; |
|
| 51 | + const MODE_FILL = 'fill'; |
|
| 52 | + const MODE_COVER = 'cover'; |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * In order to improve lazy loading a closure can be registered which will be |
|
| 56 | - * called in case preview providers are actually requested |
|
| 57 | - * |
|
| 58 | - * $callable has to return an instance of \OCP\Preview\IProvider |
|
| 59 | - * |
|
| 60 | - * @param string $mimeTypeRegex Regex with the mime types that are supported by this provider |
|
| 61 | - * @param \Closure $callable |
|
| 62 | - * @return void |
|
| 63 | - * @since 8.1.0 |
|
| 64 | - */ |
|
| 65 | - public function registerProvider($mimeTypeRegex, \Closure $callable); |
|
| 54 | + /** |
|
| 55 | + * In order to improve lazy loading a closure can be registered which will be |
|
| 56 | + * called in case preview providers are actually requested |
|
| 57 | + * |
|
| 58 | + * $callable has to return an instance of \OCP\Preview\IProvider |
|
| 59 | + * |
|
| 60 | + * @param string $mimeTypeRegex Regex with the mime types that are supported by this provider |
|
| 61 | + * @param \Closure $callable |
|
| 62 | + * @return void |
|
| 63 | + * @since 8.1.0 |
|
| 64 | + */ |
|
| 65 | + public function registerProvider($mimeTypeRegex, \Closure $callable); |
|
| 66 | 66 | |
| 67 | - /** |
|
| 68 | - * Get all providers |
|
| 69 | - * @return array |
|
| 70 | - * @since 8.1.0 |
|
| 71 | - */ |
|
| 72 | - public function getProviders(); |
|
| 67 | + /** |
|
| 68 | + * Get all providers |
|
| 69 | + * @return array |
|
| 70 | + * @since 8.1.0 |
|
| 71 | + */ |
|
| 72 | + public function getProviders(); |
|
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * Does the manager have any providers |
|
| 76 | - * @return bool |
|
| 77 | - * @since 8.1.0 |
|
| 78 | - */ |
|
| 79 | - public function hasProviders(); |
|
| 74 | + /** |
|
| 75 | + * Does the manager have any providers |
|
| 76 | + * @return bool |
|
| 77 | + * @since 8.1.0 |
|
| 78 | + */ |
|
| 79 | + public function hasProviders(); |
|
| 80 | 80 | |
| 81 | - /** |
|
| 82 | - * Return a preview of a file |
|
| 83 | - * @param string $file The path to the file where you want a thumbnail from |
|
| 84 | - * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image |
|
| 85 | - * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image |
|
| 86 | - * @param boolean $scaleUp Scale smaller images up to the thumbnail size or not. Might look ugly |
|
| 87 | - * @return \OCP\IImage |
|
| 88 | - * @since 6.0.0 |
|
| 89 | - * @deprecated 11 Use getPreview |
|
| 90 | - */ |
|
| 91 | - public function createPreview($file, $maxX = 100, $maxY = 75, $scaleUp = false); |
|
| 81 | + /** |
|
| 82 | + * Return a preview of a file |
|
| 83 | + * @param string $file The path to the file where you want a thumbnail from |
|
| 84 | + * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image |
|
| 85 | + * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image |
|
| 86 | + * @param boolean $scaleUp Scale smaller images up to the thumbnail size or not. Might look ugly |
|
| 87 | + * @return \OCP\IImage |
|
| 88 | + * @since 6.0.0 |
|
| 89 | + * @deprecated 11 Use getPreview |
|
| 90 | + */ |
|
| 91 | + public function createPreview($file, $maxX = 100, $maxY = 75, $scaleUp = false); |
|
| 92 | 92 | |
| 93 | - /** |
|
| 94 | - * Returns a preview of a file |
|
| 95 | - * |
|
| 96 | - * The cache is searched first and if nothing usable was found then a preview is |
|
| 97 | - * generated by one of the providers |
|
| 98 | - * |
|
| 99 | - * @param File $file |
|
| 100 | - * @param int $width |
|
| 101 | - * @param int $height |
|
| 102 | - * @param bool $crop |
|
| 103 | - * @param string $mode |
|
| 104 | - * @param string $mimeType To force a given mimetype for the file (files_versions needs this) |
|
| 105 | - * @return ISimpleFile |
|
| 106 | - * @throws NotFoundException |
|
| 107 | - * @throws \InvalidArgumentException if the preview would be invalid (in case the original image is invalid) |
|
| 108 | - * @since 11.0.0 - \InvalidArgumentException was added in 12.0.0 |
|
| 109 | - */ |
|
| 110 | - public function getPreview(File $file, $width = -1, $height = -1, $crop = false, $mode = IPreview::MODE_FILL, $mimeType = null); |
|
| 93 | + /** |
|
| 94 | + * Returns a preview of a file |
|
| 95 | + * |
|
| 96 | + * The cache is searched first and if nothing usable was found then a preview is |
|
| 97 | + * generated by one of the providers |
|
| 98 | + * |
|
| 99 | + * @param File $file |
|
| 100 | + * @param int $width |
|
| 101 | + * @param int $height |
|
| 102 | + * @param bool $crop |
|
| 103 | + * @param string $mode |
|
| 104 | + * @param string $mimeType To force a given mimetype for the file (files_versions needs this) |
|
| 105 | + * @return ISimpleFile |
|
| 106 | + * @throws NotFoundException |
|
| 107 | + * @throws \InvalidArgumentException if the preview would be invalid (in case the original image is invalid) |
|
| 108 | + * @since 11.0.0 - \InvalidArgumentException was added in 12.0.0 |
|
| 109 | + */ |
|
| 110 | + public function getPreview(File $file, $width = -1, $height = -1, $crop = false, $mode = IPreview::MODE_FILL, $mimeType = null); |
|
| 111 | 111 | |
| 112 | - /** |
|
| 113 | - * Returns true if the passed mime type is supported |
|
| 114 | - * @param string $mimeType |
|
| 115 | - * @return boolean |
|
| 116 | - * @since 6.0.0 |
|
| 117 | - */ |
|
| 118 | - public function isMimeSupported($mimeType = '*'); |
|
| 112 | + /** |
|
| 113 | + * Returns true if the passed mime type is supported |
|
| 114 | + * @param string $mimeType |
|
| 115 | + * @return boolean |
|
| 116 | + * @since 6.0.0 |
|
| 117 | + */ |
|
| 118 | + public function isMimeSupported($mimeType = '*'); |
|
| 119 | 119 | |
| 120 | - /** |
|
| 121 | - * Check if a preview can be generated for a file |
|
| 122 | - * |
|
| 123 | - * @param \OCP\Files\FileInfo $file |
|
| 124 | - * @return bool |
|
| 125 | - * @since 8.0.0 |
|
| 126 | - */ |
|
| 127 | - public function isAvailable(\OCP\Files\FileInfo $file); |
|
| 120 | + /** |
|
| 121 | + * Check if a preview can be generated for a file |
|
| 122 | + * |
|
| 123 | + * @param \OCP\Files\FileInfo $file |
|
| 124 | + * @return bool |
|
| 125 | + * @since 8.0.0 |
|
| 126 | + */ |
|
| 127 | + public function isAvailable(\OCP\Files\FileInfo $file); |
|
| 128 | 128 | } |