Skip to content

Commit

Permalink
Fixing lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom32i authored and ogizanagi committed Apr 4, 2024
1 parent 539a5c6 commit 29c822d
Show file tree
Hide file tree
Showing 107 changed files with 275 additions and 84 deletions.
1 change: 1 addition & 0 deletions bin/lint.twig.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

require __DIR__ . '/../vendor/autoload.php';
Expand Down
1 change: 1 addition & 0 deletions config/processors.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Symfony\Component\DependencyInjection\Loader\Configurator;
Expand Down
1 change: 1 addition & 0 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Symfony\Component\DependencyInjection\Loader\Configurator;
Expand Down
1 change: 1 addition & 0 deletions config/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\DependencyInjection\tags;
Expand Down
1 change: 1 addition & 0 deletions src/Attribute/SuggestedDebugQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\Attribute;
Expand Down
1 change: 1 addition & 0 deletions src/Behaviour/ContentManagerAwareInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\Behaviour;
Expand Down
1 change: 1 addition & 0 deletions src/Behaviour/ContentManagerAwareTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\Behaviour;
Expand Down
1 change: 1 addition & 0 deletions src/Behaviour/HighlighterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\Behaviour;
Expand Down
1 change: 1 addition & 0 deletions src/Behaviour/HtmlCrawlerManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\Behaviour;
Expand Down
1 change: 1 addition & 0 deletions src/Behaviour/ProcessorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\Behaviour;
Expand Down
5 changes: 3 additions & 2 deletions src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle;
Expand Down Expand Up @@ -46,7 +47,7 @@ class Builder

/** Path to output the static site */
private string $buildDir;
private FileSystem $files;
private Filesystem $files;
private MimeTypesInterface $mimeTypes;

/** Files to copy after build */
Expand Down Expand Up @@ -372,7 +373,7 @@ private function buildUrl(string $url, bool $ignoreContentNotFoundErrors = false
ob_start();

try {
$response = $this->httpKernel->handle($request, HttpKernelInterface::MASTER_REQUEST, false);
$response = $this->httpKernel->handle($request, HttpKernelInterface::MAIN_REQUEST, false);
} catch (\Throwable $exception) {
if ($ignoreContentNotFoundErrors && $exception instanceof ContentNotFoundException) {
$this->logger->warning('Could not build url {url}: {exception}', [
Expand Down
1 change: 1 addition & 0 deletions src/Builder/PageList.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\Builder;
Expand Down
26 changes: 2 additions & 24 deletions src/Builder/Sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\Builder;
Expand Down Expand Up @@ -33,9 +34,8 @@ class Sitemap implements \Iterator, \Countable
* @param string $location The URL
* @param \DateTime $lastModified Date of last modification
* @param int $priority Location priority
* @param string $frequency
*/
public function add(string $location, \DateTime $lastModified = null, int $priority = null, string $frequency = null): void
public function add(string $location, ?\DateTime $lastModified = null, ?int $priority = null, ?string $frequency = null): void
{
$url = ['location' => $location];

Expand All @@ -58,55 +58,33 @@ public function add(string $location, \DateTime $lastModified = null, int $prior
$this->urls[$location] = $url;
}

/**
* {@inheritdoc}
*/
public function rewind(): void
{
$this->position = 0;
}

/**
* {@inheritdoc}
*
* @return mixed
*/
#[\ReturnTypeWillChange]
public function current()
{
return $this->urls[array_keys($this->urls)[$this->position]];
}

/**
* {@inheritdoc}
*
* @return mixed
*/
#[\ReturnTypeWillChange]
public function key()
{
return array_keys($this->urls)[$this->position];
}

/**
* {@inheritdoc}
*/
public function next(): void
{
++$this->position;
}

/**
* {@inheritdoc}
*/
public function valid(): bool
{
return isset(array_keys($this->urls)[$this->position]);
}

/**
* {@inheritdoc}
*/
public function count(): int
{
return \count($this->urls);
Expand Down
10 changes: 1 addition & 9 deletions src/Command/BuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\Command;
Expand Down Expand Up @@ -34,9 +35,6 @@ public function __construct(Builder $builder, Stopwatch $stopwatch)
parent::__construct();
}

/**
* {@inheritdoc}
*/
protected function configure(): void
{
$this
Expand Down Expand Up @@ -87,9 +85,6 @@ protected function configure(): void
;
}

/**
* {@inheritdoc}
*/
protected function initialize(InputInterface $input, OutputInterface $output): void
{
if ($destination = $input->getArgument('buildDir')) {
Expand All @@ -109,9 +104,6 @@ protected function initialize(InputInterface $input, OutputInterface $output): v
}
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
Expand Down
7 changes: 1 addition & 6 deletions src/Command/DebugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\Command;
Expand Down Expand Up @@ -43,9 +44,6 @@ public function __construct(ContentManagerInterface $manager, Stopwatch $stopwat
parent::__construct();
}

/**
* {@inheritdoc}
*/
protected function configure(): void
{
$this
Expand Down Expand Up @@ -147,9 +145,6 @@ protected function interact(InputInterface $input, OutputInterface $output): voi
}
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
Expand Down
1 change: 1 addition & 0 deletions src/Command/StopwatchHelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\Command;
Expand Down
1 change: 1 addition & 0 deletions src/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle;
Expand Down
10 changes: 1 addition & 9 deletions src/ContentManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle;
Expand Down Expand Up @@ -77,9 +78,6 @@ public function __construct(
$this->expressionLanguage = $expressionLanguage;
}

/**
* {@inheritdoc}
*/
public function getContents(string $type, $sortBy = null, $filterBy = null): array
{
$contents = [];
Expand Down Expand Up @@ -132,9 +130,6 @@ private function sortBy(array &$contents, $sortBy = null): void
}
}

/**
* {@inheritdoc}
*/
public function getContent(string $type, string $id): object
{
if ($this->stopwatch) {
Expand All @@ -156,9 +151,6 @@ public function getContent(string $type, string $id): object
throw new ContentNotFoundException($type, $id);
}

/**
* {@inheritdoc}
*/
public function reverseContent(Context $context): ?Content
{
$key = md5(serialize($context));
Expand Down
1 change: 1 addition & 0 deletions src/ContentManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle;
Expand Down
7 changes: 1 addition & 6 deletions src/Decoder/HtmlDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\Decoder;
Expand All @@ -23,9 +24,6 @@ class HtmlDecoder implements DecoderInterface
*/
public const FORMAT = 'html';

/**
* {@inheritdoc}
*/
public function decode($data, $format, array $context = []): array
{
$crawler = new Crawler($data);
Expand All @@ -45,9 +43,6 @@ public function decode($data, $format, array $context = []): array
);
}

/**
* {@inheritdoc}
*/
public function supportsDecoding($format, array $context = []): bool
{
return self::FORMAT === $format;
Expand Down
7 changes: 1 addition & 6 deletions src/Decoder/MarkdownDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\Decoder;
Expand Down Expand Up @@ -35,9 +36,6 @@ public function __construct(Parsedown $parser)
$this->parser = $parser;
}

/**
* {@inheritdoc}
*/
public function decode($data, $format, array $context = []): array
{
$content = trim($data);
Expand All @@ -56,9 +54,6 @@ public function decode($data, $format, array $context = []): array
return ['content' => $this->markdownToHtml($content)];
}

/**
* {@inheritdoc}
*/
public function supportsDecoding($format, array $context = []): bool
{
return self::FORMAT === $format;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\DependencyInjection\Compiler;
Expand Down
1 change: 1 addition & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\DependencyInjection;
Expand Down
1 change: 1 addition & 0 deletions src/DependencyInjection/StenopeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* This file is part of the "StenopePHP/Stenope" bundle.
*
* @author Thomas Jarrand <[email protected]>
* @author Maxime Steinhausser <[email protected]>
*/

namespace Stenope\Bundle\DependencyInjection;
Expand Down
Loading

0 comments on commit 29c822d

Please sign in to comment.