In the getConfig
method in the IlluminateFilesystemFilesystemManager
class in laravel 5.1,
actually uses
$this->app['config']["filesystems.disks.{$name}"]);
Return array.
But
$this->app
Obviously a target.
Can an object be retrieved using the key value of an array? This is obviously grammatically wrong but something magical happened anyway
This is the getConfig method
/** * Get the filesystem connection configuration. * * @param string $name * @return array */ protected function getConfig($name) { return $this->app['config']["filesystems.disks.{$name}"]; }
I alone dd($this->app);
That is as follows
/** * Get the filesystem connection configuration. * * @param string $name * @return array */ protected function getConfig($name) { dd($this->app); return $this->app['config']["filesystems.disks.{$name}"]; }
Output
But I dd($this->app'config'); which is
protected function getConfig($name) { dd($this->app['config']["filesystems.disks.{$name}"]); return $this->app['config']["filesystems.disks.{$name}"]; }
Then the output is as follows
In short, $app is obviously an object, how can it be written in the form $app[$k]?