Minor - Format code and PSR

1.10.x
Angel Fernando Quiroz Campos 10 years ago
parent 22263820bf
commit fca2160069
  1. 27
      plugin/buycourses/src/buy_course_plugin.class.php
  2. 3
      src/Chamilo/CoreBundle/Entity/Skill.php

@ -1,16 +1,13 @@
<?php <?php
/* For license terms, see /license.txt */ /* For license terms, see /license.txt */
/** /**
* Description of buy_courses_plugin * Plugin class for the BuyCourses plugin
* @package chamilo.plugin.buycourses * @package chamilo.plugin.buycourses
* @author Jose Angel Ruiz <jaruiz@nosolored.com> * @author Jose Angel Ruiz <jaruiz@nosolored.com>
* @author Imanol Losada <imanol.losada@beeznest.com> * @author Imanol Losada <imanol.losada@beeznest.com>
* @author Alex Aragón <alex.aragon@beeznest.com> * @author Alex Aragón <alex.aragon@beeznest.com>
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com> * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
*/ */
/**
* Plugin class for the BuyCourses plugin
*/
class BuyCoursesPlugin extends Plugin class BuyCoursesPlugin extends Plugin
{ {
const TABLE_PAYPAL = 'plugin_buycourses_paypal_account'; const TABLE_PAYPAL = 'plugin_buycourses_paypal_account';
@ -72,14 +69,14 @@ class BuyCoursesPlugin extends Plugin
self::TABLE_CURRENCY self::TABLE_CURRENCY
); );
$em = Database::getManager(); $em = Database::getManager();
$cn = $em -> getConnection(); $cn = $em->getConnection();
$sm = $cn -> getSchemaManager(); $sm = $cn->getSchemaManager();
$tables = $sm ->tablesExist($tablesToBeCompared); $tables = $sm->tablesExist($tablesToBeCompared);
if ($tables) { if ($tables) {
return false; return false;
} }
require_once api_get_path(SYS_PLUGIN_PATH) . 'buycourses/database.php'; require_once api_get_path(SYS_PLUGIN_PATH) . 'buycourses/database.php';
} }
@ -237,7 +234,7 @@ class BuyCoursesPlugin extends Plugin
{ {
$entityManager = Database::getManager(); $entityManager = Database::getManager();
$query = $entityManager->createQueryBuilder(); $query = $entityManager->createQueryBuilder();
$courses = $query $courses = $query
->select('c') ->select('c')
->from('ChamiloCoreBundle:Course', 'c') ->from('ChamiloCoreBundle:Course', 'c')
@ -419,7 +416,7 @@ class BuyCoursesPlugin extends Plugin
'title' => $course->getTitle(), 'title' => $course->getTitle(),
'coaches' => [] 'coaches' => []
]; ];
$userCourseSubscriptions = $session->getUserCourseSubscriptionsByStatus( $userCourseSubscriptions = $session->getUserCourseSubscriptionsByStatus(
$course, $course,
Chamilo\CoreBundle\Entity\Session::COACH Chamilo\CoreBundle\Entity\Session::COACH
@ -602,7 +599,7 @@ class BuyCoursesPlugin extends Plugin
* @param array $sessionId The session ID * @param array $sessionId The session ID
* @return array * @return array
*/ */
public function getSessionInfo($sessionId) public function getSessionInfo($sessionId)
{ {
$entityManager = Database::getManager(); $entityManager = Database::getManager();
$session = $entityManager->find('ChamiloCoreBundle:Session', $sessionId); $session = $entityManager->find('ChamiloCoreBundle:Session', $sessionId);

@ -198,7 +198,8 @@ class Skill
* Get the icon URL * Get the icon URL
* @return string * @return string
*/ */
public function getWebIconPath(){ public function getWebIconPath()
{
if ($this->getIcon()) { if ($this->getIcon()) {
return api_get_path(WEB_UPLOAD_PATH) . "badges/{$this->getIcon()}"; return api_get_path(WEB_UPLOAD_PATH) . "badges/{$this->getIcon()}";
} }

Loading…
Cancel
Save