@@ -711,7 +711,7 @@ |
||
711 | 711 | * @see get_members_of_access_collection() |
712 | 712 | * |
713 | 713 | * @param int $collection_id The collection ID |
714 | - * @return \ElggAccessCollection|false |
|
714 | + * @return string |
|
715 | 715 | */ |
716 | 716 | public function get($collection_id) { |
717 | 717 |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | /** |
79 | 79 | * Get a map of all loaded translations |
80 | 80 | * |
81 | - * @return array |
|
81 | + * @return string |
|
82 | 82 | */ |
83 | 83 | public function getLoadedTranslations() { |
84 | 84 | return $this->translations; |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | * |
479 | 479 | * @param string $language Language |
480 | 480 | * |
481 | - * @return int |
|
481 | + * @return double |
|
482 | 482 | */ |
483 | 483 | public function getLanguageCompleteness($language) { |
484 | 484 | |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | /** |
580 | 580 | * Returns an array of language codes. |
581 | 581 | * |
582 | - * @return array |
|
582 | + * @return string[] |
|
583 | 583 | */ |
584 | 584 | public static function getAllLanguageCodes() { |
585 | 585 | return [ |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function __construct(Config $config) { |
67 | 67 | $this->config = $config; |
68 | - $this->defaultPath = dirname(dirname(dirname(dirname(__DIR__)))) . "/languages/"; |
|
68 | + $this->defaultPath = dirname(dirname(dirname(dirname(__DIR__))))."/languages/"; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | public function translate($message_key, array $args = [], $language = "") { |
99 | 99 | if (!is_string($message_key) || strlen($message_key) < 1) { |
100 | 100 | _elgg_services()->logger->warn( |
101 | - '$message_key needs to be a string in ' . __METHOD__ . '(), ' . gettype($message_key) . ' provided' |
|
101 | + '$message_key needs to be a string in '.__METHOD__.'(), '.gettype($message_key).' provided' |
|
102 | 102 | ); |
103 | 103 | return ''; |
104 | 104 | } |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | * @return bool Success |
328 | 328 | */ |
329 | 329 | public function registerPluginTranslations($path) { |
330 | - $languages_path = rtrim($path, "\\/") . "/languages"; |
|
330 | + $languages_path = rtrim($path, "\\/")."/languages"; |
|
331 | 331 | |
332 | 332 | // don't need to have translations |
333 | 333 | if (!is_dir($languages_path)) { |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | } |
386 | 386 | |
387 | 387 | if (in_array($language_file, $load_language_files) || $load_all) { |
388 | - $result = (include $path . $language_file); |
|
388 | + $result = (include $path.$language_file); |
|
389 | 389 | if ($result === false) { |
390 | 390 | $return = false; |
391 | 391 | continue; |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | |
467 | 467 | $completeness = $this->getLanguageCompleteness($k); |
468 | 468 | if ($completeness < 100) { |
469 | - $installed[$k] .= " (" . $completeness . "% " . $this->translate('complete') . ")"; |
|
469 | + $installed[$k] .= " (".$completeness."% ".$this->translate('complete').")"; |
|
470 | 470 | } |
471 | 471 | } |
472 | 472 |
@@ -180,7 +180,7 @@ |
||
180 | 180 | return $v->loaded == true && $v->location == $location; |
181 | 181 | }); |
182 | 182 | if ($items) { |
183 | - array_walk($items, function(&$v, $k){ |
|
183 | + array_walk($items, function(&$v, $k) { |
|
184 | 184 | $v = $v->url; |
185 | 185 | }); |
186 | 186 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * |
152 | 152 | * @param string $action The action being performed |
153 | 153 | * |
154 | - * @return mixed True if valid or redirects. |
|
154 | + * @return boolean True if valid or redirects. |
|
155 | 155 | * @access private |
156 | 156 | */ |
157 | 157 | function action_gatekeeper($action) { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | /** |
183 | 183 | * Regenerate a new site key (32 bytes: "z" to indicate format + 186-bit key in Base64 URL). |
184 | 184 | * |
185 | - * @return mixed The site secret hash |
|
185 | + * @return string The site secret hash |
|
186 | 186 | * @access private |
187 | 187 | */ |
188 | 188 | function init_site_secret() { |
@@ -108,7 +108,7 @@ |
||
108 | 108 | * @return SiteSecret |
109 | 109 | */ |
110 | 110 | public static function regenerate(ElggCrypto $crypto, ConfigTable $table) { |
111 | - $key = 'z' . $crypto->getRandomString(31); |
|
111 | + $key = 'z'.$crypto->getRandomString(31); |
|
112 | 112 | |
113 | 113 | $table->set(self::CONFIG_KEY, $key); |
114 | 114 |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | /** |
454 | 454 | * Elgg's front controller. Handles basically all incoming URL requests. |
455 | 455 | * |
456 | - * @return bool True if Elgg will handle the request, false if the server should (PHP-CLI server) |
|
456 | + * @return boolean|null True if Elgg will handle the request, false if the server should (PHP-CLI server) |
|
457 | 457 | */ |
458 | 458 | public static function index() { |
459 | 459 | $req = Request::createFromGlobals(); |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | /** |
471 | 471 | * Routes the request, booting core if not yet booted |
472 | 472 | * |
473 | - * @return bool False if Elgg wants the PHP CLI server to handle the request |
|
473 | + * @return boolean|null False if Elgg wants the PHP CLI server to handle the request |
|
474 | 474 | */ |
475 | 475 | public function run() { |
476 | 476 | $config = $this->services->config; |
@@ -781,7 +781,7 @@ discard block |
||
781 | 781 | * @param int $linenum The line number the error was raised at |
782 | 782 | * @param array $vars An array that points to the active symbol table where error occurred |
783 | 783 | * |
784 | - * @return true |
|
784 | + * @return boolean |
|
785 | 785 | * @throws \Exception |
786 | 786 | * @access private |
787 | 787 | */ |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | if ($config->elgg_config_locks) { |
98 | - $lock = function ($name) use ($config) { |
|
98 | + $lock = function($name) use ($config) { |
|
99 | 99 | $config->lock($name); |
100 | 100 | }; |
101 | 101 | } else { |
102 | 102 | // the installer needs to build an application with defaults then update |
103 | 103 | // them after they're validated, so we don't want to lock them. |
104 | - $lock = function () { |
|
104 | + $lock = function() { |
|
105 | 105 | }; |
106 | 106 | } |
107 | 107 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | } |
114 | 114 | |
115 | 115 | if ($config->dataroot) { |
116 | - $config->dataroot = rtrim($config->dataroot, '\\/') . DIRECTORY_SEPARATOR; |
|
116 | + $config->dataroot = rtrim($config->dataroot, '\\/').DIRECTORY_SEPARATOR; |
|
117 | 117 | } else { |
118 | 118 | if (!$config->installer_running) { |
119 | 119 | throw new ConfigurationException('Config value "dataroot" is required.'); |
@@ -122,14 +122,14 @@ discard block |
||
122 | 122 | $lock('dataroot'); |
123 | 123 | |
124 | 124 | if ($config->cacheroot) { |
125 | - $config->cacheroot = rtrim($config->cacheroot, '\\/') . DIRECTORY_SEPARATOR; |
|
125 | + $config->cacheroot = rtrim($config->cacheroot, '\\/').DIRECTORY_SEPARATOR; |
|
126 | 126 | } else { |
127 | 127 | $config->cacheroot = $config->dataroot; |
128 | 128 | } |
129 | 129 | $lock('cacheroot'); |
130 | 130 | |
131 | 131 | if ($config->wwwroot) { |
132 | - $config->wwwroot = rtrim($config->wwwroot, '/') . '/'; |
|
132 | + $config->wwwroot = rtrim($config->wwwroot, '/').'/'; |
|
133 | 133 | } else { |
134 | 134 | $config->wwwroot = $this->services->request->sniffElggUrl(); |
135 | 135 | } |
@@ -148,8 +148,8 @@ discard block |
||
148 | 148 | $locked_props = [ |
149 | 149 | 'site_guid' => 1, |
150 | 150 | 'path' => Paths::project(), |
151 | - 'plugins_path' => Paths::project() . "mod/", |
|
152 | - 'pluginspath' => Paths::project() . "mod/", |
|
151 | + 'plugins_path' => Paths::project()."mod/", |
|
152 | + 'pluginspath' => Paths::project()."mod/", |
|
153 | 153 | 'url' => $config->wwwroot, |
154 | 154 | ]; |
155 | 155 | foreach ($locked_props as $name => $value) { |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | } |
198 | 198 | |
199 | 199 | $setups = []; |
200 | - $path = Paths::elgg() . 'engine/lib'; |
|
200 | + $path = Paths::elgg().'engine/lib'; |
|
201 | 201 | |
202 | 202 | // include library files, capturing setup functions |
203 | 203 | foreach (self::getEngineLibs() as $file) { |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | $config = $this->services->config; |
259 | 259 | |
260 | 260 | if ($this->isTestingApplication()) { |
261 | - throw new \RuntimeException('Unit tests should not call ' . __METHOD__); |
|
261 | + throw new \RuntimeException('Unit tests should not call '.__METHOD__); |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | if ($config->boot_complete) { |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | // as a custom plugin that is always loaded last and can't be disabled... |
298 | 298 | if (!$config->system_cache_loaded) { |
299 | 299 | // configure view locations for the custom plugin (not Elgg core) |
300 | - $viewsFile = Paths::project() . 'views.php'; |
|
300 | + $viewsFile = Paths::project().'views.php'; |
|
301 | 301 | if (is_file($viewsFile)) { |
302 | 302 | $viewsSpec = Includer::includeFile($viewsFile); |
303 | 303 | if (is_array($viewsSpec)) { |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | } |
315 | 315 | |
316 | 316 | // This is root directory start.php |
317 | - $root_start = Paths::project() . "start.php"; |
|
317 | + $root_start = Paths::project()."start.php"; |
|
318 | 318 | if (is_file($root_start)) { |
319 | 319 | require $root_start; |
320 | 320 | } |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | if (isset(self::$public_services[$name])) { |
365 | 365 | return $this->services->{$name}; |
366 | 366 | } |
367 | - trigger_error("Undefined property: " . __CLASS__ . ":\${$name}"); |
|
367 | + trigger_error("Undefined property: ".__CLASS__.":\${$name}"); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | /** |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | if ($spec['request'] instanceof Request) { |
415 | 415 | $spec['service_provider']->setValue('request', $spec['request']); |
416 | 416 | } else { |
417 | - throw new \InvalidArgumentException("Given request is not a " . Request::class); |
|
417 | + throw new \InvalidArgumentException("Given request is not a ".Request::class); |
|
418 | 418 | } |
419 | 419 | } |
420 | 420 | |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | if ($spec['handle_shutdown']) { |
429 | 429 | // we need to register for shutdown before Symfony registers the |
430 | 430 | // session_write_close() function. https://github.com/Elgg/Elgg/issues/9243 |
431 | - register_shutdown_function(function () { |
|
431 | + register_shutdown_function(function() { |
|
432 | 432 | // There are cases where we may exit before this function is defined |
433 | 433 | if (function_exists('_elgg_shutdown_hook')) { |
434 | 434 | _elgg_shutdown_hook(); |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | } |
479 | 479 | |
480 | 480 | // overwrite value from settings |
481 | - $www_root = rtrim($request->getSchemeAndHttpHost() . $request->getBaseUrl(), '/') . '/'; |
|
481 | + $www_root = rtrim($request->getSchemeAndHttpHost().$request->getBaseUrl(), '/').'/'; |
|
482 | 482 | $config->wwwroot = $www_root; |
483 | 483 | $config->wwwroot_cli_server = $www_root; |
484 | 484 | } |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | ini_set('display_errors', 1); |
557 | 557 | $is_cli = (php_sapi_name() === 'cli'); |
558 | 558 | |
559 | - $forward = function ($url) use ($is_cli) { |
|
559 | + $forward = function($url) use ($is_cli) { |
|
560 | 560 | if ($is_cli) { |
561 | 561 | echo "Open $url in your browser to continue."; |
562 | 562 | exit; |
@@ -576,14 +576,14 @@ discard block |
||
576 | 576 | } |
577 | 577 | |
578 | 578 | $site_url = _elgg_config()->url; |
579 | - $site_host = parse_url($site_url, PHP_URL_HOST) . '/'; |
|
579 | + $site_host = parse_url($site_url, PHP_URL_HOST).'/'; |
|
580 | 580 | |
581 | 581 | // turn any full in-site URLs into absolute paths |
582 | 582 | $forward_url = get_input('forward', '/admin', false); |
583 | 583 | $forward_url = str_replace([$site_url, $site_host], '/', $forward_url); |
584 | 584 | |
585 | 585 | if (strpos($forward_url, '/') !== 0) { |
586 | - $forward_url = '/' . $forward_url; |
|
586 | + $forward_url = '/'.$forward_url; |
|
587 | 587 | } |
588 | 588 | |
589 | 589 | if ($is_cli || (get_input('upgrade') == 'upgrade')) { |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | } |
606 | 606 | } else { |
607 | 607 | $rewriteTester = new \ElggRewriteTester(); |
608 | - $url = elgg_get_site_url() . "__testing_rewrite?__testing_rewrite=1"; |
|
608 | + $url = elgg_get_site_url()."__testing_rewrite?__testing_rewrite=1"; |
|
609 | 609 | if (!$rewriteTester->runRewriteTest($url)) { |
610 | 610 | // see if there is a problem accessing the site at all |
611 | 611 | // due to ip restrictions for example |
@@ -792,9 +792,9 @@ discard block |
||
792 | 792 | * @access private |
793 | 793 | */ |
794 | 794 | public function handleErrors($errno, $errmsg, $filename, $linenum, $vars) { |
795 | - $error = date("Y-m-d H:i:s (T)") . ": \"$errmsg\" in file $filename (line $linenum)"; |
|
795 | + $error = date("Y-m-d H:i:s (T)").": \"$errmsg\" in file $filename (line $linenum)"; |
|
796 | 796 | |
797 | - $log = function ($message, $level) { |
|
797 | + $log = function($message, $level) { |
|
798 | 798 | if (self::$core_loaded) { |
799 | 799 | return elgg_log($message, $level); |
800 | 800 | } |
@@ -850,7 +850,7 @@ discard block |
||
850 | 850 | * @deprecated |
851 | 851 | */ |
852 | 852 | public function loadSettings() { |
853 | - trigger_error(__METHOD__ . ' is no longer needed and will be removed.'); |
|
853 | + trigger_error(__METHOD__.' is no longer needed and will be removed.'); |
|
854 | 854 | } |
855 | 855 | |
856 | 856 | /** |
@@ -74,7 +74,6 @@ |
||
74 | 74 | /** |
75 | 75 | * Handle a request for a cached view |
76 | 76 | * |
77 | - * @param array $path URL path |
|
78 | 77 | * @return Response (unprepared) |
79 | 78 | */ |
80 | 79 | public function handleRequest(Request $request) { |
@@ -6,7 +6,6 @@ |
||
6 | 6 | use Elgg\Http\Request; |
7 | 7 | use Symfony\Component\HttpFoundation\BinaryFileResponse; |
8 | 8 | use Symfony\Component\HttpFoundation\Response; |
9 | -use Symfony\Component\HttpFoundation\StreamedResponse; |
|
10 | 9 | |
11 | 10 | /** |
12 | 11 | * Simplecache handler |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | return $this->send403(); |
117 | 117 | } |
118 | 118 | |
119 | - $etag = '"' . md5($content) . '"'; |
|
119 | + $etag = '"'.md5($content).'"'; |
|
120 | 120 | $this->setRevalidateHeaders($etag, $response); |
121 | 121 | if ($this->is304($etag)) { |
122 | 122 | return Response::create()->setNotModified(); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | // trust the client but check for an existing cache file |
134 | - $filename = $config->cacheroot . "views_simplecache/$ts/$viewtype/$view"; |
|
134 | + $filename = $config->cacheroot."views_simplecache/$ts/$viewtype/$view"; |
|
135 | 135 | if (file_exists($filename)) { |
136 | 136 | $this->sendCacheHeaders($etag, $response); |
137 | 137 | return BinaryFileResponse::create($filename, 200, $response->headers->all()); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | |
151 | 151 | $lastcache = (int) $config->lastcache; |
152 | 152 | |
153 | - $filename = $config->cacheroot . "views_simplecache/$lastcache/$viewtype/$view"; |
|
153 | + $filename = $config->cacheroot."views_simplecache/$lastcache/$viewtype/$view"; |
|
154 | 154 | |
155 | 155 | if ($lastcache == $ts) { |
156 | 156 | $this->sendCacheHeaders($etag, $response); |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | protected function isCacheableView($view) { |
215 | 215 | if (preg_match('~^languages/(.*)\.js$~', $view, $m)) { |
216 | - return in_array($m[1], _elgg_services()->translator->getAllLanguageCodes()); |
|
216 | + return in_array($m[1], _elgg_services()->translator->getAllLanguageCodes()); |
|
217 | 217 | } |
218 | 218 | return _elgg_services()->views->isCacheableView($view); |
219 | 219 | } |
@@ -129,7 +129,7 @@ |
||
129 | 129 | * |
130 | 130 | * @param string $name The name of the config value |
131 | 131 | * |
132 | - * @return mixed|null |
|
132 | + * @return string|boolean |
|
133 | 133 | */ |
134 | 134 | function get($name) { |
135 | 135 | $sql = " |
@@ -2,7 +2,6 @@ |
||
2 | 2 | namespace Elgg\Database; |
3 | 3 | |
4 | 4 | use Elgg\Cache\Pool; |
5 | -use Elgg\Config; |
|
6 | 5 | use Elgg\Profilable; |
7 | 6 | use Exception; |
8 | 7 | use Elgg\Cache\PluginSettingsCache; |