File tree Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -29,17 +29,39 @@ protected function getDefaultNamespace($rootNamespace): string
2929 return sprintf ('%s\Specifications ' , $ rootNamespace );
3030 }
3131
32+ protected function buildClass ($ name ): string
33+ {
34+ $ replacements = [
35+ '{{ candidate }} ' => $ this ->option ('candidate ' ),
36+ ];
37+
38+ return str_replace (
39+ array_keys ($ replacements ),
40+ array_values ($ replacements ),
41+ parent ::buildClass ($ name ),
42+ );
43+ }
44+
3245 protected function getOptions (): array
3346 {
3447 $ composite = new InputOption (
3548 'composite ' ,
36- ' c ' ,
49+ null ,
3750 InputOption::VALUE_NONE ,
3851 'Indicates the specification should be composite ' ,
3952 );
4053
54+ $ candidate = new InputOption (
55+ 'candidate ' ,
56+ 'c ' ,
57+ InputOption::VALUE_OPTIONAL ,
58+ 'Specify the candidate type to use ' ,
59+ 'mixed ' ,
60+ );
61+
4162 return [
4263 $ composite ,
64+ $ candidate ,
4365 ];
4466 }
4567}
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ namespace {{ namespace }};
77use Maartenpaauw\Specifications\CompositeSpecification;
88
99/**
10- * @extends CompositeSpecification<mixed >
10+ * @extends CompositeSpecification<{{ candidate }} >
1111 */
1212class {{ class }} extends CompositeSpecification
1313{
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ namespace {{ namespace }};
77use Maartenpaauw\Specifications\Specification;
88
99/**
10- * @implements Specification<mixed >
10+ * @implements Specification<{{ candidate }} >
1111 */
1212class {{ class }} implements Specification
1313{
You can’t perform that action at this time.
0 commit comments