@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | // Return path to Laravel configuration |
| 48 | 48 | if ($this->app->bound('path')) { |
| 49 | - $laravel = $this->app['path'] . '/config/packages/alexmanno/trucker'; |
|
| 49 | + $laravel = $this->app['path'].'/config/packages/alexmanno/trucker'; |
|
| 50 | 50 | if (file_exists($laravel)) { |
| 51 | 51 | return $laravel; |
| 52 | 52 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | public function exportConfiguration() |
| 62 | 62 | { |
| 63 | - $source = __DIR__ . '/../config'; |
|
| 63 | + $source = __DIR__.'/../config'; |
|
| 64 | 64 | $destination = $this->getConfigurationPath(); |
| 65 | 65 | |
| 66 | 66 | // Unzip configuration files |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $files = $this->app['files']->files($folder); |
| 82 | 82 | foreach ($files as $file) { |
| 83 | 83 | foreach ($values as $name => $value) { |
| 84 | - $contents = str_replace('{' . $name . '}', $value, file_get_contents($file)); |
|
| 84 | + $contents = str_replace('{'.$name.'}', $value, file_get_contents($file)); |
|
| 85 | 85 | $this->app['files']->put($file, $contents); |
| 86 | 86 | } |
| 87 | 87 | } |
@@ -104,29 +104,29 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | protected function bindConfiguration() |
| 106 | 106 | { |
| 107 | - $path = $this->app['path.base'] ? $this->app['path.base'] . '/' : ''; |
|
| 107 | + $path = $this->app['path.base'] ? $this->app['path.base'].'/' : ''; |
|
| 108 | 108 | $logs = $this->app->bound('path.storage') ? str_replace($this->unifySlashes($path), null, $this->unifySlashes($this->app['path.storage'])) : '.trucker'; |
| 109 | 109 | |
| 110 | 110 | $paths = [ |
| 111 | 111 | 'config' => '.trucker', |
| 112 | - 'logs' => $logs . '/logs', |
|
| 112 | + 'logs' => $logs.'/logs', |
|
| 113 | 113 | ]; |
| 114 | 114 | |
| 115 | 115 | foreach ($paths as $key => $file) { |
| 116 | - $filename = $path . $file; |
|
| 116 | + $filename = $path.$file; |
|
| 117 | 117 | |
| 118 | 118 | // Check whether we provided a file or folder |
| 119 | - if (!is_dir($filename) and file_exists($filename . '.php')) { |
|
| 119 | + if (!is_dir($filename) and file_exists($filename.'.php')) { |
|
| 120 | 120 | $filename .= '.php'; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | // Use configuration in current folder if none found |
| 124 | - $realpath = realpath('.') . '/' . $file; |
|
| 124 | + $realpath = realpath('.').'/'.$file; |
|
| 125 | 125 | if (!file_exists($filename) and file_exists($realpath)) { |
| 126 | 126 | $filename = $realpath; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - $this->app->instance('path.trucker.' . $key, $filename); |
|
| 129 | + $this->app->instance('path.trucker.'.$key, $filename); |
|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function bindPaths(Container $app) |
| 70 | 70 | { |
| 71 | - $app->bind('trucker.bootstrapper', function ($app) { |
|
| 71 | + $app->bind('trucker.bootstrapper', function($app) { |
|
| 72 | 72 | return new Bootstrapper($app); |
| 73 | 73 | }); |
| 74 | 74 | |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $app->bindIf('files', 'Illuminate\Filesystem\Filesystem'); |
| 91 | 91 | |
| 92 | - $app->bindIf('config', function ($app) { |
|
| 93 | - $fileloader = new FileLoader($app['files'], __DIR__ . '/../config'); |
|
| 92 | + $app->bindIf('config', function($app) { |
|
| 93 | + $fileloader = new FileLoader($app['files'], __DIR__.'/../config'); |
|
| 94 | 94 | |
| 95 | 95 | return new Repository($fileloader, 'config'); |
| 96 | 96 | }, true); |
@@ -110,56 +110,56 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function bindClasses(Container $app) |
| 112 | 112 | { |
| 113 | - $app->singleton('trucker.urls', function ($app) { |
|
| 113 | + $app->singleton('trucker.urls', function($app) { |
|
| 114 | 114 | return new Url\UrlGenerator($app); |
| 115 | 115 | }); |
| 116 | 116 | |
| 117 | - $app->singleton('trucker.config-manager', function ($app) { |
|
| 117 | + $app->singleton('trucker.config-manager', function($app) { |
|
| 118 | 118 | return new Support\ConfigManager($app); |
| 119 | 119 | }); |
| 120 | 120 | |
| 121 | - $app->bind('trucker.instance-finder', function ($app) { |
|
| 121 | + $app->bind('trucker.instance-finder', function($app) { |
|
| 122 | 122 | return new Finders\InstanceFinder($app); |
| 123 | 123 | }); |
| 124 | 124 | |
| 125 | - $app->bind('trucker.collection-finder', function ($app) { |
|
| 125 | + $app->bind('trucker.collection-finder', function($app) { |
|
| 126 | 126 | return new Finders\CollectionFinder($app); |
| 127 | 127 | }); |
| 128 | 128 | |
| 129 | - $app->bind('trucker.response', function ($app) { |
|
| 129 | + $app->bind('trucker.response', function($app) { |
|
| 130 | 130 | return new Responses\Response($app); |
| 131 | 131 | }); |
| 132 | 132 | |
| 133 | - $app->bind('trucker.model', function () { |
|
| 133 | + $app->bind('trucker.model', function() { |
|
| 134 | 134 | return new Resource\Model(); |
| 135 | 135 | }); |
| 136 | 136 | |
| 137 | 137 | //Factories |
| 138 | - $app->bind('trucker.conditions', function ($app) { |
|
| 138 | + $app->bind('trucker.conditions', function($app) { |
|
| 139 | 139 | return new Factories\QueryConditionFactory($app); |
| 140 | 140 | }); |
| 141 | 141 | |
| 142 | - $app->bind('trucker.transporter', function ($app) { |
|
| 142 | + $app->bind('trucker.transporter', function($app) { |
|
| 143 | 143 | return new Factories\ApiTransporterFactory($app); |
| 144 | 144 | }); |
| 145 | 145 | |
| 146 | - $app->bind('trucker.order', function ($app) { |
|
| 146 | + $app->bind('trucker.order', function($app) { |
|
| 147 | 147 | return new Factories\QueryResultOrderFactory($app); |
| 148 | 148 | }); |
| 149 | 149 | |
| 150 | - $app->bind('trucker.interpreter', function ($app) { |
|
| 150 | + $app->bind('trucker.interpreter', function($app) { |
|
| 151 | 151 | return new Factories\ResponseInterpreterFactory($app); |
| 152 | 152 | }); |
| 153 | 153 | |
| 154 | - $app->bind('trucker.error-handler', function ($app) { |
|
| 154 | + $app->bind('trucker.error-handler', function($app) { |
|
| 155 | 155 | return new Factories\ErrorHandlerFactory($app); |
| 156 | 156 | }); |
| 157 | 157 | |
| 158 | - $app->bind('trucker.request-factory', function ($app) { |
|
| 158 | + $app->bind('trucker.request-factory', function($app) { |
|
| 159 | 159 | return new Factories\RequestFactory($app); |
| 160 | 160 | }); |
| 161 | 161 | |
| 162 | - $app->bind('trucker.auth', function ($app) { |
|
| 162 | + $app->bind('trucker.auth', function($app) { |
|
| 163 | 163 | return new Factories\AuthFactory($app); |
| 164 | 164 | }); |
| 165 | 165 | |
@@ -176,14 +176,14 @@ discard block |
||
| 176 | 176 | protected function registerConfig(Container $app) |
| 177 | 177 | { |
| 178 | 178 | // Register config file(filename) |
| 179 | - $app['config']->package('alexmanno/trucker', __DIR__ . '/../config'); |
|
| 179 | + $app['config']->package('alexmanno/trucker', __DIR__.'/../config'); |
|
| 180 | 180 | $app['config']->getLoader(); |
| 181 | 181 | |
| 182 | 182 | // Register custom config |
| 183 | 183 | $custom = $app['path.trucker.config']; |
| 184 | 184 | if (file_exists($custom)) { |
| 185 | - $app['config']->afterLoading('trucker', function ($group, $items) use ($custom) { |
|
| 186 | - $customItems = $custom . '/' . $group . '.php'; |
|
| 185 | + $app['config']->afterLoading('trucker', function($group, $items) use ($custom) { |
|
| 186 | + $customItems = $custom.'/'.$group.'.php'; |
|
| 187 | 187 | if (!file_exists($customItems)) { |
| 188 | 188 | return $items; |
| 189 | 189 | } |