Skip to content

Commit

Permalink
Implements some coding recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Manderson committed Sep 23, 2014
1 parent d7591db commit 51a37e3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
14 changes: 7 additions & 7 deletions src/Action/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ class ExceptionHandler
* Return the <code>ActionForward</code> instance (if any) returned by
* the called <code>ExceptionHandler</code>.
*
* @param ex \Exception The exception to handle
* @param ae \Phruts\Config\ExceptionConfig The ExceptionConfig corresponding to the exception
* @param mapping \Phruts\Action\ActionMapping The ActionMapping we are processing
* @param formInstance The \Phruts\Action\AbstractActionForm we are processing
* @param request The actionKernel request we are processing
* @param response The actionKernel response we are creating
* @param \Exception ex The exception to handle
* @param \Phruts\Config\ExceptionConfig ae The ExceptionConfig corresponding to the exception
* @param \Phruts\Action\ActionMapping mapping The ActionMapping we are processing
* @param \Phruts\Action\AbstractActionForm formInstance The \Phruts\Action\AbstractActionForm we are processing
* @param \Symfony\Component\HttpFoundation\Request request The actionKernel request we are processing
* @param \Symfony\Component\HttpFoundation\Response response The actionKernel response we are creating
* @return \Phruts\Config\ForwardConfig
* @exception ActionKernelException if a actionKernel exception occurs
*
Expand All @@ -29,7 +29,7 @@ class ExceptionHandler
public function execute(\Exception $ex,
\Phruts\Config\ExceptionConfig $ae,
\Phruts\Action\ActionMapping $mapping,
$formInstance,
\Phruts\Action\AbstractActionForm $formInstance = null,
\Symfony\Component\HttpFoundation\Request $request,
\Symfony\Component\HttpFoundation\Response $response) {

Expand Down
7 changes: 1 addition & 6 deletions src/Util/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,7 @@ public static function loadClass($name)
*/
public static function newInstance($name, $parent = null)
{
try {
// Load the class and get only the class name
$className = self::loadClass($name);
} catch (\Exception $e) {
throw $e;
}
self::loadClass($name);

// Get reflection information of the class
$class = new \ReflectionClass($name);
Expand Down
2 changes: 1 addition & 1 deletion src/Util/Properties.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function setProperty($key, $value)
$key = (string) $key;
$value = (string) $value;

$properties[$key] = $value;
$this->properties[$key] = $value;
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/Util/RequestUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public static function createActionForm(\Symfony\Component\HttpFoundation\Reques
$instance->setActionKernel($kernel);
} catch (\Exception $e) {
$msg = $kernel->getInternal()->getMessage(null, 'formBean', $config->getType());
throw new \Phruts\Exception($msg);
}

return $instance;
Expand Down

0 comments on commit 51a37e3

Please sign in to comment.