-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
14 changed files
with
82 additions
and
77 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 |
---|---|---|
@@ -1,26 +1,20 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
# Top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
# JS / PHP | ||
[*.{js,php,phpt}] | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
indent_style = tab | ||
indent_size = 4 | ||
indent_size = tab | ||
tab_width = 4 | ||
|
||
# NEON | ||
[*.neon] | ||
charset = utf-8 | ||
indent_style = tab | ||
[*.md] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
# Composer, NPM, Travis, BitbucketPipelines | ||
[{composer.json,package.json,.travis.yml,bitbucket-pipelines.yml}] | ||
[{composer.json,package.json,.travis.yml}] | ||
indent_style = space | ||
indent_size = 2 |
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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
# IDE | ||
/.idea | ||
|
||
# Folders | ||
# Composer | ||
/vendor | ||
|
||
# Files | ||
/composer.lock | ||
|
||
# Tests | ||
/temp/ | ||
/tests/*.log | ||
/tests/tmp | ||
/tests/coverage.html | ||
/coverage.xml |
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
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
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
includes: | ||
- temp/phpstan/vendor/phpstan/phpstan-strict-rules/rules.neon | ||
- temp/phpstan/vendor/phpstan/phpstan-nette/extension.neon | ||
- temp/phpstan/vendor/phpstan/phpstan-nette/rules.neon | ||
|
||
parameters: |
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
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
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 |
---|---|---|
@@ -1,32 +1,29 @@ | ||
<?php | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Contributte\Parsedown\DI; | ||
|
||
use Contributte\Parsedown\ParsedownExtraAdapter; | ||
use Contributte\Parsedown\ParsedownFilter; | ||
use Nette\Bridges\ApplicationLatte\ILatteFactory; | ||
use Nette\DI\CompilerExtension; | ||
use Nette\DI\Statement; | ||
use Nette\InvalidStateException; | ||
|
||
/** | ||
* ParsedownExtra Extension | ||
* | ||
* @author Milan Felix Sulc <[email protected]> | ||
*/ | ||
class ParsedownExtraExtension extends CompilerExtension | ||
{ | ||
|
||
/** @var array */ | ||
/** @var mixed[] */ | ||
private $defaults = [ | ||
'helper' => 'parsedown', | ||
]; | ||
|
||
/** | ||
* Register services | ||
* | ||
* @return void | ||
*/ | ||
public function loadConfiguration() | ||
public function loadConfiguration(): void | ||
{ | ||
$this->validateConfig($this->defaults); | ||
$builder = $this->getContainerBuilder(); | ||
|
@@ -37,17 +34,15 @@ public function loadConfiguration() | |
|
||
/** | ||
* Decorate services | ||
* | ||
* @return void | ||
*/ | ||
public function beforeCompile() | ||
public function beforeCompile(): void | ||
{ | ||
$config = $this->validateConfig($this->defaults); | ||
$builder = $this->getContainerBuilder(); | ||
|
||
$templateFactory = $builder->getByType('Nette\Bridges\ApplicationLatte\ILatteFactory'); | ||
if (!$templateFactory) { | ||
throw new InvalidStateException('Service implemented Nette\Bridges\ApplicationLatte\ILatteFactory not found.'); | ||
$templateFactory = $builder->getByType(ILatteFactory::class); | ||
if ($templateFactory === null) { | ||
throw new InvalidStateException(sprintf('Service which implements %s not found.', ILatteFactory::class)); | ||
} | ||
|
||
$builder->getDefinition($templateFactory) | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?php | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Contributte\Parsedown; | ||
|
||
|
@@ -8,7 +8,6 @@ | |
/** | ||
* ParsedownExtra Adapter | ||
* | ||
* @author Milan Felix Sulc <[email protected]> | ||
* @method void onProcess(string $text, ParsedownExtraAdapter $adapter) | ||
*/ | ||
class ParsedownExtraAdapter | ||
|
@@ -19,17 +18,15 @@ class ParsedownExtraAdapter | |
/** @var ParsedownExtra */ | ||
private $parsedown; | ||
|
||
/** @var array */ | ||
/** @var callable[] */ | ||
public $onProcess = []; | ||
|
||
/** | ||
* Creates adapter | ||
* | ||
* @param ParsedownExtra|NULL $parsedown | ||
*/ | ||
public function __construct(ParsedownExtra $parsedown = NULL) | ||
public function __construct(?ParsedownExtra $parsedown = null) | ||
{ | ||
$this->parsedown = $parsedown ? $parsedown : new ParsedownExtra(); | ||
$this->parsedown = $parsedown ?: new ParsedownExtra(); | ||
} | ||
|
||
/** | ||
|
@@ -45,9 +42,8 @@ public function process($text) | |
|
||
/** | ||
* @param mixed $line | ||
* @return string | ||
*/ | ||
public function processLine($line) | ||
public function processLine($line): string | ||
{ | ||
$this->onProcess($line, $this); | ||
|
||
|
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?php | ||
<?php declare(strict_types = 1); | ||
|
||
use Ninjify\Nunjuck\Environment; | ||
|
||
|
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
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
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