-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [CRM-63243] Adjust code for php ^8.1 - added changelog * [CRM-63243] Adjust code for php ^8.1 - updated packages + fixed code * [CRM-63243] Adjust code for php ^8.1 - Added cs-fixer * [CRM-63243] Adjust code for php ^8.1 - Changed php version in travis * [CRM-63243] Adjust code for php ^8.1 - Added rector config * [CRM-63243] Adjust code for php ^8.1 - Added phpstan config * [CRM-63243] Adjust code for php ^8.1 * [CRM-63243] Adjust code for php ^8.1 - Updated phpunit package + refactor tests --------- Co-authored-by: Dawid Jaruniak <[email protected]>
- Loading branch information
1 parent
2100972
commit 9f96ebe
Showing
30 changed files
with
331 additions
and
282 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,2 +1,9 @@ | ||
composer.lock | ||
vendor | ||
vendor | ||
.idea | ||
|
||
.phpunit.result.cache | ||
.phpunit.cache | ||
|
||
.phpstan | ||
.php-cs-fixer.cache |
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,14 @@ | ||
<?php | ||
|
||
$finder = Symfony\Component\Finder\Finder::create() | ||
->in(__DIR__.'/src') | ||
->in(__DIR__.'/test') | ||
->exclude('vendor'); | ||
|
||
$config = new PhpCsFixer\Config(); | ||
|
||
return $config->setRules([ | ||
'@PSR12' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
]) | ||
->setFinder($finder); |
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,4 @@ | ||
# Changelog | ||
|
||
## 2.0.0 | ||
* [TASK][CRM-63243](https://jira.trans.eu/browse/CRM-63243) Adjust code for php ^8.1 |
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,15 +1,25 @@ | ||
{ | ||
"name": "rstgroup/object-builder", | ||
"description": "Dynamic build of object", | ||
"version": "2.0.0", | ||
"license": "MIT", | ||
"keywords": [], | ||
"authors": [ | ||
{ | ||
"name": "Team ABW", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": "^7.2", | ||
"phpstan/phpdoc-parser": "^0.3.0 || ^0.4.0 || ^0.5.0", | ||
"roave/better-reflection": "^3.0 || ^4.0" | ||
"php": "^8.1", | ||
"phpstan/phpdoc-parser": "^1.29.0", | ||
"roave/better-reflection": "~6.25.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^7.2" | ||
"friendsofphp/php-cs-fixer": "^3.58", | ||
"phpstan/phpstan": "^1.11", | ||
"phpunit/phpunit": "^10.0.0", | ||
"rector/rector": "^1.1" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
|
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,6 @@ | ||
parameters: | ||
level: 6 | ||
tmpDir: .phpstan | ||
paths: | ||
- src | ||
- test |
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,29 +1,26 @@ | ||
<phpunit bootstrap="vendor/autoload.php" | ||
backupStaticAttributes="false" | ||
<?xml version="1.0"?> | ||
<phpunit | ||
bootstrap="vendor/autoload.php" | ||
backupGlobals="false" | ||
colors="true" | ||
stopOnError="false" | ||
stopOnFailure="false" | ||
stopOnIncomplete="false" | ||
stopOnSkipped="false" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
verbose="true"> | ||
|
||
<testsuites> | ||
<testsuite name="unit"> | ||
<directory>test/unit/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">src</directory> | ||
<exclude> | ||
<directory suffix=".php">test</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
|
||
</phpunit> | ||
cacheDirectory=".phpunit.cache" | ||
backupStaticProperties="false" | ||
> | ||
<testsuites> | ||
<testsuite name="unit"> | ||
<directory>test/unit/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<source> | ||
<include> | ||
<directory suffix=".php">src</directory> | ||
</include> | ||
<exclude> | ||
<directory suffix=".php">test</directory> | ||
</exclude> | ||
</source> | ||
</phpunit> |
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,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Config\RectorConfig; | ||
use Rector\PHPUnit\Set\PHPUnitSetList; | ||
use Rector\Set\ValueObject\LevelSetList; | ||
use Rector\Set\ValueObject\SetList; | ||
|
||
return static function (RectorConfig $rectorConfig): void { | ||
$rectorConfig->paths([ | ||
__DIR__ . '/src', | ||
__DIR__ . '/test', | ||
]); | ||
|
||
$rectorConfig->sets([ | ||
LevelSetList::UP_TO_PHP_81, | ||
]); | ||
|
||
$rectorConfig->import(SetList::CODE_QUALITY); | ||
$rectorConfig->import(SetList::TYPE_DECLARATION); | ||
$rectorConfig->import(SetList::CODING_STYLE); | ||
|
||
$rectorConfig->sets([ | ||
PHPUnitSetList::PHPUNIT_70, | ||
PHPUnitSetList::PHPUNIT_80, | ||
PHPUnitSetList::PHPUNIT_90, | ||
PHPUnitSetList::PHPUNIT_100, | ||
PHPUnitSetList::PHPUNIT_CODE_QUALITY, | ||
]); | ||
|
||
}; |
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,8 +1,15 @@ | ||
<?php declare(strict_types=1); | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace RstGroup\ObjectBuilder; | ||
|
||
interface Builder | ||
{ | ||
/** | ||
* @param string $class | ||
* @param mixed[] $data | ||
* @return object | ||
*/ | ||
public function build(string $class, array $data): object; | ||
} |
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,9 +1,12 @@ | ||
<?php declare(strict_types=1); | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace RstGroup\ObjectBuilder\Builder; | ||
|
||
interface ParameterNameStrategy | ||
{ | ||
public function isFulfilled(string $parameterName): bool; | ||
|
||
public function getName(string $parameterName): string; | ||
} |
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<?php declare(strict_types=1); | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace RstGroup\ObjectBuilder; | ||
|
||
use Exception; | ||
|
||
final class BuilderException extends Exception | ||
{ | ||
|
||
} |
Oops, something went wrong.