Skip to content

Commit 8ca795f

Browse files
authored
Fix internals style (#186)
1 parent 9ed6577 commit 8ca795f

22 files changed

+186
-177
lines changed

000-packages.md

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
# 000 - Packages
22

3-
Since Yii 3 framework is divided into several packages with the following agreements.
3+
Yii3 team divided the framework into several packages that conform to the following agreements.
44

5-
For all packages GitHub repository name exactly matches Packagist package name.
5+
For all packages, the GitHub repository name exactly matches the Packagist package name.
66

7-
For a full list of packages and their build statuses see [status page at yiiframework.com](https://www.yiiframework.com/status/3.0).
7+
For a full list of packages and their building status,
8+
see [status page at yiiframework.com](https://www.yiiframework.com/status/3.0).
89

9-
## Yii-specific packages (Yii Framework and Extensions)
10+
## Yii-specific packages (framework and extensions)
1011

1112
- named `yiisoft/yii-something` or more specific: `yii-type-something` e.g.:
1213
- modules: `yii-module-users`, `yii-module-pages`
1314
- themes: `yii-theme-adminlte`, `yii-theme-hyde`
1415
- widgets: `yii-widget-datepicker`
15-
- and so on
16+
- ...
1617
- titled as "Yii Framework ..."
1718
- may have any dependencies and Yii-specific code
1819

19-
## General purpose packages (Libraries)
20+
## General purpose packages (libraries)
2021

21-
- can be used outside of Yii Framework
22+
- you can use these independently of Yii Framework
2223
- named as `yiisoft/something` without yii-prefix
2324
- titled as "Yii ..."
2425
- must not have dependencies on any Yii-specific packages
@@ -30,8 +31,8 @@ The following applies to both Yii-specific packages and general purpose packages
3031

3132
- Package may have `config` directory with Yii-specific defaults.
3233
- Package may have "config-plugin" in "extra" section of `composer.json`.
33-
- Package must not have dependencies in `require` section of `composer.json` that are used in `config` only.
34-
- Parameters should be namespaced with `vendor/package-name`:
34+
- Package mustn't have dependencies in `require` section of `composer.json` that are used in `config` only.
35+
- You should namespace parameters with `vendor/package-name`:
3536

3637
```php
3738
return [
@@ -44,19 +45,19 @@ return [
4445

4546
## Versions
4647

47-
All packages are versioned according to [SemVer](https://semver.org/):
48+
All packages follow [SemVer](https://semver.org/) versioning:
4849

4950
- `x.*.*` - incompatible API changes.
5051
- `*.x.*` - add functionality (backwards-compatible).
5152
- `*.*.x` - bug fixes (backwards-compatible).
5253

53-
First stable version should be 1.0.0.
54+
The first stable version should be 1.0.0.
5455

55-
Each package version number does not depend on any other package version or "framework version", only on its own public contract.
56+
Each package version number doesn't depend on any other package version or framework name/version,
57+
only on its own public contract.
58+
The framework as a whole has the "Yii3" name.
5659

57-
So it is completely normal to use together packages with different major versions, as long as they are compatible.
58-
59-
Framework as a whole will keep naming "Yii 3" so it will be considered version 3, independent of version of its packages.
60+
It's alright to use packages with different major versions together, as long as they're compatible.
6061

6162
## PHP versions support
6263

@@ -67,7 +68,7 @@ The support of PHP versions supported for a package depends on
6768
- Both packages and application templates MUST have supported versions that receive bug and security fixes.
6869
These SHOULD correspond to PHP versions receiving security fixes.
6970
- Packages and application templates MIGHT have supported versions that work with unsupported PHP versions.
70-
- Bumping minimal PHP version in a package or an application template is considered a minor change.
71+
- Bumping the minimal PHP version in a package or an application template is a minor change.
7172

7273
## composer.json
7374

001-yii-values.md

+18-16
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,50 @@
22

33
## Goal
44

5-
The Yii project aims to build and maintain _practical_ and _helpful_ tools and community.
5+
The Yii project aims to build and support _practical_ and _helpful_ tools and community.
66

77
## Values
88

99
The values we express in our work support the goal. We try to
1010

11-
- Be Practical
12-
- [High Performance](#high-performance)
13-
- [Sensible Defaults and Flexibility](#sensible-defaults-and-flexibility)
11+
- Be practical
12+
- [High performance](#high-performance)
13+
- [Sensible defaults and flexibility](#sensible-defaults-and-flexibility)
1414
- [Be practice-oriented](#be-practice-oriented)
15-
- Be Helpful
15+
- Be helpful
1616
- [Be simple](#be-simple)
1717
- [Be explicit](#be-explicit)
1818
- [Be consistent](#be-consistent)
1919

20-
## Be Practical
20+
## Be practical
2121

22-
### High Performance
22+
### High performance
2323

24-
Performance is a necessary condition of practicality. Software should not waste machine or human resources.
24+
Performance is a necessary condition of practicality. Software shouldn't waste machine resources or human resources.
2525

26-
### Sensible Defaults and Flexibility
26+
### Sensible defaults and flexibility
2727

28-
We prefer sensible defaults and conventions that users can customize. We seek a balance between flexibility, discipline and simplicity that meets common needs.
28+
We prefer sensible defaults and conventions that users can customize.
29+
We seek a balance between flexibility, discipline and simplicity that meets common needs.
2930

3031
### Be practice-oriented
3132

32-
We prefer practice over theory. For example:
33+
We prefer practice to theory. For example:
3334

3435
- Solutions for known use cases should avoid excess complexity by providing only needed flexibility.
3536
- Standard implementations should take practical use into account.
3637
- Experience is at least as useful as theory in guiding design.
3738
- Context is critical in determining appropriateness.
3839

39-
## Be Helpful
40+
## Be helpful
4041

41-
This value guides technical decisions as well as community activity. Consideration of how software features help users should guide development. Community-wise, we value any helpful contribution, be it a
42-
pull request or an answer in the forum.
42+
This value guides technical decisions as well as community activity.
43+
Consideration of how software features help users should guide development.
44+
Community-wise, we value any helpful contribution, be it a pull request or an answer in the forum.
4345

44-
When the other principles could conflict, we choose a solution that is more helpful to the community.
46+
When the other principles could conflict, we choose a solution that's more helpful to the community.
4547

46-
### Be Simple
48+
### Be simple
4749

4850
Solutions should be simple and expressive:
4951

002-issue-workflow.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The process of handing incoming issues is the following:
66

77
## Roles
88

9-
We have multiple roles:
9+
We've many roles:
1010

1111
- Process managers - initially triage issues and manage labels.
1212
- Decision makers - participate in discussions moving them to resolutions.
@@ -18,10 +18,10 @@ A single person may take one or more roles in the issue resolving process.
1818

1919
## Labels
2020

21-
We label issues in order to mark multiple things: current status, issue type,
21+
We label issues to mark many things: current status, issue type,
2222
component affected. Status labels speak for themselves.
2323

2424
## Milestones
2525

26-
Issues are not assigned to milestones unless they are critical or there is
27-
a likely good pull request exist.
26+
Issues aren't assigned to milestones unless they're critical or there is
27+
a likely good pull request exists.

003-roadmap.md

+30-29
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22

33
We want Yii 3 to:
44

5-
- Not limit developer in choosing architecture. Allow anything from "classic" MVC to DDD.
5+
- Not limit a developer in choosing architecture. Allow anything from "classic" MVC to DDD.
66
- Be based on best practices such as SOLID, GRASP etc. and teach them to community.
7-
- Keep most good things from Yii 2.
8-
- Be more open to global PHP community and infrastructure.
7+
- Keep the most good things from Yii 2.
8+
- Be more open to the global PHP community and infrastructure.
99

1010
## PSRs compliance
1111

12-
PSR compliance helps with customizability, ability to use general PHP libraries and implement less wrappers.
12+
PSR compliance helps with customizability, ability to use general PHP libraries and implement fewer wrappers.
1313
Here's the list of PSRs we want to implement.
1414

1515
### PSR-3 Logger
1616

17-
Implemented as a [separate package that is not dependent on a framework](https://github.com/yiisoft/log).
17+
Implemented as a [separate package that isn't dependent on a framework](https://github.com/yiisoft/log).
1818

1919
- [x] Framework packages should depend on interface only.
2020
- [x] Split drivers into packages.
21-
- [x] Clean up code.
21+
- [x] Clean-up code.
2222
- [x] [Fix email target](https://github.com/yiisoft/log-target-email).
2323

2424
### PSR-4 Autoloading
@@ -33,16 +33,16 @@ Implemented as a [separate package that is not dependent on a framework](https:/
3333

3434
### PSR-11 Container
3535

36-
Implemented as a [separate package that is not dependent on a framework](https://github.com/yiisoft/di).
36+
Implemented as a [separate package that isn't dependent on a framework](https://github.com/yiisoft/di).
3737

38-
- [x] Framework packages should not use container directly. One should be able to instantiate everything manually.
38+
- [x] Framework packages shouldn't use container directly. One should be able to instantiate everything manually.
3939
- [x] Finish refactoring.
40-
- [x] Remove all framework-specific implementations from the package. Move to framework.
40+
- [x] Remove all framework-specific implementations from the package. Move to a framework.
4141
- [x] [Implement autoloader fallback](https://github.com/yiisoft/di/issues/88)
4242

4343
### PSR-12 Code style
4444

45-
- [x] Make sure code follows it.
45+
- [x] Make sure the code follows it.
4646
- [x] Automate fixing style before release.
4747

4848
### PSR-14 Event dispatcher
@@ -53,8 +53,8 @@ Implemented as a [separate package that is not dependent on a framework](https:/
5353

5454
### PSR-15 HTTP handlers
5555

56-
- [x] Rewrite HTTP flow to PSR-7 request-reponse + formatting response via emitter.
57-
- [x] Provide SAPI emitter out of the box.
56+
- [x] Rewrite HTTP flow to PSR-7 request-response + formatting response via emitter.
57+
- [x] Offer SAPI emitter out of the box.
5858
- [x] Make it possible to use alternative emitters such as RoadRunner.
5959
- [x] Support middleware.
6060
- [x] Implement filters as middleware:
@@ -65,11 +65,11 @@ Implemented as a [separate package that is not dependent on a framework](https:/
6565

6666
### PSR-16 Simple cache
6767

68-
Implemented as a [separate package that is not dependent on a framework](https://github.com/yiisoft/cache).
68+
Implemented as a [separate package that isn't dependent on a framework](https://github.com/yiisoft/cache).
6969

7070
- [x] Framework packages should depend on interfaces only.
7171
- [x] Split drivers into packages.
72-
- [x] Clean up code.
72+
- [x] Clean-up code.
7373

7474
### PSR-17 HTTP factories
7575

@@ -92,7 +92,7 @@ Implemented as a [separate package that is not dependent on a framework](https:/
9292

9393
## Router
9494

95-
Implemented as a [separate package that is not dependent on a framework](https://github.com/yiisoft/router).
95+
Implemented as a [separate package that isn't dependent on a framework](https://github.com/yiisoft/router).
9696

9797
- [x] DSL for configuration.
9898
- [x] Ability to route to any callable.
@@ -101,10 +101,10 @@ Implemented as a [separate package that is not dependent on a framework](https:/
101101

102102
## Best practices and SOLID compliance of all classes/packages
103103

104-
- [x] Make sure interfaces follow "interface segregation" principle.
105-
- [x] Do not use public properties.
106-
- [x] Do not use `init()`.
107-
- [x] Do not inherit from `BaseObject` or `Component`. Remove these.
104+
- [x] Make sure interfaces follow the "interface segregation" principle.
105+
- [x] Don't use public properties.
106+
- [x] Don't use `init()`.
107+
- [x] Don't inherit from `BaseObject` or `Component`. Remove these.
108108
- [x] No globals.
109109
- [x] No static calls except helpers that are final.
110110
- [x] Prefer throwing exceptions to fixing input.
@@ -125,12 +125,12 @@ Implemented as a [separate package that is not dependent on a framework](https:/
125125
## Documentation
126126

127127
- [ ] Follow best practices.
128-
- [ ] Don't use "MVC" term.
128+
- [ ] Don't use the "MVC" term.
129129
- [ ] Upgrading from Yii 2.
130130

131131
## RBAC
132132

133-
RBAC is implemented as [framework-independent package](https://github.com/yiisoft/rbac).
133+
RBAC is implemented as [a framework-independent package](https://github.com/yiisoft/rbac).
134134

135135
- [x] Finish refactoring.
136136
- [x] Make sure it follows best practices.
@@ -145,17 +145,17 @@ View is implemented as [framework-independent package](https://github.com/yiisof
145145
- [x] Rethink and implement active form widgets.
146146
- [x] Implement caching widgets.
147147

148-
## Data abstractions and Grid
148+
## Data abstractions and grid
149149

150150
- [x] Finish [data abstractions](https://github.com/yiisoft/data).
151-
- [x] Port sort, make it use data abstractions. Should be part of [yii-dataview](https://github.com/yiisoft/yii-dataview).
152-
- [x] Port paging, make it use data abstractions. Should be part of [yii-dataview](https://github.com/yiisoft/yii-dataview).
153-
- [x] Port grid, make it use data abstractions. Should be part of [yii-dataview](https://github.com/yiisoft/yii-dataview).
154-
- [x] Port list, make it use data abstractions. Should be part of [yii-dataview](https://github.com/yiisoft/yii-dataview).
151+
- [x] Port sort, use data abstractions. Should be part of [yii-dataview](https://github.com/yiisoft/yii-dataview).
152+
- [x] Port paging, use data abstractions. Should be part of [yii-dataview](https://github.com/yiisoft/yii-dataview).
153+
- [x] Port grid, use data abstractions. Should be part of [yii-dataview](https://github.com/yiisoft/yii-dataview).
154+
- [x] Port list, use data abstractions. Should be part of [yii-dataview](https://github.com/yiisoft/yii-dataview).
155155

156156
## Validators
157157

158-
- [x] Finish [main package](https://github.com/yiisoft/validator) redesign
158+
- [x] Finish [the main package](https://github.com/yiisoft/validator) redesign
159159
- [x] Port necessary validators
160160

161161
## Debug toolbar
@@ -174,6 +174,7 @@ View is implemented as [framework-independent package](https://github.com/yiisof
174174
## Others
175175

176176
- [x] [Decide on namespaces](https://forum.yiiframework.com/t/lowercase-or-camelcase-namespaces/124983/52).
177-
- [x] [Clean up error handler](https://github.com/yiisoft/yii2/issues/14348). Make sure error handler catches fatals and is using response.
178-
- [x] Make validators independent from models to allow reusing them in handlers.
177+
- [x] [Clean up error handler](https://github.com/yiisoft/yii2/issues/14348). Make sure the error handler catches
178+
fatals and is using response.
179+
- [x] Make validators independent of models to allow reusing them in handlers.
179180
- [x] [Split IdentityInterface](https://github.com/yiisoft/yii2/issues/13825).

005-development-tool.md

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# 005 - Yii Development Tool
1+
# 005 - Yii development tool
22

3-
For Yii 3 the number of packages increased significantly in order to achieve more reusability and independent releases.
4-
In order to ease development of the framework itself we have created a special tool available from [yiisoft/yii-dev-tool](https://github.com/yiisoft/yii-dev-tool).
3+
For Yii 3 the number of packages increased significantly to achieve more reusability and independent releases.
4+
To ease development of the framework itself we've created a special tool available from [yiisoft/yii-dev-tool](https://github.com/yiisoft/yii-dev-tool).
55

66
```
77
$ ./yii-dev
@@ -31,17 +31,14 @@ Available commands:
3131
update Update packages
3232
```
3333

34-
There are multiple commands available. The most important ones are `install` and `update`. What it does is:
34+
There are many commands available. The most important ones are `install` and `update`. What it does is:
3535

3636
1. Install/update all packages listed in [`packages.php`](https://github.com/yiisoft/yii-dev-tool/blob/master/packages.php)
3737
or individual package from that list if specified.
38-
2. For every packages installed check `vendor` directory for packages listed in `packages.php`. If there are any,
39-
replace package directory with a symlink to another package source.
38+
2. For every package installed check `vendor` directory for packages listed in `packages.php`.
39+
If there is any, replace package directory with a symlink to another package source.
4040

41-
As a result you will have multiple packages using each other so there is no need to `git push` and `composer install` / `composer update`
41+
As a result you will have many packages using each other, so there is no need to `git push` and `composer install` / `composer update`
4242
during development.
4343

4444
A [detailed example](https://github.com/yiisoft/yii-dev-tool#usage-example) of using the tool is available in its README.
45-
46-
> Note: In case you are using PhpStorm you have to add `yiisoft` exclusion pattern in "Settings → Directories → Exclude Files".
47-
> Else it would go into infinite indexing cycle.

006-git-commit-messages.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
## Subject line
55

66
- Use `#123` to reference issue by number
7-
- Use imperative mood i.e. `Fix`, not `Fixed`
8-
- Do not add period at the end
7+
- Use imperative mood that's `Fix`, not `Fixed`
8+
- Don't add period at the end
99
- Use `[skip ci]` if there is no need to run unit tests
1010
- Start with a capital letter
1111
- Limit to 50 characters
1212

1313
## Body
1414

15-
Use message body **if** extra explanation is needed. Explain why, not how.
15+
Use message body **if** you need an extra explanation. Explain why, not how.
1616

1717
- Limit line length to 72 characters

007-exceptions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
- Throw exceptions instead of returning an error code.
44
- Exception class name must be suffixed with `Exception`.
5-
- Use grammatically correct error messages including ending punctuation i.e. most exceptions must end with period.
5+
- Use grammatically correct error messages including ending punctuation, that's most exceptions must end with a period.
66
- `\InvalidArgumentException` must be used directly. There should be no exceptions inherited from it.
77
- `\InvalidArgumentException` must never be caught.
88

0 commit comments

Comments
 (0)