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
22 changed files
with
215 additions
and
259 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,16 @@ | ||
# 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 | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
# NEON | ||
[*.neon] | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
indent_style = tab | ||
indent_size = 4 | ||
indent_size = tab | ||
tab_width = 4 | ||
|
||
# Composer, NPM, Travis, BitbucketPipelines | ||
[{composer.json,package.json,.travis.yml,bitbucket-pipelines.yml}] | ||
[{*.json,*.yml,*.md}] | ||
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Not archived | ||
.docs export-ignore | ||
tests export-ignore | ||
.editorconfig export-ignore | ||
.gitattributes export-ignore | ||
.gitignore export-ignore | ||
.travis.yml export-ignore | ||
phpstan.neon export-ignore | ||
README.md export-ignore | ||
ruleset.xml export-ignore |
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 |
---|---|---|
|
@@ -6,6 +6,5 @@ | |
/composer.lock | ||
|
||
# Tests | ||
/tests/*.log | ||
/tests/tmp | ||
/tests/coverage.html | ||
/temp | ||
/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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
includes: | ||
- temp/phpstan/vendor/phpstan/phpstan-deprecation-rules/rules.neon | ||
- temp/phpstan/vendor/phpstan/phpstan-nette/extension.neon | ||
- temp/phpstan/vendor/phpstan/phpstan-nette/rules.neon | ||
- temp/phpstan/vendor/phpstan/phpstan-strict-rules/rules.neon |
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,13 +1,22 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="Contributte"> | ||
<!-- Extending rulesets --> | ||
<rule ref="vendor/ninjify/coding-standard/ruleset.xml"/> | ||
|
||
<!-- Contributte --> | ||
<rule ref="Squiz.Classes.ClassFileName"> | ||
<exclude name="Squiz.Classes.ClassFileName.NoMatch"/> | ||
</rule> | ||
|
||
<!-- Exclude folders --> | ||
<exclude-pattern>/tests/tmp</exclude-pattern> | ||
<!-- Contributte Coding Standard --> | ||
<rule ref="./vendor/ninjify/coding-standard/contributte.xml"> | ||
<exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPostDecrementOperator"/> | ||
</rule> | ||
|
||
<!-- Specific rules --> | ||
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName"> | ||
<properties> | ||
<property name="rootNamespaces" type="array" value=" | ||
src=>Contributte\Database, | ||
tests/cases/unit=>Tests\Cases\Unit, | ||
tests/helpers=>Tests\Helpers | ||
"/> | ||
<property name="extensions" type="array" value="php, phpt"/> | ||
</properties> | ||
</rule> | ||
|
||
<!-- Exclude folders --> | ||
<exclude-pattern>/tests/tmp</exclude-pattern> | ||
</ruleset> |
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,31 +1,26 @@ | ||
<?php | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Contributte\Database\DI; | ||
|
||
use Contributte\Database\Transaction\Transaction; | ||
use Nette\Database\Connection; | ||
use Nette\DI\CompilerExtension; | ||
|
||
/** | ||
* @author Milan Felix Sulc <sulcmil@gmail.com> | ||
*/ | ||
class TransactionExtension extends CompilerExtension | ||
{ | ||
|
||
/** | ||
* Decorate services | ||
* | ||
* @return void | ||
*/ | ||
public function beforeCompile() | ||
public function beforeCompile(): void | ||
{ | ||
$builder = $this->getContainerBuilder(); | ||
|
||
// If connection exists | ||
if ($builder->getByType(Connection::class)) { | ||
if ($builder->getByType(Connection::class) !== null) { | ||
$builder->addDefinition($this->prefix('transaction')) | ||
->setClass(Transaction::class); | ||
}; | ||
->setFactory(Transaction::class); | ||
} | ||
} | ||
|
||
} |
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\Database\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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?php | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Contributte\Database\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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?php | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Contributte\Database\Exception; | ||
|
||
|
Oops, something went wrong.