diff --git a/src/CoreBundle/Component/HTMLPurifier/Filter/AllowIframes.php b/src/CoreBundle/Component/HTMLPurifier/Filter/AllowIframes.php index d2e36507e1..59ba8bc739 100644 --- a/src/CoreBundle/Component/HTMLPurifier/Filter/AllowIframes.php +++ b/src/CoreBundle/Component/HTMLPurifier/Filter/AllowIframes.php @@ -1,5 +1,7 @@ '; - } else { - return ''; } + + return ''; } } diff --git a/src/CoreBundle/Component/Resource/Settings.php b/src/CoreBundle/Component/Resource/Settings.php index f9aea6ddd2..534831f8df 100644 --- a/src/CoreBundle/Component/Resource/Settings.php +++ b/src/CoreBundle/Component/Resource/Settings.php @@ -1,23 +1,21 @@ $action; } - throw new \InvalidArgumentException("No template found for action: $action"); + throw new InvalidArgumentException("No template found for action: $action"); } public function setIndex(string $index): self diff --git a/src/CoreBundle/Component/Utils/AssetDirectoryNamer.php b/src/CoreBundle/Component/Utils/AssetDirectoryNamer.php index 99bfa0071b..3d244e212a 100644 --- a/src/CoreBundle/Component/Utils/AssetDirectoryNamer.php +++ b/src/CoreBundle/Component/Utils/AssetDirectoryNamer.php @@ -1,28 +1,28 @@ propertyPath = $options['property']; - $options = \array_merge(['chars_per_dir' => $this->charsPerDir, 'dirs' => $this->dirs], $options); + $options = array_merge(['chars_per_dir' => $this->charsPerDir, 'dirs' => $this->dirs], $options); $this->charsPerDir = $options['chars_per_dir']; $this->dirs = $options['dirs']; @@ -57,12 +57,12 @@ class AssetDirectoryNamer implements DirectoryNamerInterface, ConfigurableInterf if (Asset::EXTRA_FIELD === $category) { for ($i = 0, $start = 0; $i < $this->dirs; $i++, $start += $this->charsPerDir) { - $parts[] = \substr($fileName, $start, $this->charsPerDir); + $parts[] = substr($fileName, $start, $this->charsPerDir); } } else { $parts[] = $fileName; } - return \implode('/', $parts); + return implode('/', $parts); } } diff --git a/src/CoreBundle/Component/Utils/ChamiloApi.php b/src/CoreBundle/Component/Utils/ChamiloApi.php index 773c5ccf44..d7b6c3a109 100644 --- a/src/CoreBundle/Component/Utils/ChamiloApi.php +++ b/src/CoreBundle/Component/Utils/ChamiloApi.php @@ -1,10 +1,19 @@ - '; if (!empty($courseInfo['extLink']['url'])) { - $headerLogo .= \Display::url( + $headerLogo .= Display::url( $courseInfo['extLink']['name'], $courseInfo['extLink']['url'], ['class' => 'extLink'] @@ -188,12 +183,12 @@ class ChamiloApi } } - return \Display::tag('h2', $headerLogo, ['class' => 'text-left']); + return Display::tag('h2', $headerLogo, ['class' => 'text-left']); } - $image = \Display::img($logoPath, $institution, $imageAttributes); + $image = Display::img($logoPath, $institution, $imageAttributes); - return \Display::url($image, api_get_path(WEB_PATH).'index.php'); + return Display::url($image, api_get_path(WEB_PATH).'index.php'); } /** @@ -208,7 +203,7 @@ class ChamiloApi { foreach ($tags as $tag) { $string2 = preg_replace('#]*>#i', ' ', $string); - if ($string2 != $string) { + if ($string2 !== $string) { $string = preg_replace('/<\b'.$tag.'\b[^>]*>/i', ' ', $string2); } } @@ -227,14 +222,14 @@ class ChamiloApi */ public static function addOrSubTimeToDateTime($time, $datetime = 'now', $operation = true) { - $date = new \DateTime($datetime); + $date = new DateTime($datetime); $hours = $minutes = $seconds = 0; sscanf($time, '%d:%d:%d', $hours, $minutes, $seconds); $timeSeconds = isset($seconds) ? $hours * 3600 + $minutes * 60 + $seconds : $hours * 60 + $minutes; if ($operation) { - $date->add(new \DateInterval('PT'.$timeSeconds.'S')); + $date->add(new DateInterval('PT'.$timeSeconds.'S')); } else { - $date->sub(new \DateInterval('PT'.$timeSeconds.'S')); + $date->sub(new DateInterval('PT'.$timeSeconds.'S')); } return $date->format('Y-m-d H:i:s'); @@ -250,10 +245,10 @@ class ChamiloApi public static function getCourseIdByDirectory($directory = null) { if (!empty($directory)) { - $directory = \Database::escape_string($directory); - $row = \Database::select( + $directory = Database::escape_string($directory); + $row = Database::select( 'id', - \Database::get_main_table(TABLE_MAIN_COURSE), + Database::get_main_table(TABLE_MAIN_COURSE), ['where' => ['directory = ?' => [$directory]]], 'first' ); @@ -386,16 +381,16 @@ class ChamiloApi * @param string|null $utcTime Optional. The time to ve converted. * See api_get_local_time. * - * @throws \Exception + * @throws Exception * - * @return \DateTime + * @return DateTime */ public static function getServerMidnightTime($utcTime = null) { $localTime = api_get_local_time($utcTime); $localTimeZone = api_get_timezone(); - $localMidnight = new \DateTime($localTime, new \DateTimeZone($localTimeZone)); + $localMidnight = new DateTime($localTime, new DateTimeZone($localTimeZone)); $localMidnight->modify('midnight'); return $localMidnight; diff --git a/src/CoreBundle/Component/Utils/Glide.php b/src/CoreBundle/Component/Utils/Glide.php index 1a49d7c407..ddfc7de750 100644 --- a/src/CoreBundle/Component/Utils/Glide.php +++ b/src/CoreBundle/Component/Utils/Glide.php @@ -1,5 +1,7 @@