Code Duplication    Length = 8-8 lines in 4 locations

src/AppBundle/Twig/AppExtension.php 4 locations

@@ 241-248 (lines=8) @@
238
     * @param string $tool The short name of the tool.
239
     * @return bool
240
     */
241
    public function tabEnabled($tool = "index")
242
    {
243
        $param = false;
244
        if ($this->container->hasParameter("enable.$tool")) {
245
            $param = boolval($this->container->getParameter("enable.$tool"));
246
        }
247
        return $param;
248
    }
249
250
    /**
251
     * Get a list of the short names of all tools.
@@ 395-402 (lines=8) @@
392
     * Whether XTools is running in single-project mode.
393
     * @return bool
394
     */
395
    public function isSingleWiki()
396
    {
397
        $param = true;
398
        if ($this->container->hasParameter('app.single_wiki')) {
399
            $param = boolval($this->container->getParameter('app.single_wiki'));
400
        }
401
        return $param;
402
    }
403
404
    /**
405
     * Get the database replication-lag threshold.
@@ 421-428 (lines=8) @@
418
     * Whether we should load stylesheets from external CDNs or not.
419
     * @return bool
420
     */
421
    public function loadStylesheetsFromCDN()
422
    {
423
        $param = false;
424
        if ($this->container->hasParameter('app.load_stylesheets_from_cdn')) {
425
            $param = boolval($this->container->getParameter('app.load_stylesheets_from_cdn'));
426
        }
427
        return $param;
428
    }
429
430
    /**
431
     * Whether XTools is running in WMF Labs mode.
@@ 434-441 (lines=8) @@
431
     * Whether XTools is running in WMF Labs mode.
432
     * @return bool
433
     */
434
    public function isWMFLabs()
435
    {
436
        $param = false;
437
        if ($this->container->hasParameter('app.is_labs')) {
438
            $param = boolval($this->container->getParameter('app.is_labs'));
439
        }
440
        return $param;
441
    }
442
443
    /**
444
     * What URL to use as the internal API, based on configuration.