-
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.
- Loading branch information
1 parent
5867769
commit b26a85d
Showing
27 changed files
with
190 additions
and
150 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
function recur_ksort(&$array) { | ||
foreach ($array as &$value) { | ||
if (is_array($value)) recur_ksort($value); | ||
} | ||
return ksort($array); | ||
} | ||
|
||
$rules = json_decode(file_get_contents('.php_cs.rules.json'), true); | ||
|
||
recur_ksort($rules); | ||
|
||
file_put_contents('.php_cs.rules.json', json_encode($rules, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); | ||
|
||
$config = PhpCsFixer\Config::create() | ||
->setRiskyAllowed(true) | ||
->setRules($rules) | ||
->setUsingCache(false) | ||
->registerCustomFixers(new PedroTroller\CS\Fixer\Fixers()) | ||
->setFinder(PhpCsFixer\Finder::create()->in(__DIR__)) | ||
; | ||
|
||
return $config; |
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,56 @@ | ||
{ | ||
"@Symfony": true, | ||
"@Symfony:risky": true, | ||
"PedroTroller/forbidden_functions": { | ||
"comment": "@TODO remove it", | ||
"functions": [ | ||
"dump", | ||
"var_dump" | ||
] | ||
}, | ||
"PedroTroller/line_break_between_method_arguments": { | ||
"max-args": 4, | ||
"max-length": 80 | ||
}, | ||
"PedroTroller/line_break_between_statements": true, | ||
"PedroTroller/phpspec": true, | ||
"PedroTroller/single_line_comment": { | ||
"action": "expanded" | ||
}, | ||
"align_multiline_comment": true, | ||
"array_syntax": { | ||
"syntax": "short" | ||
}, | ||
"binary_operator_spaces": { | ||
"operators": { | ||
"=": "align_single_space_minimal", | ||
"=>": "align_single_space_minimal" | ||
} | ||
}, | ||
"blank_line_before_statement": true, | ||
"combine_consecutive_issets": true, | ||
"combine_consecutive_unsets": true, | ||
"compact_nullable_typehint": true, | ||
"general_phpdoc_annotation_remove": true, | ||
"heredoc_to_nowdoc": true, | ||
"linebreak_after_opening_tag": true, | ||
"list_syntax": { | ||
"syntax": "long" | ||
}, | ||
"mb_str_functions": true, | ||
"no_multiline_whitespace_before_semicolons": true, | ||
"no_null_property_initialization": true, | ||
"no_superfluous_elseif": true, | ||
"no_useless_else": true, | ||
"no_useless_return": true, | ||
"ordered_class_elements": true, | ||
"ordered_imports": true, | ||
"phpdoc_add_missing_param_annotation": { | ||
"only_untyped": true | ||
}, | ||
"phpdoc_order": true, | ||
"phpdoc_types_order": true, | ||
"self_accessor": false, | ||
"semicolon_after_instruction": true, | ||
"single_line_comment_style": true | ||
} |
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 was deleted.
Oops, something went wrong.
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,11 +1,10 @@ | ||
<?php | ||
|
||
namespace spec\Knp\Rad\Mailer\MailFactory; | ||
namespace spec\Knp\UniMail\MailFactory; | ||
|
||
use Knp\Rad\Mailer\Mail; | ||
use Knp\Rad\Mailer\MailFactory; | ||
use Knp\UniMail\Mail; | ||
use Knp\UniMail\MailFactory; | ||
use PhpSpec\ObjectBehavior; | ||
use Prophecy\Argument; | ||
|
||
class ConfigurationAwareFactorySpec extends ObjectBehavior | ||
{ | ||
|
@@ -15,40 +14,38 @@ function let(MailFactory $factory) | |
'the_mail' => [ | ||
'from' => '[email protected]', | ||
'to' => '[email protected]', | ||
] | ||
], | ||
]; | ||
|
||
$this->beConstructedWith($configuration, $factory); | ||
} | ||
|
||
function it_is_initializable() | ||
{ | ||
$this->shouldHaveType('Knp\Rad\Mailer\MailFactory\ConfigurationAwareFactory'); | ||
$this->shouldHaveType('Knp\UniMail\MailFactory\ConfigurationAwareFactory'); | ||
} | ||
|
||
function it_instantiate_a_new_mail_with_configuration($factory, Mail $mail) | ||
{ | ||
$factory | ||
->createMail('the_mail', ['from' => '[email protected]', 'to' => '[email protected]']) | ||
->willReturn($mail) | ||
; | ||
->willReturn($mail); | ||
|
||
$this | ||
->createMail('the_mail', ['from' => '[email protected]']) | ||
->shouldReturn($mail) | ||
; | ||
->shouldReturn($mail); | ||
} | ||
|
||
function it_instantiate_a_new_mail_without_configuration($factory, Mail $mail) | ||
{ | ||
function it_instantiate_a_new_mail_without_configuration( | ||
$factory, | ||
Mail $mail | ||
) { | ||
$factory | ||
->createMail('the_other_mail', ['from' => '[email protected]']) | ||
->willReturn($mail) | ||
; | ||
->willReturn($mail); | ||
|
||
$this | ||
->createMail('the_other_mail', ['from' => '[email protected]']) | ||
->shouldReturn($mail) | ||
; | ||
->shouldReturn($mail); | ||
} | ||
} |
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
Oops, something went wrong.