From 1711b421c8d18e4cb60aea3b527ba65c7a76b152 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Tue, 4 Apr 2017 09:54:29 +0000 Subject: [PATCH] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- custompages/language.inc.php | 2 +- main/auth/ldap/login.php | 2 +- main/document/document_slideshow.inc.php | 2 +- main/inc/lib/event_email_template.class.php | 6 +++--- main/inc/lib/gradebook.lib.php | 4 ++-- main/lp/scormItem.class.php | 10 +++++----- main/lp/scormMetadata.class.php | 2 +- main/lp/scormOrganization.class.php | 2 +- main/lp/scormResource.class.php | 2 +- plugin/add_cas_logout_button/index.php | 6 +++--- plugin/add_cas_logout_button/plugin.php | 4 ++-- plugin/add_shibboleth_login_button/index.php | 6 +++--- plugin/customfooter/index.php | 2 +- plugin/show_user_info/lang/spanish.php | 2 +- .../Editor/CkEditor/Toolbar/Documents.php | 2 +- .../Editor/CkEditor/Toolbar/Project.php | 2 +- .../Toolbar/ProjectCommentStudent.php | 2 +- .../CkEditor/Toolbar/ProjectStudent.php | 2 +- .../Editor/CkEditor/Toolbar/Wiki.php | 14 ++++++------- .../CourseCopy/Resources/Announcement.php | 12 +++++------ .../Resources/CourseCopyLearnpath.php | 20 +++++++++---------- .../Controller/BreadcrumbController.php | 2 +- .../Controller/DefaultController.php | 2 +- .../ThemeBundle/Event/SidebarMenuEvent.php | 4 ++-- .../ThemeBundle/Event/TaskListEvent.php | 4 ++-- src/Chamilo/ThemeBundle/Event/ThemeEvents.php | 18 ++++++++--------- .../NavbarMessageListDemoListener.php | 6 +++--- .../NavbarNotificationListDemoListener.php | 2 +- .../NavbarTaskListDemoListener.php | 2 +- .../SidebarSetupMenuDemoListener.php | 6 +++--- .../ThemeBundle/Form/FormDemoModelType.php | 2 +- .../ThemeBundle/Model/MessageModel.php | 4 ++-- src/Chamilo/ThemeBundle/Model/UserModel.php | 4 ++-- .../ThemeBundle/Theme/ThemeManager.php | 12 +++++------ user.php | 4 ++-- 35 files changed, 89 insertions(+), 89 deletions(-) diff --git a/custompages/language.inc.php b/custompages/language.inc.php index 3e72a680f3..299d42ab84 100755 --- a/custompages/language.inc.php +++ b/custompages/language.inc.php @@ -28,7 +28,7 @@ function get_preferred_language($available_langs) { } krsort($langs, SORT_NUMERIC); // Choosing the best match - foreach($langs as $weight => $codes) { + foreach ($langs as $weight => $codes) { foreach ($codes as $code) { if (in_array($code, $available_langs)) { return $code; diff --git a/main/auth/ldap/login.php b/main/auth/ldap/login.php index 690a0ec56e..ccf62eb151 100755 --- a/main/auth/ldap/login.php +++ b/main/auth/ldap/login.php @@ -31,7 +31,7 @@ if ($loginLdapSucces) { $loginFailed = false; $uidReset = true; $_user['user_id'] = $uData['user_id']; - Session::write('_uid',$_uid); + Session::write('_uid', $_uid); // Jand: copied from event_login in events.lib.php to enable login statistics: Event::event_login($uData['user_id']); } else { diff --git a/main/document/document_slideshow.inc.php b/main/document/document_slideshow.inc.php index 8651f96a3d..d02e407248 100755 --- a/main/document/document_slideshow.inc.php +++ b/main/document/document_slideshow.inc.php @@ -71,7 +71,7 @@ $_SESSION['image_files_only'] = $image_files_only; function sort_files($table) { $tablename_direction = isset($_GET['tablename_direction']) ? Security::remove_XSS($_GET['tablename_direction']) : 'ASC'; - $accepted_extensions = array('.jpg', '.jpeg', '.gif', '.png', '.bmp','.svg'); + $accepted_extensions = array('.jpg', '.jpeg', '.gif', '.png', '.bmp', '.svg'); $temp = array(); foreach ($table as & $file_array) { diff --git a/main/inc/lib/event_email_template.class.php b/main/inc/lib/event_email_template.class.php index 7e4a221891..1c4231e548 100755 --- a/main/inc/lib/event_email_template.class.php +++ b/main/inc/lib/event_email_template.class.php @@ -20,7 +20,7 @@ class EventEmailTemplate extends Model */ public function __construct() { - $this->table = Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE); + $this->table = Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE); } /** @@ -44,7 +44,7 @@ class EventEmailTemplate extends Model // action links $content = Display::actions(array( array( - 'url' => 'event_type.php' , + 'url' => 'event_type.php', 'content' => Display::return_icon( 'new_document.png', get_lang('Add'), @@ -132,7 +132,7 @@ class EventEmailTemplate extends Model public function get_count() { - $row = Database::select('count(*) as count', $this->table, array(),'first'); + $row = Database::select('count(*) as count', $this->table, array(), 'first'); return $row['count']; } diff --git a/main/inc/lib/gradebook.lib.php b/main/inc/lib/gradebook.lib.php index 4de0f550a4..6783bec8de 100755 --- a/main/inc/lib/gradebook.lib.php +++ b/main/inc/lib/gradebook.lib.php @@ -57,7 +57,7 @@ class Gradebook extends Model } $c_id = $c_id ? intval($c_id) : api_get_course_int_id(); - $table = Database::get_course_table(TABLE_TOOL_LIST); + $table = Database::get_course_table(TABLE_TOOL_LIST); $sql = "SELECT * from $table WHERE c_id = $c_id and name='$name' LIMIT 1"; @@ -194,7 +194,7 @@ class Gradebook extends Model $selected_skills = self::get_skills_by_gradebook($gradebook_id); $clean_selected_skills = array(); if (!empty($selected_skills)) { - foreach($selected_skills as $skill) { + foreach ($selected_skills as $skill) { $clean_selected_skills[] = $skill['id']; } } diff --git a/main/lp/scormItem.class.php b/main/lp/scormItem.class.php index ab6cd9e018..60b4ca6d27 100755 --- a/main/lp/scormItem.class.php +++ b/main/lp/scormItem.class.php @@ -100,7 +100,7 @@ class scormItem extends learnpathItem } break; case 'item': - $oItem = new scormItem('manifest',$child); + $oItem = new scormItem('manifest', $child); if ($oItem->identifier != '') { $this->sub_items[$oItem->identifier] = $oItem; } @@ -119,7 +119,7 @@ class scormItem extends learnpathItem $attributes = $element->attributes; //$keep_href = ''; foreach ($attributes as $attrib) { - switch($attrib->name){ + switch ($attrib->name) { case 'identifier': $this->identifier = $attrib->value; break; @@ -172,8 +172,8 @@ class scormItem extends learnpathItem ); $abs_order++; $i = 1; - foreach($this->sub_items as $id => $dummy) { - $oSubitem =& $this->sub_items[$id]; + foreach ($this->sub_items as $id => $dummy) { + $oSubitem = & $this->sub_items[$id]; $oSubitem->get_flat_list($list, $abs_order, $i, $level + 1); $i++; } @@ -188,7 +188,7 @@ class scormItem extends learnpathItem parent::save($from_outside, $prereqs_complete); // Under certain conditions, the scorm_contact should not be set, because no scorm signal was sent. $this->scorm_contact = true; - if (!$this->scorm_contact){ + if (!$this->scorm_contact) { //error_log('New LP - was expecting SCORM message but none received', 0); } } diff --git a/main/lp/scormMetadata.class.php b/main/lp/scormMetadata.class.php index 969f4ee454..eb8685fc01 100755 --- a/main/lp/scormMetadata.class.php +++ b/main/lp/scormMetadata.class.php @@ -88,7 +88,7 @@ class scormMetadata //$keep_href = ''; if (is_array($attributes)) { foreach ($attributes as $attrib) { - if (trim($attrib->value) != ''){ + if (trim($attrib->value) != '') { $this->attribs[$attrib->name] = $attrib->value; } } diff --git a/main/lp/scormOrganization.class.php b/main/lp/scormOrganization.class.php index 0a462fed50..de177189ef 100755 --- a/main/lp/scormOrganization.class.php +++ b/main/lp/scormOrganization.class.php @@ -98,7 +98,7 @@ class scormOrganization foreach ($this->items as $id => $dummy) { $abs_order = 0; // Passes the array as a pointer so it is modified in $list directly. - $this->items[$id]->get_flat_list($list,$abs_order, $i, 0); + $this->items[$id]->get_flat_list($list, $abs_order, $i, 0); $i++; } diff --git a/main/lp/scormResource.class.php b/main/lp/scormResource.class.php index 40984c4c69..b7764d9f41 100755 --- a/main/lp/scormResource.class.php +++ b/main/lp/scormResource.class.php @@ -69,7 +69,7 @@ class scormResource } } //$keep_href = ''; - if ($element->hasAttributes()){ //in some cases we get here with an empty attributes array + if ($element->hasAttributes()) { //in some cases we get here with an empty attributes array // TODO: Find when and why we get such a case (empty array). $attributes = $element->attributes; foreach ($attributes as $attrib) { diff --git a/plugin/add_cas_logout_button/index.php b/plugin/add_cas_logout_button/index.php index 610330c7b4..2b965d5832 100755 --- a/plugin/add_cas_logout_button/index.php +++ b/plugin/add_cas_logout_button/index.php @@ -1,20 +1,20 @@ setDefaults($defaults); $plugin_info['settings_form'] = $form; // Set the templates that are going to be used -$plugin_info['templates'] = array('template.tpl'); +$plugin_info['templates'] = array('template.tpl'); diff --git a/plugin/add_shibboleth_login_button/index.php b/plugin/add_shibboleth_login_button/index.php index 3c627b268d..3becec7feb 100755 --- a/plugin/add_shibboleth_login_button/index.php +++ b/plugin/add_shibboleth_login_button/index.php @@ -1,17 +1,17 @@ getNewPageBlock(), ['Undo', 'Redo'], - ['Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath'], + ['Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath'], ['BulletedList', 'NumberedList', 'HorizontalRule'], ['JustifyLeft', 'JustifyCenter', 'JustifyBlock'], ['Format', 'Font', 'FontSize', 'Bold', 'Italic', 'TextColor', 'BGColor', 'Source'], diff --git a/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ProjectCommentStudent.php b/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ProjectCommentStudent.php index d2c03ec9fb..c45f3a0b1e 100644 --- a/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ProjectCommentStudent.php +++ b/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ProjectCommentStudent.php @@ -89,7 +89,7 @@ class ProjectCommentStudent extends Basic return [ $this->getNewPageBlock(), ['Undo', 'Redo'], - ['Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath'], + ['Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath'], ['BulletedList', 'NumberedList', 'HorizontalRule'], ['JustifyLeft', 'JustifyCenter', 'JustifyBlock'], ['Format', 'Font', 'FontSize', 'Bold', 'Italic', 'TextColor'], diff --git a/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ProjectStudent.php b/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ProjectStudent.php index 91f1b62fe9..3207041daa 100644 --- a/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ProjectStudent.php +++ b/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ProjectStudent.php @@ -90,7 +90,7 @@ class ProjectStudent extends Basic return [ $this->getNewPageBlock(), ['Undo', 'Redo'], - ['Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath'], + ['Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath'], ['BulletedList', 'NumberedList', 'HorizontalRule'], ['JustifyLeft', 'JustifyCenter', 'JustifyBlock'], ['Format', 'Font', 'FontSize', 'Bold', 'Italic', 'TextColor'], diff --git a/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Wiki.php b/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Wiki.php index d35e4c7040..2ea526c583 100644 --- a/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Wiki.php +++ b/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Wiki.php @@ -56,11 +56,11 @@ class Wiki extends Basic '-', 'Find' ], - ['Wikilink','Link','Unlink','Anchor'], - ['Image','Video','Flash','Oembed','Youtube','Audio','Asciimath'], - ['Table','HorizontalRule','Smiley','SpecialChar','leaflet'], - ['Format','Font','FontSize'], - ['Bold','Italic','Underline'], + ['Wikilink', 'Link', 'Unlink', 'Anchor'], + ['Image', 'Video', 'Flash', 'Oembed', 'Youtube', 'Audio', 'Asciimath'], + ['Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'leaflet'], + ['Format', 'Font', 'FontSize'], + ['Bold', 'Italic', 'Underline'], [ 'Subscript', 'Superscript', @@ -94,10 +94,10 @@ class Wiki extends Basic return [ $this->getNewPageBlock(), ['Undo', 'Redo'], - ['Wikilink', 'Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath', 'Asciisvg'], + ['Wikilink', 'Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath', 'Asciisvg'], ['BulletedList', 'NumberedList', 'HorizontalRule'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], - ['Styles','Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'], + ['Styles', 'Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'], api_get_setting('enabled_wiris') == 'true' ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : [''], ['Toolbarswitch'] ]; diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Announcement.php b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Announcement.php index 8539e45dd9..0c6cb9a63f 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Announcement.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Announcement.php @@ -59,13 +59,13 @@ class Announcement extends Resource $size, $comment ) { - parent::__construct($id,RESOURCE_ANNOUNCEMENT); + parent::__construct($id, RESOURCE_ANNOUNCEMENT); - $this->content = $content; - $this->title = $title; - $this->date = $date; - $this->display_order = $display_order; - $this->email_sent = $email_sent; + $this->content = $content; + $this->title = $title; + $this->date = $date; + $this->display_order = $display_order; + $this->email_sent = $email_sent; $this->attachment_path = $path; $this->attachment_filename = $filename; diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseCopyLearnpath.php b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseCopyLearnpath.php index 0ce4d5aa0d..ae6a79d863 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseCopyLearnpath.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseCopyLearnpath.php @@ -155,18 +155,18 @@ class CourseCopyLearnpath extends Resource $this->js_lib = $js_lib; $this->content_license = $content_license; $this->debug = $debug; - $this->visibility=$visibility; + $this->visibility = $visibility; - $this->use_max_score=$use_max_score; - $this->autolaunch=$autolaunch; - $this->created_on=$created_on; - $this->modified_on=$modified_on; - $this->publicated_on=$publicated_on; - $this->expired_on=$expired_on; - $this->session_id=$session_id; + $this->use_max_score = $use_max_score; + $this->autolaunch = $autolaunch; + $this->created_on = $created_on; + $this->modified_on = $modified_on; + $this->publicated_on = $publicated_on; + $this->expired_on = $expired_on; + $this->session_id = $session_id; - $this->author= $author; - $this->preview_image= $preview_image; + $this->author = $author; + $this->preview_image = $preview_image; $this->items = $items; } diff --git a/src/Chamilo/ThemeBundle/Controller/BreadcrumbController.php b/src/Chamilo/ThemeBundle/Controller/BreadcrumbController.php index 58b90bd039..501fbc0296 100644 --- a/src/Chamilo/ThemeBundle/Controller/BreadcrumbController.php +++ b/src/Chamilo/ThemeBundle/Controller/BreadcrumbController.php @@ -58,7 +58,7 @@ class BreadcrumbController extends Controller { $list = array(); if ($active) { $list[] = $active; - while(null !== ($item = $active->getActiveChild())) { + while (null !== ($item = $active->getActiveChild())) { $list[] = $item; $active = $item; } diff --git a/src/Chamilo/ThemeBundle/Controller/DefaultController.php b/src/Chamilo/ThemeBundle/Controller/DefaultController.php index 7bcb5a7fdd..5b7d11814b 100644 --- a/src/Chamilo/ThemeBundle/Controller/DefaultController.php +++ b/src/Chamilo/ThemeBundle/Controller/DefaultController.php @@ -43,7 +43,7 @@ class DefaultController extends Controller } public function formAction() { - $form =$this->createForm( new FormDemoModelType()); + $form = $this->createForm(new FormDemoModelType()); return $this->render('ChamiloThemeBundle:Default:form.html.twig', array( 'form' => $form->createView() )); diff --git a/src/Chamilo/ThemeBundle/Event/SidebarMenuEvent.php b/src/Chamilo/ThemeBundle/Event/SidebarMenuEvent.php index d0b826e507..56145f6613 100644 --- a/src/Chamilo/ThemeBundle/Event/SidebarMenuEvent.php +++ b/src/Chamilo/ThemeBundle/Event/SidebarMenuEvent.php @@ -74,9 +74,9 @@ class SidebarMenuEvent extends ThemeEvent */ public function getActive() { - foreach($this->getItems() as $item) { + foreach ($this->getItems() as $item) { /** @var $item MenuItemInterface */ - if($item->isActive()) return $item; + if ($item->isActive()) return $item; } return null; } diff --git a/src/Chamilo/ThemeBundle/Event/TaskListEvent.php b/src/Chamilo/ThemeBundle/Event/TaskListEvent.php index 6b5d782eac..478f3f39e7 100644 --- a/src/Chamilo/ThemeBundle/Event/TaskListEvent.php +++ b/src/Chamilo/ThemeBundle/Event/TaskListEvent.php @@ -30,8 +30,8 @@ class TaskListEvent extends ThemeEvent { * * @return $this */ - public function addTask(TaskInterface $taskInterface){ - $this->tasks[] = $taskInterface; + public function addTask(TaskInterface $taskInterface) { + $this->tasks[] = $taskInterface; return $this; } diff --git a/src/Chamilo/ThemeBundle/Event/ThemeEvents.php b/src/Chamilo/ThemeBundle/Event/ThemeEvents.php index e6ecb9e415..ac8a8e16cc 100644 --- a/src/Chamilo/ThemeBundle/Event/ThemeEvents.php +++ b/src/Chamilo/ThemeBundle/Event/ThemeEvents.php @@ -19,40 +19,40 @@ class ThemeEvents /** * Used to receive notification data */ - const THEME_NOTIFICATIONS = 'theme.notifications'; + const THEME_NOTIFICATIONS = 'theme.notifications'; /** * Used to receive message data */ - const THEME_MESSAGES = 'theme.messages'; + const THEME_MESSAGES = 'theme.messages'; /** * Used to receive task data */ - const THEME_TASKS = 'theme.tasks'; + const THEME_TASKS = 'theme.tasks'; /** * */ - const THEME_NAVBAR_USER = 'theme.navbar_user'; + const THEME_NAVBAR_USER = 'theme.navbar_user'; /** * used to receive breadcrumb data */ - const THEME_BREADCRUMB = 'theme.breadcrumb'; + const THEME_BREADCRUMB = 'theme.breadcrumb'; /** * used to receive the current user for the sidebar */ - const THEME_SIDEBAR_USER = 'theme.sidebar_user'; + const THEME_SIDEBAR_USER = 'theme.sidebar_user'; /** * Used for searching * @unused */ - const THEME_SIDEBAR_SEARCH = 'theme.sidebar_search'; + const THEME_SIDEBAR_SEARCH = 'theme.sidebar_search'; /** * Used to receive the sidebar menu data */ - const THEME_SIDEBAR_SETUP_MENU = 'theme.sidebar_setup_menu'; + const THEME_SIDEBAR_SETUP_MENU = 'theme.sidebar_setup_menu'; /** * Used to receive the sidebar menu data */ - const THEME_SIDEBAR_SETUP_MENU_KNP = 'theme.sidebar_setup_menu_knp'; + const THEME_SIDEBAR_SETUP_MENU_KNP = 'theme.sidebar_setup_menu_knp'; /** * */ diff --git a/src/Chamilo/ThemeBundle/EventListener/NavbarMessageListDemoListener.php b/src/Chamilo/ThemeBundle/EventListener/NavbarMessageListDemoListener.php index 6f711e84ec..8855bcb3cb 100644 --- a/src/Chamilo/ThemeBundle/EventListener/NavbarMessageListDemoListener.php +++ b/src/Chamilo/ThemeBundle/EventListener/NavbarMessageListDemoListener.php @@ -16,15 +16,15 @@ class NavbarMessageListDemoListener { public function onListMessages(MessageListEvent $event) { - foreach($this->getMessages() as $msg) { + foreach ($this->getMessages() as $msg) { $event->addMessage($msg); } } protected function getMessages() { return array( - new MessageModel(new UserModel('Karl kettenkit'),'Dude! do something!', new \DateTime('-3 days')), - new MessageModel(new UserModel('Jack Trockendoc'),'This is some subject', new \DateTime('-10 month')), + new MessageModel(new UserModel('Karl kettenkit'), 'Dude! do something!', new \DateTime('-3 days')), + new MessageModel(new UserModel('Jack Trockendoc'), 'This is some subject', new \DateTime('-10 month')), ); } diff --git a/src/Chamilo/ThemeBundle/EventListener/NavbarNotificationListDemoListener.php b/src/Chamilo/ThemeBundle/EventListener/NavbarNotificationListDemoListener.php index 89008f92bd..79eab1786b 100644 --- a/src/Chamilo/ThemeBundle/EventListener/NavbarNotificationListDemoListener.php +++ b/src/Chamilo/ThemeBundle/EventListener/NavbarNotificationListDemoListener.php @@ -16,7 +16,7 @@ class NavbarNotificationListDemoListener { public function onListNotifications(NotificationListEvent $event) { - foreach($this->getNotifications() as $notify){ + foreach ($this->getNotifications() as $notify) { $event->addNotification($notify); } diff --git a/src/Chamilo/ThemeBundle/EventListener/NavbarTaskListDemoListener.php b/src/Chamilo/ThemeBundle/EventListener/NavbarTaskListDemoListener.php index 2bf3a255c0..545f3d8a44 100644 --- a/src/Chamilo/ThemeBundle/EventListener/NavbarTaskListDemoListener.php +++ b/src/Chamilo/ThemeBundle/EventListener/NavbarTaskListDemoListener.php @@ -17,7 +17,7 @@ class NavbarTaskListDemoListener public function onListTasks(TaskListEvent $event) { - foreach($this->getTasks() as $task) { + foreach ($this->getTasks() as $task) { $event->addTask($task); } diff --git a/src/Chamilo/ThemeBundle/EventListener/SidebarSetupMenuDemoListener.php b/src/Chamilo/ThemeBundle/EventListener/SidebarSetupMenuDemoListener.php index 3ab5353882..9f115b8cac 100644 --- a/src/Chamilo/ThemeBundle/EventListener/SidebarSetupMenuDemoListener.php +++ b/src/Chamilo/ThemeBundle/EventListener/SidebarSetupMenuDemoListener.php @@ -45,12 +45,12 @@ class SidebarSetupMenuDemoListener protected function activateByRoute($route, $items) { - foreach($items as $item) { /** @var $item MenuItemModel */ - if($item->hasChildren()) { + foreach ($items as $item) { /** @var $item MenuItemModel */ + if ($item->hasChildren()) { $this->activateByRoute($route, $item->getChildren()); } else { - if($item->getRoute() == $route) { + if ($item->getRoute() == $route) { $item->setIsActive(true); } } diff --git a/src/Chamilo/ThemeBundle/Form/FormDemoModelType.php b/src/Chamilo/ThemeBundle/Form/FormDemoModelType.php index 56f6a7e14d..cb1251cb5c 100644 --- a/src/Chamilo/ThemeBundle/Form/FormDemoModelType.php +++ b/src/Chamilo/ThemeBundle/Form/FormDemoModelType.php @@ -34,7 +34,7 @@ class FormDemoModelType extends AbstractType ->add('someChoices', 'choice', array('choices' => $choices, 'expanded' => true, 'multiple' => true)) ->add('username') ->add('email') - ->add('termsAccepted','checkbox') + ->add('termsAccepted', 'checkbox') ->add('message', 'textarea') ->add('price') ->add('date', 'date', array('widget' => 'single_text')) diff --git a/src/Chamilo/ThemeBundle/Model/MessageModel.php b/src/Chamilo/ThemeBundle/Model/MessageModel.php index 32d9821d5e..c356250caa 100644 --- a/src/Chamilo/ThemeBundle/Model/MessageModel.php +++ b/src/Chamilo/ThemeBundle/Model/MessageModel.php @@ -51,11 +51,11 @@ class MessageModel implements MessageInterface * @param null $sentAt * @param UserInterface $to */ - function __construct(UserInterface $from = null, $subject= '', $sentAt = null, UserInterface $to = null) + function __construct(UserInterface $from = null, $subject = '', $sentAt = null, UserInterface $to = null) { $this->to = $to; $this->subject = $subject; - $this->sentAt = $sentAt ? : new \DateTime(); + $this->sentAt = $sentAt ?: new \DateTime(); $this->from = $from; } diff --git a/src/Chamilo/ThemeBundle/Model/UserModel.php b/src/Chamilo/ThemeBundle/Model/UserModel.php index e166576407..5567f582da 100644 --- a/src/Chamilo/ThemeBundle/Model/UserModel.php +++ b/src/Chamilo/ThemeBundle/Model/UserModel.php @@ -31,11 +31,11 @@ class UserModel implements UserInterface */ protected $isOnline = false; - function __construct($username='', $avatar = '', $memberSince = null, $isOnline = true) + function __construct($username = '', $avatar = '', $memberSince = null, $isOnline = true) { $this->avatar = $avatar; $this->isOnline = $isOnline; - $this->memberSince = $memberSince ?:new \DateTime(); + $this->memberSince = $memberSince ?: new \DateTime(); $this->username = $username; } diff --git a/src/Chamilo/ThemeBundle/Theme/ThemeManager.php b/src/Chamilo/ThemeBundle/Theme/ThemeManager.php index c08150aaf0..e12c644751 100644 --- a/src/Chamilo/ThemeBundle/Theme/ThemeManager.php +++ b/src/Chamilo/ThemeBundle/Theme/ThemeManager.php @@ -36,7 +36,7 @@ class ThemeManager function __construct($container, $resolverClass = null) { $this->container = $container; - $this->resolverClass = $resolverClass?: 'Chamilo\ThemeBundle\Util\DependencyResolver'; + $this->resolverClass = $resolverClass ?: 'Chamilo\ThemeBundle\Util\DependencyResolver'; } public function registerScript($id, $src, $deps = array(), $location = "bottom") @@ -54,7 +54,7 @@ class ThemeManager public function registerStyle($id, $src, $deps = array()) { - if(!isset($this->stylesheets[$id])) { + if (!isset($this->stylesheets[$id])) { $this->stylesheets[$id] = array( 'src' => $src, 'deps' => $deps, @@ -66,14 +66,14 @@ class ThemeManager { $unsorted = array(); $srcList = array(); $assetList = array(); - foreach($this->javascripts as $id => $scriptDefinition) { - if($scriptDefinition['location'] == $location) { + foreach ($this->javascripts as $id => $scriptDefinition) { + if ($scriptDefinition['location'] == $location) { $unsorted[$id] = $scriptDefinition; } } $queue = $this->getResolver()->register($unsorted)->resolveAll(); - foreach($queue as $def) { + foreach ($queue as $def) { $srcList[] = $def['src']; } return $srcList; @@ -83,7 +83,7 @@ class ThemeManager { $srcList = array(); $queue = $this->getResolver()->register($this->stylesheets)->resolveAll(); - foreach($queue as $def) { + foreach ($queue as $def) { $srcList[] = $def['src']; } return $srcList; diff --git a/user.php b/user.php index 9ac68d9522..a9c428e6f1 100755 --- a/user.php +++ b/user.php @@ -32,8 +32,8 @@ if (empty($array_keys)) { exit; } -$username = substr($array_keys[0],0,20); // max len of an username -$friend_id = UserManager::get_user_id_from_username($username); +$username = substr($array_keys[0], 0, 20); // max len of an username +$friend_id = UserManager::get_user_id_from_username($username); if (!$friend_id) { // we cant find your friend