Skip to content

Commit

Permalink
Improve code organization and docblock.
Browse files Browse the repository at this point in the history
Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Jun 15, 2013
1 parent 020e7fc commit 11c6306
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 53 deletions.
6 changes: 3 additions & 3 deletions src/Orchestra/Extension/ConfigManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ class ConfigManager {
/**
* Application instance.
*
* @var Illuminate\Foundation\Application
* @var \Illuminate\Foundation\Application
*/
protected $app = null;

/**
* Construct a new Orchestra\Extension\ConfigManager instance.
*
* @access public
* @param Illuminate\Foundation\Application $app
* @param \Illuminate\Foundation\Application $app
* @return void
*/
public function __construct($app)
Expand All @@ -22,7 +22,7 @@ public function __construct($app)
}

/**
* Map configuration to allow orchestra to store it in database
* Map configuration to allow orchestra to store it in database.
*
* @access public
* @param string $name
Expand Down
11 changes: 7 additions & 4 deletions src/Orchestra/Extension/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Dispatcher {
/**
* Application instance.
*
* @var Illuminate\Foundation\Application
* @var \Illuminate\Foundation\Application
*/
protected $app = null;

Expand All @@ -27,8 +27,8 @@ class Dispatcher {
* Construct a new Application instance.
*
* @access public
* @param Illuminate\Foundation\Application $app
* @param Orchestra\Extension\ProviderRepository $provider
* @param \Illuminate\Foundation\Application $app
* @param \Orchestra\Extension\ProviderRepository $provider
* @return void
*/
public function __construct($app, ProviderRepository $provider)
Expand Down Expand Up @@ -73,7 +73,8 @@ public function register($name, $options)
/**
* Boot all extensions.
*
* @var
* @access public
* @return void
*/
public function boot()
{
Expand Down Expand Up @@ -111,6 +112,8 @@ public function start($name, $options)
* Shutdown an extension.
*
* @access public
* @param string $name
* @param array $options
* @return void
*/
public function finish($name, $options)
Expand Down
37 changes: 21 additions & 16 deletions src/Orchestra/Extension/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ class Environment {
/**
* Application instance.
*
* @var Illuminate\Foundation\Application
* @var \Illuminate\Foundation\Application
*/
protected $app = null;

/**
* Dispatcher instance.
*
* @var Orchestra\Extension\Dispatcher
* @var \Orchestra\Extension\Dispatcher
*/
protected $dispatcher = null;

/**
* Memory instance.
*
* @var Orchestra\Memory\Drivers\Driver
* @var \Orchestra\Memory\Drivers\Driver
*/
protected $memory = null;

Expand All @@ -45,8 +45,8 @@ class Environment {
* Construct a new Application instance.
*
* @access public
* @param Illuminate\Foundation\Application $app
* @param Orchestra\Extension\Dispatcher $dispatcher
* @param \Illuminate\Foundation\Application $app
* @param \Orchestra\Extension\Dispatcher $dispatcher
* @return void
*/
public function __construct($app, Dispatcher $dispatcher)
Expand All @@ -69,21 +69,24 @@ public function attach(MemoryDriver $memory)
}

/**
* Set memory provider
* Set memory provider.
*
* @access public
* @return void
* @param \Orchestra\Memory\Drivers\Driver
* @return self
*/
public function setMemoryProvider(MemoryDriver $memory)
{
$this->memory = $memory;

return $this;
}

/**
* Set memory provider
* Set memory provider.
*
* @access public
* @return void
* @return \Orchestra\Memory\Drivers\Driver
*/
public function getMemoryProvider()
{
Expand All @@ -94,7 +97,7 @@ public function getMemoryProvider()
* Boot active extensions.
*
* @access public
* @return void
* @return self
*/
public function boot()
{
Expand Down Expand Up @@ -129,10 +132,10 @@ public function boot()
}

/**
* Shutdown all Extensions.
* Shutdown all extensions.
*
* @access public
* @return void
* @return self
*/
public function finish()
{
Expand All @@ -142,10 +145,12 @@ public function finish()
}

$this->extensions = array();

return $this;
}

/**
* Get extension handle.
* Get extension route handle.
*
* @access public
* @param string $name
Expand Down Expand Up @@ -191,7 +196,7 @@ public function activate($name)
}

/**
* Deactivate an extension
* Deactivate an extension.
*
* @access public
* @param string $name
Expand Down Expand Up @@ -230,11 +235,11 @@ public function publish($name)
}

/**
* Check if extension is started
* Check if extension is started.
*
* @access public
* @param string $name
* @return bool
* @return boolean
*/
public function started($name)
{
Expand Down
12 changes: 8 additions & 4 deletions src/Orchestra/Extension/Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Finder {
/**
* Application instance.
*
* @var Illuminate\Foundation\Application
* @var \Illuminate\Foundation\Application
*/
protected $app = null;

Expand Down Expand Up @@ -45,7 +45,7 @@ class Finder {
* Construct a new finder.
*
* @access public
* @param Illuminate\Foundation\Application $app
* @param \Illuminate\Foundation\Application $app
* @return void
*/
public function __construct($app)
Expand All @@ -68,18 +68,21 @@ public function __construct($app)
*
* @access public
* @param string $path
* @return void
* @return self
*/
public function addPath($path)
{
if ( ! in_array($path, $this->paths)) $this->paths[] = $path;

return $this;
}

/**
* Detect available extension.
* Detect available extensions.
*
* @access public
* @return array
* @throws \RuntimeException
*/
public function detect()
{
Expand Down Expand Up @@ -131,6 +134,7 @@ public function detect()
* @access protected
* @param string $manifest
* @return array
* @throws \Orchestra\Extension\ManifestRuntimeException
*/
protected function getManifestContents($manifest)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Orchestra/Extension/ProviderRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ProviderRepository {
/**
* Application instance.
*
* @var Illuminate\Foundation\Application
* @var \Illuminate\Foundation\Application
*/
protected $app = null;

Expand All @@ -20,7 +20,7 @@ class ProviderRepository {
* Construct a new finder.
*
* @access public
* @param Illuminate\Foundation\Application $app
* @param \Illuminate\Foundation\Application $app
* @return void
*/
public function __construct($app)
Expand Down
39 changes: 21 additions & 18 deletions src/Orchestra/Extension/Publisher/AssetManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ class AssetManager {
/**
* Application instance.
*
* @var Illuminate\Foundation\Application
* @var \Illuminate\Foundation\Application
*/
protected $app = null;

/**
* Migrator instance.
*
* @var Illuminate\Foundation\AssetPublisher
* @var \Illuminate\Foundation\AssetPublisher
*/
protected $publisher = null;

/**
* Construct a new instance.
*
* @access public
* @param Illuminate\Foundation\Application $app
* @param Illuminate\Foundation\AssetPublisher $publisher
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Foundation\AssetPublisher $publisher
* @return void
*/
public function __construct($app, AssetPublisher $publisher)
Expand All @@ -37,31 +37,33 @@ public function __construct($app, AssetPublisher $publisher)
/**
* Run migration for an extension or application.
*
* @access public
* @access public
* @param string $name
* @param string $destinationPath
* @return void
* @return mixed
*/
public function publish($name, $destinationPath)
{
return $this->publisher->publish($name, $destinationPath);
}

/**
* Migration Orchestra Platform.
* Migrate extension.
*
* @access public
* @return void
* @param string $name
* @return mixed
* @throws \Orchestra\Extension\FilePermissionException
*/
public function foundation()
public function extension($name)
{
$path = rtrim($this->app['path.base'], '/').'/vendor/orchestra/foundation/src/public';

$path = rtrim($this->app['orchestra.extension']->option($name, 'path'), '/').'/public';
if ( ! $this->app['files']->isDirectory($path)) return false;

try
{
return $this->publish('orchestra/foundation', $path);
return $this->publish($name, $path);
}
catch (Exception $e)
{
Expand All @@ -71,20 +73,21 @@ public function foundation()
}

/**
* Migration Extension.
* Migrate Orchestra Platform.
*
* @access public
* @return void
* @return mixed
* @throws \Orchestra\Extension\FilePermissionException
*/
public function extension($name)
public function foundation()
{
$path = rtrim($this->app['orchestra.extension']->option($name, 'path'), '/').'/public';
$path = rtrim($this->app['path.base'], '/').'/vendor/orchestra/foundation/src/public';

if ( ! $this->app['files']->isDirectory($path)) return false;

try
{
return $this->publish($name, $path);
return $this->publish('orchestra/foundation', $path);
}
catch (Exception $e)
{
Expand Down

0 comments on commit 11c6306

Please sign in to comment.