Skip to content

Commit 670bf4c

Browse files
author
awu
committed
chore: Add .editorconfig for consistent coding styles and update README formatting
1 parent 6d6021d commit 670bf4c

File tree

2 files changed

+35
-9
lines changed

2 files changed

+35
-9
lines changed

.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
indent_size = 4
8+
indent_style = space
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.json]
13+
indent_size = 2
14+
indent_style = space
15+
16+
[*.md]
17+
indent_size = 2
18+
indent_style = space
19+
20+
[*.xml]
21+
indent_size = 4
22+
indent_style = space
23+
24+
[*.yml]
25+
indent_size = 2
26+
indent_style = space

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
[![codecov](https://img.shields.io/codecov/c/github/wundii/data-mapper-symfony-bundle/main?token=V61OLHU8X3&style=for-the-badge)](https://codecov.io/github/wundii/data-mapper-symfony-bundle)
1717
[![Downloads](https://img.shields.io/packagist/dt/wundii/data-mapper-symfony-bundle.svg?style=for-the-badge)](https://packagist.org/packages/wundii/data-mapper-symfony-bundle)
1818

19-
A Symfony integration for [wundii/data-mapper](https://github.com/wundii/data-mapper).
20-
This library is an extremely fast and strictly typed object mapper built for modern PHP (8.2+).
19+
A Symfony integration for [wundii/data-mapper](https://github.com/wundii/data-mapper).
20+
This library is an extremely fast and strictly typed object mapper built for modern PHP (8.2+).
2121
It seamlessly transforms data from formats like CSV, JSON, NEON, XML, YAML, array, and standard objects into well-structured PHP objects.
2222

2323
Ideal for developers who need reliable and efficient data mapping without sacrificing code quality or modern best practices.
@@ -91,7 +91,7 @@ data_mapper:
9191
data_config:
9292
approach: 'CONSTRUCTOR|PROPERTY|SETTER' # ApproachEnum::SETTER
9393
accessible: 'PRIVATE|PUBLIC' # AccessibleEnum::PUBLIC
94-
class_map:
94+
class_map:
9595
InterfaceOrClassName: 'ClassName', # Class mapping for interfaces or other classes
9696
...: ...
9797
```
@@ -124,14 +124,14 @@ final class YourController extends AbstractController
124124
// Automatic recognition of the format based on the content type of the request
125125
// returns an instance of TestClass or an Exception
126126
$testClass = $this->dataMapper->request($request, TestClass::class);
127-
127+
128128
// or you can use tryRequest to avoid exceptions, null will be returned instead
129129
$testClass = $this->dataMapper->tryRequest($request, TestClass::class);
130130
$this->dataMapper->getMapStatusEnum();
131131
$this->dataMapper->getErrorMessage();
132-
132+
133133
// Do something with $testClass
134-
134+
135135
return $this->json(...);
136136
}
137137
}
@@ -164,10 +164,10 @@ final class YourController extends AbstractController
164164
{
165165
// you can use the native DataMapper methods directly
166166
$testClass = $this->dataMapper->json($request->getContent(), TestClass::class);
167-
167+
168168
// Do something with $testClass
169-
169+
170170
return $this->json(...);
171171
}
172172
}
173-
```
173+
```

0 commit comments

Comments
 (0)