Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8df4e57

Browse files
committed
feature #31571 [Contracts] split in one package per sub-contracts (nicolas-grekas)
This PR was merged into the 4.3 branch. Discussion ---------- [Contracts] split in one package per sub-contracts | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #31567 | License | MIT | Doc PR | - Commits ------- f410691 [Contracts] split in one package per sub-contracts
2 parents e19de54 + f410691 commit 8df4e57

File tree

17 files changed

+316
-16
lines changed

17 files changed

+316
-16
lines changed

src/Symfony/Contracts/Cache/LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2018-2019 Fabien Potencier
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

src/Symfony/Contracts/Cache/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Symfony Cache Contracts
2+
=======================
3+
4+
A set of abstractions extracted out of the Symfony components.
5+
6+
Can be used to build on semantics that the Symfony components proved useful - and
7+
that already have battle tested implementations.
8+
9+
See https://github.com/symfony/contracts/blob/master/README.md for more information.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "symfony/cache-contracts",
3+
"type": "library",
4+
"description": "Generic abstractions related to caching",
5+
"keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"],
6+
"homepage": "https://symfony.com",
7+
"license": "MIT",
8+
"authors": [
9+
{
10+
"name": "Nicolas Grekas",
11+
"email": "[email protected]"
12+
},
13+
{
14+
"name": "Symfony Community",
15+
"homepage": "https://symfony.com/contributors"
16+
}
17+
],
18+
"require": {
19+
"php": "^7.1.3"
20+
},
21+
"suggest": {
22+
"psr/cache": "",
23+
"symfony/cache-implementation": ""
24+
},
25+
"autoload": {
26+
"psr-4": { "Symfony\\Contracts\\Cache\\": "" }
27+
},
28+
"minimum-stability": "dev",
29+
"extra": {
30+
"branch-alias": {
31+
"dev-master": "1.1-dev"
32+
}
33+
}
34+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2018-2019 Fabien Potencier
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Symfony EventDispatcher Contracts
2+
=================================
3+
4+
A set of abstractions extracted out of the Symfony components.
5+
6+
Can be used to build on semantics that the Symfony components proved useful - and
7+
that already have battle tested implementations.
8+
9+
See https://github.com/symfony/contracts/blob/master/README.md for more information.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "symfony/event-dispatcher-contracts",
3+
"type": "library",
4+
"description": "Generic abstractions related to dispatching event",
5+
"keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"],
6+
"homepage": "https://symfony.com",
7+
"license": "MIT",
8+
"authors": [
9+
{
10+
"name": "Nicolas Grekas",
11+
"email": "[email protected]"
12+
},
13+
{
14+
"name": "Symfony Community",
15+
"homepage": "https://symfony.com/contributors"
16+
}
17+
],
18+
"require": {
19+
"php": "^7.1.3"
20+
},
21+
"suggest": {
22+
"psr/event-dispatcher": "",
23+
"symfony/event-dispatcher-implementation": ""
24+
},
25+
"autoload": {
26+
"psr-4": { "Symfony\\Contracts\\EventDispatcher\\": "" }
27+
},
28+
"minimum-stability": "dev",
29+
"extra": {
30+
"branch-alias": {
31+
"dev-master": "1.1-dev"
32+
}
33+
}
34+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2018-2019 Fabien Potencier
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Symfony HttpClient Contracts
2+
============================
3+
4+
A set of abstractions extracted out of the Symfony components.
5+
6+
Can be used to build on semantics that the Symfony components proved useful - and
7+
that already have battle tested implementations.
8+
9+
See https://github.com/symfony/contracts/blob/master/README.md for more information.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "symfony/http-client-contracts",
3+
"type": "library",
4+
"description": "Generic abstractions related to HTTP clients",
5+
"keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"],
6+
"homepage": "https://symfony.com",
7+
"license": "MIT",
8+
"authors": [
9+
{
10+
"name": "Nicolas Grekas",
11+
"email": "[email protected]"
12+
},
13+
{
14+
"name": "Symfony Community",
15+
"homepage": "https://symfony.com/contributors"
16+
}
17+
],
18+
"require": {
19+
"php": "^7.1.3"
20+
},
21+
"suggest": {
22+
"symfony/http-client-implementation": ""
23+
},
24+
"autoload": {
25+
"psr-4": { "Symfony\\Contracts\\HttpClient\\": "" }
26+
},
27+
"minimum-stability": "dev",
28+
"extra": {
29+
"branch-alias": {
30+
"dev-master": "1.1-dev"
31+
}
32+
}
33+
}

src/Symfony/Contracts/README.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,6 @@ providing abstractions that are useful on their own while still compatible with
4444
implementations provided by Symfony. Although not the main target, we hope that
4545
the declared contracts will directly or indirectly contribute to the PHP-FIG.
4646

47-
### Why isn't this package split into several packages?
48-
49-
Putting all interfaces in one package eases discoverability and dependency
50-
management. Instead of dealing with a myriad of small packages and the
51-
corresponding matrix of versions, you just need to deal with one package and one
52-
version. Also when using IDE autocompletion or just reading the source code, it
53-
makes it easier to figure out which contracts are provided.
54-
55-
There are two downsides to this approach: you may have unused files in your
56-
`vendor/` directory, and in the future, it will be impossible to use two
57-
different sub-namespaces in different major versions of the package. For the
58-
"unused files" downside, it has no practical consequences: their file sizes are
59-
very small, and there is no performance overhead at all since they are never
60-
loaded. For major versions, this package follows the Symfony BC + deprecation
61-
policies, with an additional restriction to never remove deprecated interfaces.
62-
6347
Resources
6448
---------
6549

src/Symfony/Contracts/Service/LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2018-2019 Fabien Potencier
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Symfony Service Contracts
2+
=========================
3+
4+
A set of abstractions extracted out of the Symfony components.
5+
6+
Can be used to build on semantics that the Symfony components proved useful - and
7+
that already have battle tested implementations.
8+
9+
See https://github.com/symfony/contracts/blob/master/README.md for more information.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "symfony/service-contracts",
3+
"type": "library",
4+
"description": "Generic abstractions related to writting services",
5+
"keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"],
6+
"homepage": "https://symfony.com",
7+
"license": "MIT",
8+
"authors": [
9+
{
10+
"name": "Nicolas Grekas",
11+
"email": "[email protected]"
12+
},
13+
{
14+
"name": "Symfony Community",
15+
"homepage": "https://symfony.com/contributors"
16+
}
17+
],
18+
"require": {
19+
"php": "^7.1.3"
20+
},
21+
"suggest": {
22+
"psr/container": "",
23+
"symfony/service-implementation": ""
24+
},
25+
"autoload": {
26+
"psr-4": { "Symfony\\Contracts\\Service\\": "" }
27+
},
28+
"minimum-stability": "dev",
29+
"extra": {
30+
"branch-alias": {
31+
"dev-master": "1.1-dev"
32+
}
33+
}
34+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2018-2019 Fabien Potencier
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Symfony Translation Contracts
2+
=============================
3+
4+
A set of abstractions extracted out of the Symfony components.
5+
6+
Can be used to build on semantics that the Symfony components proved useful - and
7+
that already have battle tested implementations.
8+
9+
See https://github.com/symfony/contracts/blob/master/README.md for more information.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "symfony/translation-contracts",
3+
"type": "library",
4+
"description": "Generic abstractions related to translation",
5+
"keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"],
6+
"homepage": "https://symfony.com",
7+
"license": "MIT",
8+
"authors": [
9+
{
10+
"name": "Nicolas Grekas",
11+
"email": "[email protected]"
12+
},
13+
{
14+
"name": "Symfony Community",
15+
"homepage": "https://symfony.com/contributors"
16+
}
17+
],
18+
"require": {
19+
"php": "^7.1.3"
20+
},
21+
"suggest": {
22+
"symfony/translation-implementation": ""
23+
},
24+
"autoload": {
25+
"psr-4": { "Symfony\\Contracts\\Translation\\": "" }
26+
},
27+
"minimum-stability": "dev",
28+
"extra": {
29+
"branch-alias": {
30+
"dev-master": "1.1-dev"
31+
}
32+
}
33+
}

src/Symfony/Contracts/composer.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,17 @@
2323
"psr/container": "^1.0",
2424
"symfony/polyfill-intl-idn": "^1.10"
2525
},
26+
"replace": {
27+
"symfony/cache-contracts": "self.version",
28+
"symfony/event-dispatcher-contracts": "self.version",
29+
"symfony/http-client-contracts": "self.version",
30+
"symfony/service-contracts": "self.version",
31+
"symfony/translation-contracts": "self.version"
32+
},
2633
"suggest": {
2734
"psr/cache": "When using the Cache contracts",
2835
"psr/container": "When using the Service contracts",
36+
"psr/event-dispatcher": "When using the EventDispatcher contracts",
2937
"symfony/cache-implementation": "",
3038
"symfony/event-dispatcher-implementation": "",
3139
"symfony/http-client-implementation": "",

0 commit comments

Comments
 (0)