Skip to content

Commit

Permalink
refactor: better code
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudLigny committed Dec 6, 2023
1 parent bf0450b commit c0ce4b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/Renderer/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

namespace Cecil\Renderer;

use Cecil\Config;
use Cecil\Exception\RuntimeException;

/**
Expand All @@ -27,7 +26,7 @@ class Language
/** @var string Current language. */
protected $language;

public function __construct(Config $config, string $language = null)
public function __construct(\Cecil\Config $config, string $language = null)
{
$this->config = $config;
$this->language = $language;
Expand Down
5 changes: 2 additions & 3 deletions src/Renderer/Layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use Cecil\Collection\Page\Page as CollectionPage;
use Cecil\Collection\Page\Type as PageType;
use Cecil\Config;
use Cecil\Exception\RuntimeException;
use Cecil\Util;

Expand All @@ -31,7 +30,7 @@ class Layout
*
* @throws RuntimeException
*/
public static function finder(CollectionPage $page, string $format, Config $config): array
public static function finder(CollectionPage $page, string $format, \Cecil\Config $config): array
{
$layout = 'unknown';

Expand Down Expand Up @@ -77,7 +76,7 @@ public static function finder(CollectionPage $page, string $format, Config $conf
*
* @see finder()
*/
protected static function fallback(CollectionPage $page, string $format, Config $config): array
protected static function fallback(CollectionPage $page, string $format, \Cecil\Config $config): array

Check warning on line 79 in src/Renderer/Layout.php

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Renderer/Layout.php#L79

The method fallback() has 100 lines of code. Current threshold is set to 100. Avoid really long methods.

Check warning on line 79 in src/Renderer/Layout.php

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Renderer/Layout.php#L79

The method fallback() has a Cyclomatic Complexity of 17. The configured cyclomatic complexity threshold is 10.
{
$ext = self::EXT;

Expand Down
3 changes: 1 addition & 2 deletions src/Renderer/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
namespace Cecil\Renderer;

use Cecil\Collection\Page\Page as PageItem;
use Cecil\Config;

/**
* Class Renderer\Page.
Expand All @@ -24,7 +23,7 @@ class Page
/** @var \Cecil\Config */
protected $config;

public function __construct(Config $config)
public function __construct(\Cecil\Config $config)
{
$this->config = $config;
}
Expand Down

0 comments on commit c0ce4b7

Please sign in to comment.