@@ -279,7 +279,7 @@ |
||
| 279 | 279 | * |
| 280 | 280 | * Returns false if there was no error. |
| 281 | 281 | * |
| 282 | - * @return string|bool |
|
| 282 | + * @return string|false |
|
| 283 | 283 | */ |
| 284 | 284 | public function error() { |
| 285 | 285 | if ($error = $this->connection->error()) { |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | * @param array|string $order [optional] |
| 302 | 302 | * @param int $limit [optional] |
| 303 | 303 | * @param int $offset [optional] |
| 304 | - * @return array |
|
| 304 | + * @return Record[] |
|
| 305 | 305 | */ |
| 306 | 306 | public static function all($filter = array(), $order = array(), $limit = null, $offset = 0) { |
| 307 | 307 | return static::generate(static::load($filter, $order, $limit, $offset)); |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | * @param array|string $order [optional] |
| 336 | 336 | * @param int $limit [optional] |
| 337 | 337 | * @param int $offset [optional] |
| 338 | - * @return array |
|
| 338 | + * @return Record[] |
|
| 339 | 339 | */ |
| 340 | 340 | public static function search($query, $attributes = array(), $filter = array(), $order = array(), $limit = null, $offset = 0) { |
| 341 | 341 | $instance = new static; |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Darya\ORM\Relation; |
| 3 | 3 | |
| 4 | -use Exception; |
|
| 5 | 4 | use Darya\ORM\Record; |
| 6 | 5 | use Darya\ORM\Relation; |
| 7 | 6 | |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | * @return string |
| 114 | 114 | */ |
| 115 | 115 | protected function delimitClass($class) { |
| 116 | - return preg_replace_callback('/([A-Z])/', function ($matches) { |
|
| 116 | + return preg_replace_callback('/([A-Z])/', function($matches) { |
|
| 117 | 117 | return '_' . strtolower($matches[1]); |
| 118 | 118 | }, lcfirst(basename($class))); |
| 119 | 119 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | return $controller; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - return preg_replace_callback('/^(.)|-(.)/', function ($matches) {
|
|
| 99 | + return preg_replace_callback('/^(.)|-(.)/', function($matches) {
|
|
| 100 | 100 | return strtoupper($matches[1] ?: $matches[2]); |
| 101 | 101 | }, $controller) . 'Controller'; |
| 102 | 102 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * @return string Action method name |
| 112 | 112 | */ |
| 113 | 113 | public static function prepareAction($action) {
|
| 114 | - return preg_replace_callback('/-(.)/', function ($matches) {
|
|
| 114 | + return preg_replace_callback('/-(.)/', function($matches) {
|
|
| 115 | 115 | return strtoupper($matches[1]); |
| 116 | 116 | }, $action); |
| 117 | 117 | } |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | * @return string |
| 713 | 713 | */ |
| 714 | 714 | public function generate($path, array $parameters = array()) {
|
| 715 | - return preg_replace_callback('#/(:[A-Za-z0-9_-]+(\??))#', function ($match) use ($parameters) {
|
|
| 715 | + return preg_replace_callback('#/(:[A-Za-z0-9_-]+(\??))#', function($match) use ($parameters) {
|
|
| 716 | 716 | $parameter = trim($match[1], '?:'); |
| 717 | 717 | |
| 718 | 718 | if ($parameter && isset($parameters[$parameter])) {
|
@@ -193,7 +193,7 @@ |
||
| 193 | 193 | |
| 194 | 194 | $container = $this; |
| 195 | 195 | |
| 196 | - return function () use ($callable, $container) { |
|
| 196 | + return function() use ($callable, $container) { |
|
| 197 | 197 | static $instance; |
| 198 | 198 | |
| 199 | 199 | if ($instance === null) { |
@@ -120,7 +120,7 @@ |
||
| 120 | 120 | public function closure(array $filter, $or = false) { |
| 121 | 121 | $filterer = $this; |
| 122 | 122 | |
| 123 | - return function ($row) use ($filterer, $filter, $or) { |
|
| 123 | + return function($row) use ($filterer, $filter, $or) { |
|
| 124 | 124 | return $filterer->matches($row, $filter, $or); |
| 125 | 125 | }; |
| 126 | 126 | } |
@@ -171,7 +171,7 @@ |
||
| 171 | 171 | $this->data[$resource] = $this->filterer->map( |
| 172 | 172 | $this->data[$resource], |
| 173 | 173 | $filter, |
| 174 | - function ($row) use ($data, &$affected) { |
|
| 174 | + function($row) use ($data, &$affected) { |
|
| 175 | 175 | foreach ($data as $key => $value) { |
| 176 | 176 | $row[$key] = $value; |
| 177 | 177 | } |