@@ -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) { |
@@ -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 | } |
@@ -1,17 +1,17 @@ |
||
1 | 1 | <?php |
2 | 2 | // Composer's autoloader |
3 | -if (is_file(__DIR__ . '/../../autoload.php')) { |
|
4 | - include __DIR__ . '/../../autoload.php'; |
|
3 | +if (is_file(__DIR__.'/../../autoload.php')) { |
|
4 | + include __DIR__.'/../../autoload.php'; |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | // Darya's autoloader |
8 | -include __DIR__ . '/src/Darya/Foundation/Autoloader.php'; |
|
8 | +include __DIR__.'/src/Darya/Foundation/Autoloader.php'; |
|
9 | 9 | |
10 | 10 | use Darya\Foundation\Autoloader; |
11 | 11 | |
12 | 12 | // Base path wherever it's included from, absolute path to the framework |
13 | 13 | $autoloader = new Autoloader(realpath('./'), array( |
14 | - 'Darya' => realpath(__DIR__ . '/src') |
|
14 | + 'Darya' => realpath(__DIR__.'/src') |
|
15 | 15 | )); |
16 | 16 | |
17 | 17 | $autoloader->register(); |
@@ -174,7 +174,7 @@ |
||
174 | 174 | $data['server']['request_method'] = strtoupper($method); |
175 | 175 | |
176 | 176 | if ($components['query']) { |
177 | - $data['server']['request_uri'] .= '?' . $components['query']; |
|
177 | + $data['server']['request_uri'] .= '?'.$components['query']; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | $request = new Request( |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $host = $this->details['host']; |
28 | 28 | |
29 | 29 | if ($this->details['port']) { |
30 | - $host .= ', ' . $this->details['port']; |
|
30 | + $host .= ', '.$this->details['port']; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | $this->connection = sqlsrv_connect($this->details['host'], array( |
@@ -55,7 +55,7 @@ |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | if (!method_exists($instance, $method)) { |
58 | - throw new RuntimeException('Call to non-existent method "' . $method . '" on facade instance'); |
|
58 | + throw new RuntimeException('Call to non-existent method "'.$method.'" on facade instance'); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | return static::$serviceContainer->call(array($instance, $method), $parameters); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function basePath($basePath = null) |
56 | 56 | { |
57 | - $this->basePath = $basePath ?: realpath(__DIR__ . '/../../'); |
|
57 | + $this->basePath = $basePath ?: realpath(__DIR__.'/../../'); |
|
58 | 58 | |
59 | 59 | return $this->basePath; |
60 | 60 | } |
@@ -131,19 +131,19 @@ discard block |
||
131 | 131 | $nsBasePaths = array(''); |
132 | 132 | |
133 | 133 | if ($this->basePath) { |
134 | - $nsBasePaths[] = $this->basePath . '/'; |
|
134 | + $nsBasePaths[] = $this->basePath.'/'; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | foreach ($nsBasePaths as $nsBasePath) { |
138 | 138 | if ($class === $ns) { |
139 | 139 | array_push($paths, "$nsBasePath$nsPath"); |
140 | 140 | array_push($paths, "$nsBasePath$nsPath/$className.php"); |
141 | - array_push($paths, "$nsBasePath" . strtolower($nsPath) . "/$className.php"); |
|
141 | + array_push($paths, "$nsBasePath".strtolower($nsPath)."/$className.php"); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | if (strpos($class, $ns) === 0) { |
145 | 145 | array_push($paths, "$nsBasePath$nsPath/$dir/$className.php"); |
146 | - array_push($paths, "$nsBasePath" . strtolower("$nsPath/$dir") . "/$className.php"); |
|
146 | + array_push($paths, "$nsBasePath".strtolower("$nsPath/$dir")."/$className.php"); |
|
147 | 147 | |
148 | 148 | $nsRemain = str_replace('\\', '/', substr($class, strlen($ns))); |
149 | 149 | array_push($paths, "$nsBasePath$nsPath/$nsRemain.php"); |
@@ -151,32 +151,32 @@ discard block |
||
151 | 151 | |
152 | 152 | $nsRemainDir = dirname($nsRemain); |
153 | 153 | $nsRemainFile = basename($nsRemain); |
154 | - array_push($paths, "$nsBasePath$nsPath/" . strtolower($nsRemainDir) . "/$nsRemainFile.php"); |
|
154 | + array_push($paths, "$nsBasePath$nsPath/".strtolower($nsRemainDir)."/$nsRemainFile.php"); |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 | } |
158 | 158 | } |
159 | 159 | |
160 | 160 | // Try using the namespace as an exact directory mapping |
161 | - array_push($paths, $this->basePath . "/$dir/$className.php"); |
|
161 | + array_push($paths, $this->basePath."/$dir/$className.php"); |
|
162 | 162 | |
163 | 163 | // Try using the namespace in lowercase as a directory mapping, with |
164 | 164 | // only the class name in its original case |
165 | 165 | $dirLowercase = strtolower($dir); |
166 | - array_push($paths, $this->basePath . "/$dirLowercase/$className.php"); |
|
166 | + array_push($paths, $this->basePath."/$dirLowercase/$className.php"); |
|
167 | 167 | |
168 | 168 | // Last try using the last part of the namespace as a subdirectory, with |
169 | 169 | // and without a trailing 's', as well as any common subdirectory names |
170 | 170 | $subdirs = array_merge($this->commonSubdirs, array( |
171 | 171 | $className, |
172 | - $className . 's', |
|
172 | + $className.'s', |
|
173 | 173 | )); |
174 | 174 | |
175 | 175 | foreach ($subdirs as $subdir) { |
176 | - array_push($paths, $this->basePath . "/$dir/$subdir/$className.php"); |
|
176 | + array_push($paths, $this->basePath."/$dir/$subdir/$className.php"); |
|
177 | 177 | |
178 | 178 | $subdirLowercase = strtolower($subdir); |
179 | - array_push($paths, $this->basePath . "/$dirLowercase/$subdirLowercase/$className.php"); |
|
179 | + array_push($paths, $this->basePath."/$dirLowercase/$subdirLowercase/$className.php"); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | // Finally, attempt to find the class |
@@ -75,7 +75,7 @@ |
||
75 | 75 | $item = array($index++, $item); |
76 | 76 | } |
77 | 77 | |
78 | - usort($data, function ($a, $b) use ($order) { |
|
78 | + usort($data, function($a, $b) use ($order) { |
|
79 | 79 | foreach ($order as $field => $direction) { |
80 | 80 | if (!isset($a[1][$field]) || !isset($b[1][$field])) { |
81 | 81 | continue; |
@@ -76,7 +76,7 @@ |
||
76 | 76 | */ |
77 | 77 | protected static function snakeToCamel($string) |
78 | 78 | { |
79 | - return preg_replace_callback('/_(.)/', function ($matches) { |
|
79 | + return preg_replace_callback('/_(.)/', function($matches) { |
|
80 | 80 | return strtoupper($matches[1]); |
81 | 81 | }, $string); |
82 | 82 | } |