-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
107 changed files
with
275 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -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 */ | ||
|
@@ -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}', [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -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]; | ||
|
||
|
@@ -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); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -34,9 +35,6 @@ public function __construct(Builder $builder, Stopwatch $stopwatch) | |
parent::__construct(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function configure(): void | ||
{ | ||
$this | ||
|
@@ -87,9 +85,6 @@ protected function configure(): void | |
; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function initialize(InputInterface $input, OutputInterface $output): void | ||
{ | ||
if ($destination = $input->getArgument('buildDir')) { | ||
|
@@ -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); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -43,9 +44,6 @@ public function __construct(ContentManagerInterface $manager, Stopwatch $stopwat | |
parent::__construct(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function configure(): void | ||
{ | ||
$this | ||
|
@@ -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); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -77,9 +78,6 @@ public function __construct( | |
$this->expressionLanguage = $expressionLanguage; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getContents(string $type, $sortBy = null, $filterBy = null): array | ||
{ | ||
$contents = []; | ||
|
@@ -132,9 +130,6 @@ private function sortBy(array &$contents, $sortBy = null): void | |
} | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getContent(string $type, string $id): object | ||
{ | ||
if ($this->stopwatch) { | ||
|
@@ -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)); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -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); | ||
|
@@ -45,9 +43,6 @@ public function decode($data, $format, array $context = []): array | |
); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function supportsDecoding($format, array $context = []): bool | ||
{ | ||
return self::FORMAT === $format; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -35,9 +36,6 @@ public function __construct(Parsedown $parser) | |
$this->parser = $parser; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function decode($data, $format, array $context = []): array | ||
{ | ||
$content = trim($data); | ||
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
Oops, something went wrong.