Snake case to camel case

This commit is contained in:
Timothy Warren 2017-02-15 11:30:16 -05:00
parent 506cce02cf
commit e5db6bebe8
6 changed files with 42 additions and 44 deletions

View File

@ -21,10 +21,8 @@ namespace Aviat\AnimeClient\Command;
*/
class ClearCache extends BaseCommand {
/**
* Run the image conversion script
* Clear the API cache
*
* @param array $args
* @param array $options
* @return void
* @throws \ConsoleKit\ConsoleException
*/

View File

@ -77,7 +77,7 @@ class Controller {
* Common data to be sent to views
* @var array
*/
protected $base_data = [
protected $baseData = [
'url_type' => 'anime',
'other_type' => 'manga',
'menu_name' => ''
@ -97,10 +97,10 @@ class Controller {
$this->config = $container->get('config');
$this->request = $container->get('request');
$this->response = $container->get('response');
$this->base_data['url'] = $auraUrlGenerator;
$this->base_data['urlGenerator'] = $urlGenerator;
$this->base_data['auth'] = $container->get('auth');
$this->base_data['config'] = $this->config;
$this->baseData['url'] = $auraUrlGenerator;
$this->baseData['urlGenerator'] = $urlGenerator;
$this->baseData['auth'] = $container->get('auth');
$this->baseData['config'] = $this->config;
$this->urlGenerator = $urlGenerator;
$session = $container->get('session');
@ -114,7 +114,7 @@ class Controller {
}
// Set a message box if available
$this->base_data['message'] = $this->session->getFlash('message');
$this->baseData['message'] = $this->session->getFlash('message');
}
/**
@ -225,9 +225,9 @@ class Controller {
{
$router = $this->container->get('dispatcher');
if (isset($this->base_data))
if (isset($this->baseData))
{
$data = array_merge($this->base_data, $data);
$data = array_merge($this->baseData, $data);
}
$route = $router->getRoute();
@ -338,19 +338,19 @@ class Controller {
/**
* Display a generic error page
*
* @param int $http_code
* @param int $httpCode
* @param string $title
* @param string $message
* @param string $long_message
* @return void
*/
public function errorPage($http_code, $title, $message, $long_message = "")
public function errorPage($httpCode, $title, $message, $long_message = "")
{
$this->outputHTML('error', [
'title' => $title,
'message' => $message,
'long_message' => $long_message
], NULL, $http_code);
], NULL, $httpCode);
}
/**

View File

@ -39,9 +39,9 @@ class Anime extends BaseController {
/**
* Data to be sent to all routes in this controller
* @var array $base_data
* @var array $baseData
*/
protected $base_data;
protected $baseData;
/**
* Data cache
@ -60,7 +60,7 @@ class Anime extends BaseController {
$this->model = $container->get('anime-model');
$this->base_data = array_merge($this->base_data, [
$this->baseData = array_merge($this->baseData, [
'menu_name' => 'anime_list',
'url_type' => 'anime',
'other_type' => 'manga',
@ -179,13 +179,13 @@ class Anime extends BaseController {
public function edit($id, $status = "all")
{
$item = $this->model->getLibraryItem($id, $status);
$raw_status_list = AnimeWatchingStatus::getConstList();
$rawStatusList = AnimeWatchingStatus::getConstList();
$statuses = [];
foreach ($raw_status_list as $status_item)
foreach ($rawStatusList as $statusItem)
{
$statuses[$status_item] = (string) $this->string($status_item)
$statuses[$statusItem] = (string) $this->string($statusItem)
->underscored()
->humanize()
->titleize();

View File

@ -29,21 +29,21 @@ class Collection extends BaseController {
/**
* The anime collection model
* @var AnimeCollectionModel $anime_collection_model
* @var AnimeCollectionModel $animeCollectionModel
*/
private $anime_collection_model;
private $animeCollectionModel;
/**
* The anime API model
* @var AnimeModel $anime_model
* @var AnimeModel $animeModel
*/
private $anime_model;
private $animeModel;
/**
* Data to ve sent to all routes in this controller
* @var array $base_data
* Data to be sent to all routes in this controller
* @var array $baseData
*/
protected $base_data;
protected $baseData;
/**
* Url Generator class
@ -61,9 +61,9 @@ class Collection extends BaseController {
parent::__construct($container);
$this->urlGenerator = $container->get('url-generator');
$this->anime_model = $container->get('anime-model');
$this->anime_collection_model = $container->get('anime-collection-model');
$this->base_data = array_merge($this->base_data, [
$this->animeModel = $container->get('anime-model');
$this->animeCollectionModel = $container->get('anime-collection-model');
$this->baseData = array_merge($this->baseData, [
'menu_name' => 'collection',
'url_type' => 'anime',
'other_type' => 'manga',
@ -80,7 +80,7 @@ class Collection extends BaseController {
{
$queryParams = $this->request->getQueryParams();
$query = $queryParams['query'];
$this->outputJSON($this->anime_model->search($query));
$this->outputJSON($this->animeModel->search($query));
}
/**
@ -96,12 +96,12 @@ class Collection extends BaseController {
'list' => 'list'
];
$data = $this->anime_collection_model->get_collection();
$data = $this->animeCollectionModel->get_collection();
$this->outputHTML('collection/' . $view_map[$view], [
'title' => $this->config->get('whose_list') . "'s Anime Collection",
'sections' => $data,
'genres' => $this->anime_collection_model->get_genre_list()
'genres' => $this->animeCollectionModel->get_genre_list()
]);
}
@ -121,8 +121,8 @@ class Collection extends BaseController {
'action' => $action,
'action_url' => $this->urlGenerator->full_url('collection/' . strtolower($action)),
'title' => $this->config->get('whose_list') . " Anime Collection · {$action}",
'media_items' => $this->anime_collection_model->get_media_type_list(),
'item' => ($action === "Edit") ? $this->anime_collection_model->get($id) : []
'media_items' => $this->animeCollectionModel->get_media_type_list(),
'item' => ($action === "Edit") ? $this->animeCollectionModel->get($id) : []
]);
}
@ -136,7 +136,7 @@ class Collection extends BaseController {
$data = $this->request->getParsedBody();
if (array_key_exists('hummingbird_id', $data))
{
$this->anime_collection_model->update($data);
$this->animeCollectionModel->update($data);
$this->set_flash_message('Successfully updated collection item.', 'success');
}
else
@ -157,7 +157,7 @@ class Collection extends BaseController {
$data = $this->request->getParsedBody();
if (array_key_exists('id', $data))
{
$this->anime_collection_model->add($data);
$this->animeCollectionModel->add($data);
$this->set_flash_message('Successfully added collection item', 'success');
}
else
@ -181,7 +181,7 @@ class Collection extends BaseController {
$this->redirect("/collection/view", 303);
}
$this->anime_collection_model->delete($data);
$this->animeCollectionModel->delete($data);
$this->set_flash_message("Successfully removed anime from collection.", 'success');
$this->redirect("/collection/view", 303);

View File

@ -39,9 +39,9 @@ class Manga extends Controller {
/**
* Data to ve sent to all routes in this controller
* @var array $base_data
* @var array $baseData
*/
protected $base_data;
protected $baseData;
/**
* Constructor
@ -53,7 +53,7 @@ class Manga extends Controller {
parent::__construct($container);
$this->model = $container->get('manga-model');
$this->base_data = array_merge($this->base_data, [
$this->baseData = array_merge($this->baseData, [
'menu_name' => 'manga_list',
'config' => $this->config,
'url_type' => 'manga',

View File

@ -28,13 +28,13 @@ class Menu {
/**
* Create the html for the selected menu
*
* @param string $menu_name
* @param string $menuName
* @return string
*/
public function __invoke($menu_name)
public function __invoke($menuName)
{
$generator = new MenuGenerator($this->container);
return $generator->generate($menu_name);
return $generator->generate($menuName);
}
}