@@ -6,61 +6,27 @@ declare(strict_types=1);
6
6
* Copyright (c) 2019-2020 Andreas Möller
7
7
*
8
8
* For the full copyright and license information, please view
9
- * the LICENSE file that was distributed with this source code.
9
+ * the LICENSE.md file that was distributed with this source code.
10
10
*
11
11
* @see https://github.com/ergebnis/php-cs-fixer-config
12
12
*/
13
13
14
+ use Ergebnis \License ;
14
15
use Ergebnis \PhpCsFixer \Config ;
15
16
16
- $ years = Config \License \Copyright \Years::fromRange (
17
- Config \License \Copyright \Year::fromString ('2019 ' ),
18
- Config \License \Copyright \Year::current ()
19
- );
20
-
21
- $ holder = Config \License \Copyright \Holder::fromString ('Andreas Möller ' );
22
-
23
- $ file = Config \License \File::create (
24
- $ years ,
25
- $ holder ,
26
- Config \License \Template::fromString (
27
- <<<'EOF'
28
- The MIT License (MIT)
29
-
30
- Copyright (c) <copyright-years> <copyright-holder>
31
-
32
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
33
- documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
34
- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
35
- persons to whom the Software is furnished to do so, subject to the following conditions:
36
-
37
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
38
- Software.
39
-
40
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
41
- WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
42
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
43
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
44
-
45
- EOF
46
- )
47
- );
48
-
49
- $ file ->saveAs (__DIR__ . '/LICENSE ' );
50
-
51
- $ header = Config \License \Header::create (
52
- $ years ,
53
- $ holder ,
54
- Config \License \Notice::fromString (
55
- <<<'EOF'
56
- For the full copyright and license information, please view
57
- the LICENSE file that was distributed with this source code.
58
- EOF
17
+ $ license = License \Type \MIT ::markdown (
18
+ __DIR__ . '/LICENSE.md ' ,
19
+ License \Range::since (
20
+ License \Year::fromString ('2019 ' ),
21
+ new \DateTimeZone ('UTC ' )
59
22
),
60
- Config \License \Url::fromString ('https://github.com/ergebnis/php-cs-fixer-config ' )
23
+ License \Holder::fromString ('Andreas Möller ' ),
24
+ License \Url::fromString ('https://github.com/ergebnis/php-cs-fixer-config ' )
61
25
);
62
26
63
- $ config = Config \Factory::fromRuleSet (new Config \RuleSet \Php71 ($ header ->toString ()));
27
+ $ license ->save ();
28
+
29
+ $ config = Config \Factory::fromRuleSet (new Config \RuleSet \Php71 ($ license ->header ()));
64
30
65
31
$ config ->getFinder ()
66
32
->ignoreDotFiles (false )
0 commit comments