You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Execute Fractor from the command line, passing the path to your configuration file as an argument:
86
86
87
-
```
88
-
./vendor/bin/fractor process -f fractor.php
87
+
```bash
88
+
vendor/bin/fractor process -f fractor.php
89
89
```
90
90
91
91
Fractor will apply the rules specified in the configuration file to the targeted files.
92
92
Review the changes made by Fractor to ensure they meet your expectations.
93
93
94
94
You would also run fractor in dry mode:
95
95
96
-
```
97
-
./vendor/bin/fractor process -f fractor.php --dry-run
96
+
```bash
97
+
vendor/bin/fractor process -f fractor.php --dry-run
98
98
```
99
99
100
-
Fractor will output all the potential changes on the console without really execution.
100
+
Fractor will output all the potential changes on the console without real execution.
101
101
102
102
## Customization
103
103
@@ -113,26 +113,31 @@ Fractor can be extended with additional transformation rules and support for new
113
113
Here's how you can extend Fractor with a custom rule:
114
114
115
115
#### Creating New Rules
116
+
116
117
- Create a new rule by subclassing the appropriate rule class for the file type,
117
-
e.g. `\a9f\FractorXml\XmlFractor` for XML files.
118
+
e.g. `\a9f\FractorXml\XmlFractor` for XML files.
118
119
- Each rule should specify the conditions under which it should be applied and the corresponding changes to be made.
119
120
- Ideally, new rules also have a test case that validates that they work correctly.
120
121
121
122
#### Registering New Rules
123
+
122
124
- Register your custom rules within the Fractor configuration file.
123
125
124
126
### Supporting New File Types
125
127
126
128
#### Supporting New File Types
129
+
127
130
- To support a new file type, you will need to implement an instance of `\a9f\Fractor\Fractor\FileProcessor`.
128
-
This processor must take care of decoding a file and then traversing the decoded file structure
129
-
(e.g. the DOM tree of an XML file; see `\a9f\FractorXml\XmlFileProcessor` for an example)
131
+
This processor must take care of decoding a file and then traversing the decoded file structure
132
+
(e.g., the DOM tree of an XML file; see `\a9f\FractorXml\XmlFileProcessor` for an example)
130
133
131
134
### Testing
135
+
132
136
- Thoroughly test your extensions to ensure they function as expected and do not introduce unintended side effects.
133
137
- Write unit tests for your custom rules and parsers to maintain code quality and stability.
134
138
135
139
### Documentation
140
+
136
141
- Document your custom rules and file type extensions to aid other users in understanding and utilizing your contributions.
137
142
138
143
By extending Fractor in this manner, you can enhance its capabilities and adapt it to handle a wider range of file formats and transformation scenarios.
@@ -144,7 +149,8 @@ we welcome contributions from the community. Here's how you can contribute:
144
149
145
150
1. Fork the repository.
146
151
2. Make your changes.
147
-
3. Submit a pull request with a clear description of your changes and why they are needed.
152
+
3. Run `composer run-script local:contribute`
153
+
4. Submit a pull request with a clear description of your changes and why they are needed.
148
154
149
155
## Support
150
156
@@ -162,7 +168,7 @@ We're grateful for their contributions to the PHP ecosystem.
162
168
-----
163
169
164
170
Thank you for using Fractor to streamline your software update process!
165
-
We hope it helps make your development workflow more efficient and enjoyable.
171
+
We hope it helps to make your development workflow more efficient and enjoyable.
166
172
If you have any feedback or suggestions, we'd love to hear from you.
0 commit comments