Minor: Format code

pull/5880/head
Angel Fernando Quiroz Campos 11 months ago
parent 7c5857d456
commit e4b75cec33
No known key found for this signature in database
GPG Key ID: B284841AE3E562CD
  1. 4
      main/admin/export_exercise_results.php
  2. 2
      main/cron/forum_bulk_notification_to_course_teacher_for_new_post_in_last_X_days.php
  3. 2
      plugin/buycourses/src/stripe_success.php
  4. 6
      plugin/h5pimport/Entity/H5pImport.php
  5. 8
      plugin/h5pimport/Entity/H5pImportLibrary.php
  6. 10
      plugin/h5pimport/Entity/H5pImportResults.php
  7. 4
      plugin/h5pimport/src/H5pPackageImporter.php
  8. 8
      plugin/h5pimport/src/H5pPackageTools.php
  9. 6
      plugin/h5pimport/src/ZipPackageImporter.php
  10. 8
      plugin/h5pimport/src/ajax.php
  11. 2
      plugin/h5pimport/view.php
  12. 1
      plugin/onlyoffice/ajax/saveas.php
  13. 7
      plugin/onlyoffice/callback.php
  14. 1
      plugin/onlyoffice/create.php
  15. 3
      plugin/onlyoffice/editor.php
  16. 1
      plugin/onlyoffice/error.php
  17. 1
      plugin/onlyoffice/install.php
  18. 1
      plugin/onlyoffice/lib/langManager.php
  19. 2
      plugin/onlyoffice/lib/onlyofficeAppRequests.php
  20. 2
      plugin/onlyoffice/lib/onlyofficeConfigService.php
  21. 2
      plugin/onlyoffice/lib/onlyofficeDocumentManager.php
  22. 2
      plugin/onlyoffice/lib/onlyofficeFormatsManager.php
  23. 1
      plugin/onlyoffice/lib/onlyofficeSettingsFormBuilder.php
  24. 3
      plugin/onlyoffice/lib/onlyofficeTools.php
  25. 1
      plugin/onlyoffice/lib/templateManager.php
  26. 1
      plugin/onlyoffice/plugin.php
  27. 1
      plugin/onlyoffice/uninstall.php

@ -181,9 +181,9 @@ Display::display_header(get_lang('ExportExerciseAllResults'));
echo Display::return_message(
get_lang('PleaseWaitThisCouldTakeAWhile'),
'normal',
false,
false
);
echo $form->display();
$form->display();
Display::display_footer();

@ -109,7 +109,7 @@ function sendMessage(
$toUserId,
$subject,
$content,
1,
1
);
}

@ -45,7 +45,7 @@ if (!empty($globalParameters['sale_email'])) {
$plugin->get_lang('bc_subject'),
$messageConfirmBuyerTemplate->fetch('buycourses/view/message_confirm_buyer.tpl'),
'',
$globalParameters['sale_email'],
$globalParameters['sale_email']
);
$messageConfirmTemplate = new Template();

@ -74,7 +74,7 @@ class H5pImport
private $course;
/**
* @var null|Session
* @var Session|null
*
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session")
*
@ -83,14 +83,14 @@ class H5pImport
private $session;
/**
* @var null|string
* @var string|null
*
* @ORM\Column(name="name", type="text", nullable=true)
*/
private $name;
/**
* @var null|string
* @var string|null
*
* @ORM\Column(name="description", type="text", nullable=true)
*/

@ -298,24 +298,24 @@ class H5pImportLibrary extends EntityRepository
return $this;
}
public function getCreatedAt(): \DateTime
public function getCreatedAt(): DateTime
{
return $this->createdAt;
}
public function setCreatedAt(\DateTime $createdAt): H5pImportLibrary
public function setCreatedAt(DateTime $createdAt): H5pImportLibrary
{
$this->createdAt = $createdAt;
return $this;
}
public function getModifiedAt(): \DateTime
public function getModifiedAt(): DateTime
{
return $this->modifiedAt;
}
public function setModifiedAt(\DateTime $modifiedAt): H5pImportLibrary
public function setModifiedAt(DateTime $modifiedAt): H5pImportLibrary
{
$this->modifiedAt = $modifiedAt;

@ -68,7 +68,7 @@ class H5pImportResults
private $course;
/**
* @var null|Session
* @var Session|null
*
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session")
*
@ -205,7 +205,7 @@ class H5pImportResults
return $this;
}
public function getCreatedAt(): \DateTime
public function getCreatedAt(): DateTime
{
return $this->createdAt;
}
@ -246,19 +246,19 @@ class H5pImportResults
return $this;
}
public function setCreatedAt(\DateTime $createdAt): H5pImportResults
public function setCreatedAt(DateTime $createdAt): H5pImportResults
{
$this->createdAt = $createdAt;
return $this;
}
public function getModifiedAt(): \DateTime
public function getModifiedAt(): DateTime
{
return $this->modifiedAt;
}
public function setModifiedAt(\DateTime $modifiedAt): H5pImportResults
public function setModifiedAt(DateTime $modifiedAt): H5pImportResults
{
$this->modifiedAt = $modifiedAt;

@ -65,9 +65,9 @@ abstract class H5pPackageImporter
/**
* Check the package and unzip it, checking if it has the 'h5p.json' file or some php script.
*
* @return mixed
*
* @throws \Exception
*
* @return mixed
*/
abstract public function import(): string;

@ -88,8 +88,8 @@ class H5pPackageTools
* @param string $packagePath the path to the H5P package file
* @param object $h5pJson the parsed H5P JSON object
* @param Course $course the course entity related to the package
* @param null|Session $session the session entity related to the package
* @param null|array $values the advance options in upload form
* @param Session|null $session the session entity related to the package
* @param array|null $values the advance options in upload form
*/
public static function storeH5pPackage(
string $packagePath,
@ -196,7 +196,7 @@ class H5pPackageTools
*
* @return array the core settings for H5P content
*/
public static function getCoreSettings(H5pImport $h5pImport, \H5PCore $h5pCore): array
public static function getCoreSettings(H5pImport $h5pImport, H5PCore $h5pCore): array
{
$originIsLearnpath = 'learnpath' === api_get_origin();
@ -270,7 +270,7 @@ class H5pPackageTools
*
* @param mixed $h5pNode
*/
public static function getContentSettings($h5pNode, \H5PCore $h5pCore): array
public static function getContentSettings($h5pNode, H5PCore $h5pCore): array
{
$filtered = $h5pCore->filterParameters($h5pNode);
$contentUserData = [

@ -67,9 +67,9 @@ class ZipPackageImporter extends H5pPackageImporter
/**
* Import an H5P package. No DB change.
*
* @return string The path to the extracted package directory.
*
* @throws Exception When the H5P package is invalid.
*
* @return string The path to the extracted package directory.
*/
public function import(): string
{
@ -160,7 +160,7 @@ class ZipPackageImporter extends H5pPackageImporter
while ($fs->exists($directoryPath)) {
$modifiedName = $safeName.'_'.$counter;
$directoryPath = $baseDirectory.$modifiedName;
++$counter;
$counter++;
}
}

@ -27,7 +27,7 @@ if ('set_finished' === $action && 0 !== $h5pId) {
}
if (is_numeric($_POST['score']) && is_numeric($_POST['maxScore'])) {
/** @var null|H5pImport $h5pImport */
/** @var H5pImport|null $h5pImport */
$h5pImport = $h5pImportRepo->find($h5pId);
$entityManager = Database::getManager();
@ -48,7 +48,7 @@ if ('set_finished' === $action && 0 !== $h5pId) {
$lpObject = Session::read('oLP');
$clpItemViewRepo = $em->getRepository('ChamiloCourseBundle:CLpItemView');
/** @var null|CLpItemView $lpItemView */
/** @var CLpItemView|null $lpItemView */
$lpItemView = $clpItemViewRepo->findOneBy(
[
'lpViewId' => $lpObject->lp_view_id,
@ -56,7 +56,7 @@ if ('set_finished' === $action && 0 !== $h5pId) {
]
);
/** @var null|CLpItem $lpItem */
/** @var CLpItem|null $lpItem */
$lpItem = $entityManager->find('ChamiloCourseBundle:CLpItem', $lpItemView->getLpItemId());
if ('h5p' !== $lpItem->getItemType()) {
return null;
@ -83,7 +83,7 @@ if ('set_finished' === $action && 0 !== $h5pId) {
H5PCore::ajaxError($plugin->get_lang('h5p_error_invalid_token'));
}
/** @var null|H5pImport $h5pImport */
/** @var H5pImport|null $h5pImport */
$h5pImport = $h5pImportRepo->find($h5pId);
} else {
H5PCore::ajaxError(get_lang('InvalidAction'));

@ -32,7 +32,7 @@ if (!$h5pImportId) {
api_not_allowed(true);
}
/** @var null|H5pImport $h5pImport */
/** @var H5pImport|null $h5pImport */
$h5pImport = $embedRepo->find($h5pImportId);
if (!$h5pImport) {

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once __DIR__.'/../../../main/inc/global.inc.php';
use ChamiloSession as Session;

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once __DIR__.'/../../main/inc/global.inc.php';
use ChamiloSession as Session;
@ -230,10 +229,10 @@ function emptyFile()
global $appSettings;
global $jwtManager;
if ($type !== 'empty') {
$result['status'] = 'error';
$result['error'] = 'Download empty with other action';
return $result;
}
@ -244,6 +243,7 @@ function emptyFile()
} catch (UnexpectedValueException $e) {
$result['status'] = 'error';
$result['error'] = '403 Access denied';
return $result;
}
}
@ -253,6 +253,7 @@ function emptyFile()
if (!$template) {
$result['status'] = 'error';
$result['error'] = 'File not found';
return $result;
}
@ -260,4 +261,4 @@ function emptyFile()
@header('Content-Disposition: attachment; filename='.'docx.docx');
readfile($template);
exit;
}
}

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once __DIR__.'/../../main/inc/global.inc.php';
use ChamiloSession as Session;

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once __DIR__.'/../../main/inc/global.inc.php';
$plugin = OnlyofficePlugin::create();
@ -50,7 +49,7 @@ $courseCode = $courseInfo['code'];
$docInfo = DocumentManager::get_document_data_by_id($docId, $courseCode, false, $sessionId);
$langInfo = LangManager::getLangUser();
$jwtManager = new OnlyofficeJwtManager($appSettings);
if (isset($_GET['forceEdit']) && (bool)$_GET['forceEdit'] === true) {
if (isset($_GET['forceEdit']) && (bool) $_GET['forceEdit'] === true) {
$docInfo['forceEdit'] = $_GET['forceEdit'];
}
$documentManager = new OnlyofficeDocumentManager($appSettings, $docInfo);

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once __DIR__.'/../../main/inc/global.inc.php';
const ErrorStatus_UpdateOnlyoffice = 1;

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once __DIR__.'/../../main/inc/global.inc.php';
/*

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once __DIR__.'/../../../main/inc/global.inc.php';
class LangManager

@ -40,7 +40,7 @@ class OnlyofficeAppRequests extends RequestService
'sessionId' => api_get_session_id(),
];
$hashUrl = $this->jwtManager->getHash($data);
return api_get_path(WEB_PLUGIN_PATH).'onlyoffice/callback.php?hash='.$hashUrl;
}
}

@ -143,7 +143,7 @@ class OnlyofficeConfigService extends DocEditorConfigService
{
$permsEdit = $this->getAccessRights() && !$this->isReadOnly();
$isFillable = $this->documentManager->isDocumentFillable($this->documentManager->getDocInfo('title'));
$permissions = new Permissions(null,
null,
null,

@ -23,7 +23,7 @@ class OnlyofficeDocumentManager extends DocumentManager
public function __construct($settingsManager, array $docInfo, $formats = null, $systemLangCode = 'en')
{
$formats = new OnlyofficeFormatsManager;
$formats = new OnlyofficeFormatsManager();
parent::__construct($settingsManager, $formats, $systemLangCode);
$this->docInfo = $docInfo;
}

@ -70,4 +70,4 @@ class OnlyofficeFormatsManager extends FormatsManager
}
throw new \Exception(CommonError::message(CommonError::EMPTY_FORMATS_ASSET));
}
}
}

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once __DIR__.'/../../../main/inc/global.inc.php';
class OnlyofficeSettingsFormBuilder

@ -152,7 +152,8 @@ class OnlyofficeTools
/**
* Return path to OnlyOffice viewer for a given file.
* @param int $documentId The ID from c_document.iid
*
* @param int $documentId The ID from c_document.iid
* @param bool $showHeaders Whether to show Chamilo headers on top of the OnlyOffice frame or not
*
* @return string A link to open the OnlyOffice viewer

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once __DIR__.'/../../../main/inc/global.inc.php';
class TemplateManager

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once __DIR__.'/../../main/inc/global.inc.php';
require_once __DIR__.'/lib/onlyofficeSettingsFormBuilder.php';
require_once __DIR__.'/lib/onlyofficeAppSettings.php';

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once __DIR__.'/../../main/inc/global.inc.php';
/*

Loading…
Cancel
Save