Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 6357a22

Browse files
author
Jamie Snape
committed
Fix style errors
1 parent cb6d681 commit 6357a22

File tree

497 files changed

+2633
-3183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

497 files changed

+2633
-3183
lines changed

core/ApiController.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
limitations under the License.
1919
=========================================================================*/
2020

21-
/**
22-
* API controller base class.
23-
*
24-
* @package Core\Controller
25-
*/
21+
/** API controller base class. */
2622
class ApiController extends REST_Controller
2723
{
2824
/** @var array */
@@ -143,7 +139,7 @@ protected function _genericAction($args, $resource, $restAction, $apiFunctions,
143139
if (isset($resultsArray)) {
144140
$apiResults['data'] = $resultsArray;
145141
} else { // if the api function doesn't provide an return value
146-
$apiResults['msg'] = "succeed!"; // there is no exception if code reaches here
142+
$apiResults['msg'] = 'succeed!'; // there is no exception if code reaches here
147143
}
148144
} else {
149145
$apiResults = $resultsArray;

core/AppComponent.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
limitations under the License.
1919
=========================================================================*/
2020

21-
/**
22-
* Generic component class.
23-
*
24-
* @package Core\Component
25-
*/
21+
/** Generic component class. */
2622
class AppComponent extends MIDAS_GlobalComponent
2723
{
2824
}

core/AppController.php

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,13 @@
1919
=========================================================================*/
2020

2121
// Exception Messages
22-
define('MIDAS_ADMIN_PRIVILEGES_REQUIRED', "Administrative privileges required.");
23-
define('MIDAS_AJAX_REQUEST_ONLY', "This page should only be requested by ajax.");
24-
define('MIDAS_LOGIN_REQUIRED', "User should be logged in to access this page.");
25-
26-
/**
27-
* Generic controller class.
28-
*
29-
* @package Core\Controller
30-
*/
22+
define('MIDAS_ADMIN_PRIVILEGES_REQUIRED', 'Administrative privileges required.');
23+
define('MIDAS_AJAX_REQUEST_ONLY', 'This page should only be requested by ajax.');
24+
define('MIDAS_LOGIN_REQUIRED', 'User should be logged in to access this page.');
25+
26+
/** Generic controller class. */
3127
class AppController extends MIDAS_GlobalController
3228
{
33-
3429
/** @var string */
3530
protected $coreWebroot;
3631

@@ -46,15 +41,14 @@ class AppController extends MIDAS_GlobalController
4641
/**
4742
* Pre-dispatch routines.
4843
*
49-
* @return void
5044
* @throws Zend_Exception
5145
*/
5246
public function preDispatch()
5347
{
5448
parent::preDispatch();
5549
$this->view->setEncoding('UTF-8');
5650

57-
$this->view->setScriptPath(BASE_PATH."/core/views");
51+
$this->view->setScriptPath(BASE_PATH.'/core/views');
5852

5953
$fc = Zend_Controller_Front::getInstance();
6054
$module = $fc->getRequest()->getModuleName();
@@ -205,22 +199,22 @@ public function preDispatch()
205199

206200
// create a global javascript json array
207201
$jsonGlobal = array(
208-
"webroot" => $this->view->webroot,
209-
"coreWebroot" => $this->view->coreWebroot,
210-
"logged" => $this->logged,
211-
"needToLog" => false,
212-
"currentUri" => $this->getRequest()->REQUEST_URI,
213-
"lang" => Zend_Registry::get('configGlobal')->application->lang,
214-
"dynamichelp" => $this->isDynamicHelp(),
215-
"dynamichelpAnimate" => $this->isDynamicHelp() && isset($_GET['first']),
216-
"startingGuide" => $this->isStartingGuide(),
217-
"Yes" => $this->t('Yes'),
218-
"No" => $this->t('No'),
202+
'webroot' => $this->view->webroot,
203+
'coreWebroot' => $this->view->coreWebroot,
204+
'logged' => $this->logged,
205+
'needToLog' => false,
206+
'currentUri' => $this->getRequest()->REQUEST_URI,
207+
'lang' => Zend_Registry::get('configGlobal')->application->lang,
208+
'dynamichelp' => $this->isDynamicHelp(),
209+
'dynamichelpAnimate' => $this->isDynamicHelp() && isset($_GET['first']),
210+
'startingGuide' => $this->isStartingGuide(),
211+
'Yes' => $this->t('Yes'),
212+
'No' => $this->t('No'),
219213
);
220214

221215
$login = array(
222-
"titleUploadLogin" => $this->t('Please log in'),
223-
"contentUploadLogin" => $this->t('You need to be logged in to be able to upload files.'),
216+
'titleUploadLogin' => $this->t('Please log in'),
217+
'contentUploadLogin' => $this->t('You need to be logged in to be able to upload files.'),
224218
);
225219

226220
$browse = array(
@@ -260,7 +254,7 @@ public function preDispatch()
260254
),
261255
);
262256

263-
$feed = array("deleteFeed" => $this->t('Do you really want to delete the feed?'));
257+
$feed = array('deleteFeed' => $this->t('Do you really want to delete the feed?'));
264258

265259
$this->view->json = array('global' => $jsonGlobal, 'login' => $login, 'feed' => $feed, 'browse' => $browse);
266260

@@ -542,7 +536,7 @@ public function requireUserPrivileges()
542536
*/
543537
protected function t($text)
544538
{
545-
Zend_Loader::loadClass("InternationalizationComponent", BASE_PATH.'/core/controllers/components');
539+
Zend_Loader::loadClass('InternationalizationComponent', BASE_PATH.'/core/controllers/components');
546540

547541
return InternationalizationComponent::translate($text);
548542
}

core/AppForm.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
limitations under the License.
1919
=========================================================================*/
2020

21-
/**
22-
* Generic form class.
23-
*
24-
* @package Core\Forms
25-
*/
21+
/** Generic form class. */
2622
class AppForm
2723
{
2824
/** Constructor. */
@@ -40,7 +36,7 @@ public function __construct()
4036
*/
4137
protected function t($text)
4238
{
43-
Zend_Loader::loadClass("InternationalizationComponent", BASE_PATH.'/core/controllers/components');
39+
Zend_Loader::loadClass('InternationalizationComponent', BASE_PATH.'/core/controllers/components');
4440

4541
return InternationalizationComponent::translate($text);
4642
}

core/Bootstrap.php

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
/**
2222
* Bootstrap. Provides common functionality including dependency checking
2323
* algorithms and the ability to load bootstrap resources on demand.
24-
*
25-
* @package Core
2624
*/
2725
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
2826
{
@@ -73,8 +71,8 @@ protected function _initConfig()
7371
Zend_Registry::set('configCore', $configCore);
7472

7573
// check if internationalization enabled
76-
if (isset($configCore->internationalization) && $configCore->internationalization == "0") {
77-
$configGlobal->application->lang = "en";
74+
if (isset($configCore->internationalization) && $configCore->internationalization == '0') {
75+
$configGlobal->application->lang = 'en';
7876
}
7977

8078
$config = new Zend_Config_Ini(APPLICATION_CONFIG, $configGlobal->environment, true);
@@ -194,7 +192,7 @@ protected function _initZFDebug()
194192
'Exception',
195193
'File' => array('basePath' => BASE_PATH),
196194
'Html',
197-
)
195+
),
198196
);
199197

200198
$debug = new ZFDebug_Controller_Plugin_Debug($options);
@@ -289,36 +287,36 @@ protected function _initRouter()
289287
$apiModules = array();
290288
foreach ($modules as $key => $module) {
291289
if ($module == 1 && file_exists(BASE_PATH.'/modules/'.$key) && file_exists(
292-
BASE_PATH."/modules/".$key."/AppController.php"
290+
BASE_PATH.'/modules/'.$key.'/AppController.php'
293291
)
294292
) {
295293
$listeModule[] = $key;
296294
// get web API controller directories and web API module names for enabled modules
297-
if (file_exists(BASE_PATH."/modules/".$key."/controllers/api")) {
295+
if (file_exists(BASE_PATH.'/modules/'.$key.'/controllers/api')) {
298296
$frontController->addControllerDirectory(
299-
BASE_PATH."/modules/".$key."/controllers/api",
300-
"api".$key
297+
BASE_PATH.'/modules/'.$key.'/controllers/api',
298+
'api'.$key
301299
);
302300
$apiModules[] = $key;
303301
}
304302
} elseif ($module == 1 && file_exists(BASE_PATH.'/privateModules/'.$key) && file_exists(
305-
BASE_PATH."/privateModules/".$key."/AppController.php"
303+
BASE_PATH.'/privateModules/'.$key.'/AppController.php'
306304
)
307305
) {
308306
$listeModule[] = $key;
309307
// get web API controller directories and web API module names for enabled modules
310-
if (file_exists(BASE_PATH."/privateModules/".$key."/controllers/api")) {
308+
if (file_exists(BASE_PATH.'/privateModules/'.$key.'/controllers/api')) {
311309
$frontController->addControllerDirectory(
312-
BASE_PATH."/privateModules/".$key."/controllers/api",
313-
"api".$key
310+
BASE_PATH.'/privateModules/'.$key.'/controllers/api',
311+
'api'.$key
314312
);
315313
$apiModules[] = $key;
316314
}
317315
}
318316
}
319317

320318
// get web API controller directory for core APIs
321-
require_once BASE_PATH."/core/ApiController.php";
319+
require_once BASE_PATH.'/core/ApiController.php';
322320
$frontController->addControllerDirectory(BASE_PATH.'/core/controllers/api', 'rest');
323321
// add RESTful route for web APIs
324322
$restRoute = new Zend_Rest_Route($frontController, array(), array('rest'));
@@ -328,63 +326,63 @@ protected function _initRouter()
328326
$route = $m;
329327
$nameModule = $m;
330328
$router->addRoute(
331-
$nameModule."-1",
329+
$nameModule.'-1',
332330
new Zend_Controller_Router_Route(
333-
"".$route."/:controller/:action/*", array('module' => $nameModule)
331+
''.$route.'/:controller/:action/*', array('module' => $nameModule)
334332
)
335333
);
336334
$router->addRoute(
337-
$nameModule."-2",
335+
$nameModule.'-2',
338336
new Zend_Controller_Router_Route(
339-
"".$route."/:controller/",
337+
''.$route.'/:controller/',
340338
array('module' => $nameModule, 'action' => 'index')
341339
)
342340
);
343341
$router->addRoute(
344-
$nameModule."-3",
342+
$nameModule.'-3',
345343
new Zend_Controller_Router_Route(
346-
"".$route."/",
344+
''.$route.'/',
347345
array('module' => $nameModule, 'controller' => 'index', 'action' => 'index')
348346
)
349347
);
350348

351-
if (file_exists(BASE_PATH."/modules/".$route."/AppController.php")) {
352-
require_once BASE_PATH."/modules/".$route."/AppController.php";
349+
if (file_exists(BASE_PATH.'/modules/'.$route.'/AppController.php')) {
350+
require_once BASE_PATH.'/modules/'.$route.'/AppController.php';
353351
}
354-
if (file_exists(BASE_PATH."/modules/".$route."/models/AppDao.php")) {
355-
require_once BASE_PATH."/modules/".$route."/models/AppDao.php";
352+
if (file_exists(BASE_PATH.'/modules/'.$route.'/models/AppDao.php')) {
353+
require_once BASE_PATH.'/modules/'.$route.'/models/AppDao.php';
356354
}
357-
if (file_exists(BASE_PATH."/modules/".$route."/models/AppModel.php")) {
358-
require_once BASE_PATH."/modules/".$route."/models/AppModel.php";
355+
if (file_exists(BASE_PATH.'/modules/'.$route.'/models/AppModel.php')) {
356+
require_once BASE_PATH.'/modules/'.$route.'/models/AppModel.php';
359357
}
360-
if (file_exists(BASE_PATH."/modules/".$route."/constant/module.php")) {
361-
require_once BASE_PATH."/modules/".$route."/constant/module.php";
358+
if (file_exists(BASE_PATH.'/modules/'.$route.'/constant/module.php')) {
359+
require_once BASE_PATH.'/modules/'.$route.'/constant/module.php';
362360
}
363361

364-
if (file_exists(BASE_PATH."/privateModules/".$route."/AppController.php")) {
365-
require_once BASE_PATH."/privateModules/".$route."/AppController.php";
362+
if (file_exists(BASE_PATH.'/privateModules/'.$route.'/AppController.php')) {
363+
require_once BASE_PATH.'/privateModules/'.$route.'/AppController.php';
366364
}
367-
if (file_exists(BASE_PATH."/privateModules/".$route."/models/AppDao.php")) {
368-
require_once BASE_PATH."/privateModules/".$route."/models/AppDao.php";
365+
if (file_exists(BASE_PATH.'/privateModules/'.$route.'/models/AppDao.php')) {
366+
require_once BASE_PATH.'/privateModules/'.$route.'/models/AppDao.php';
369367
}
370-
if (file_exists(BASE_PATH."/privateModules/".$route."/models/AppModel.php")) {
371-
require_once BASE_PATH."/privateModules/".$route."/models/AppModel.php";
368+
if (file_exists(BASE_PATH.'/privateModules/'.$route.'/models/AppModel.php')) {
369+
require_once BASE_PATH.'/privateModules/'.$route.'/models/AppModel.php';
372370
}
373-
if (file_exists(BASE_PATH."/privateModules/".$route."/constant/module.php")) {
374-
require_once BASE_PATH."/privateModules/".$route."/constant/module.php";
371+
if (file_exists(BASE_PATH.'/privateModules/'.$route.'/constant/module.php')) {
372+
require_once BASE_PATH.'/privateModules/'.$route.'/constant/module.php';
375373
}
376374

377-
$dir = BASE_PATH."/modules/".$route."/models/base";
375+
$dir = BASE_PATH.'/modules/'.$route.'/models/base';
378376
if (!is_dir($dir)) {
379-
$dir = BASE_PATH."/privateModules/".$route."/models/base";
377+
$dir = BASE_PATH.'/privateModules/'.$route.'/models/base';
380378
}
381379

382380
if (is_dir($dir)) {
383381
$objects = scandir($dir);
384382
foreach ($objects as $object) {
385-
if ($object != "." && $object != "..") {
386-
if (filetype($dir."/".$object) != "dir") {
387-
require_once $dir."/".$object;
383+
if ($object != '.' && $object != '..') {
384+
if (filetype($dir.'/'.$object) != 'dir') {
385+
require_once $dir.'/'.$object;
388386
}
389387
}
390388
}

core/ComponentLoader.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
* Legacy component loader.
2323
*
2424
* @deprecated replaced by static methods of MidasLoader
25-
* @package Core\Deprecated
2625
*/
2726
class MIDAS_ComponentLoader
2827
{

core/GlobalComponent.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
limitations under the License.
1919
=========================================================================*/
2020

21-
/**
22-
* Generic component base class.
23-
*
24-
* @package Core\Component
25-
*/
21+
/** Generic component base class. */
2622
class MIDAS_GlobalComponent extends Zend_Controller_Action_Helper_Abstract
2723
{
2824
/**

0 commit comments

Comments
 (0)