|
@@ -35,14 +35,14 @@ discard block |
|
|
block discarded – undo |
|
35
|
35
|
parent::__construct($app); |
|
36
|
36
|
|
|
37
|
37
|
if ($this->app['config']->get('repository') === null) { |
|
38
|
|
- $this->app['config']->set('repository', require __DIR__.'/config/repository.php'); |
|
|
38
|
+ $this->app['config']->set('repository', require __DIR__ . '/config/repository.php'); |
|
39
|
39
|
} |
|
40
|
|
- $interfaces= str_plural(Config::get('repository.interface')); |
|
41
|
|
- $repositories= str_plural(Config::get('repository.repository')); |
|
42
|
|
- $interface= Config::get('repository.interface'); |
|
43
|
|
- $repository= Config::get('repository.repository'); |
|
|
40
|
+ $interfaces = str_plural(Config::get('repository.interface')); |
|
|
41
|
+ $repositories = str_plural(Config::get('repository.repository')); |
|
|
42
|
+ $interface = Config::get('repository.interface'); |
|
|
43
|
+ $repository = Config::get('repository.repository'); |
|
44
|
44
|
|
|
45
|
|
- $contractsFolder = Config::get('repository.app_path').'/'.$interfaces; |
|
|
45
|
+ $contractsFolder = Config::get('repository.app_path') . '/' . $interfaces; |
|
46
|
46
|
|
|
47
|
47
|
if ($contractsFolder) { |
|
48
|
48
|
$directory = new \RecursiveDirectoryIterator($contractsFolder); |
|
@@ -50,13 +50,13 @@ discard block |
|
|
block discarded – undo |
|
50
|
50
|
$regex = new \RegexIterator($iterator, '/^.+\.php$/i', \RecursiveRegexIterator::GET_MATCH); |
|
51
|
51
|
foreach ($regex as $name => $value) { |
|
52
|
52
|
|
|
53
|
|
- $contract = strstr($name,'app/') ?: strstr($name,'app\\'); |
|
54
|
|
- $contract = rtrim($contract,'.php'); |
|
|
53
|
+ $contract = strstr($name, 'app/') ?: strstr($name, 'app\\'); |
|
|
54
|
+ $contract = rtrim($contract, '.php'); |
|
55
|
55
|
|
|
56
|
56
|
$contractName = str_replace('/', '\\', ucfirst($contract)); |
|
57
|
57
|
|
|
58
|
58
|
$repositoryClass = str_replace($interfaces, $repositories, $contractName); |
|
59
|
|
- $repositoryClass = str_replace([$interface,'Interface'], $repository, $repositoryClass); |
|
|
59
|
+ $repositoryClass = str_replace([$interface, 'Interface'], $repository, $repositoryClass); |
|
60
|
60
|
|
|
61
|
61
|
$this->providers[] = $contractName; |
|
62
|
62
|
$this->bindings[$contractName] = $repositoryClass; |