Skip to content

Commit 77ee5d1

Browse files
authored
Merge pull request #10 from eman-development-design/update-code
Update code
2 parents fd3e0bf + 250aaa4 commit 77ee5d1

33 files changed

+5272
-213
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,33 @@ about: Create a report to help us improve
44
title: ''
55
labels: ''
66
assignees: ''
7-
87
---
98

9+
**Version**
10+
11+
What version do you have installed?
12+
13+
**PHP Version**
14+
15+
What version of PHP are you using?
16+
1017
**Describe the bug**
18+
1119
A clear and concise description of what the bug is.
1220

1321
**To Reproduce**
22+
1423
Steps to reproduce the behavior:
24+
1525
1. Go to '...'
1626
2. Click on '....'
1727
3. Scroll down to '....'
1828
4. See error
1929

2030
**Expected behavior**
21-
A clear and concise description of what you expected to happen.
22-
23-
**Screenshots**
24-
If applicable, add screenshots to help explain your problem.
2531

26-
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
30-
31-
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
32+
A clear and concise description of what you expected to happen.
3633

3734
**Additional context**
35+
3836
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@ assignees: ''
88
---
99

1010
**Is your feature request related to a problem? Please describe.**
11+
1112
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
1213

1314
**Describe the solution you'd like**
15+
1416
A clear and concise description of what you want to happen.
1517

1618
**Describe alternatives you've considered**
19+
1720
A clear and concise description of any alternative solutions or features you've considered.
1821

1922
**Additional context**
23+
2024
Add any other context or screenshots about the feature request here.

.github/workflows/lint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Lint
2+
on:
3+
pull_request
4+
jobs:
5+
Lint:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- name: Checkout codebase ⬇️
10+
uses: actions/checkout@v4
11+
- name: Setup PHP 🔧
12+
uses: shivammathur/setup-php@v2
13+
with:
14+
php-version: '8.2'
15+
tools: composer:v2
16+
- name: Install Dependencies 📦️
17+
run: composer install --no-interaction --prefer-dist --optimize-autoloader
18+
- name: Run Lint 🔍️
19+
run: composer run-script lint:validate

.github/workflows/testing.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Testing
2+
on:
3+
pull_request
4+
jobs:
5+
Testing:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- name: Checkout codebase ⬇️
10+
uses: actions/checkout@v4
11+
- name: Setup PHP 🔧
12+
uses: shivammathur/setup-php@v2
13+
with:
14+
php-version: '8.2'
15+
tools: composer:v2
16+
- name: Install Dependencies 📦️
17+
run: composer install --no-interaction --prefer-dist --optimize-autoloader
18+
- name: Run tests 🧪
19+
run: composer run-script test:unit

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
.idea/
2-
3-
composer.phar
4-
/vendor/
2+
vendor/
3+
.php-cs-fixer.cache

.php-cs-fixer.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
$finder = (new PhpCsFixer\Finder())
4+
->in(__DIR__);
5+
6+
return (new PhpCsFixer\Config())
7+
->setRules([
8+
'global_namespace_import' => [
9+
'import_classes' => true,
10+
'import_constants' => true,
11+
'import_functions' => true,
12+
],
13+
'no_superfluous_phpdoc_tags' => false,
14+
'trailing_comma_in_multiline' => false,
15+
'yoda_style' => false
16+
])
17+
->setFinder($finder);

CONTRIBUTING.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
## Pull Requests
44

5-
MongoDB Helpers follows [git flow](https://danielkummer.github.io/git-flow-cheatsheet/) rules when making branches,
6-
never ever make a branh off master, always build it off of develop.
5+
When a prll request is made, it must pass all quality checks.
76

87
## Coding Conventions
98

@@ -18,7 +17,6 @@ always use a bracket, skipping them will get denied in pull request, the bracket
1817
This is what I'll be looking for:
1918

2019
```php
21-
if (condition)
22-
{
20+
if (condition) {
2321
}
2422
```

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Eman Development & Design
3+
Copyright (c) 2024 Eman Development & Design
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# mongodb-helpers
2+
23
Helper Objects to make writing MongoDB apps easier.
34

45
## Helpers
@@ -47,7 +48,7 @@ class User implements Serializable, MongoModelInterface
4748
public $email;
4849
public $firstName;
4950
public $lastName;
50-
51+
5152
public function bsonSerialize() : array
5253
{
5354
return [

composer.json

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "eman-development-design/mongodb-helpers",
33
"description": "Helper Objects to make writing MongoDB apps easier.",
44
"keywords": ["helper", "mongodb", "mongo", "sorting", "model", "repository"],
5-
"homepage": "http://emandevelopmentdesign.com",
5+
"homepage": "https://emandevelopmentdesign.com",
66
"type": "library",
77
"license": "MIT",
88
"authors": [
@@ -14,13 +14,50 @@
1414
],
1515
"version": "1.0.5",
1616
"require": {
17-
"php": ">=7.2.0",
18-
"ext-mongodb": "^1.8.1",
19-
"mongodb/mongodb": "^1.8"
17+
"php": ">=8.2",
18+
"ext-json": "*",
19+
"ext-mongodb": "^1.17",
20+
"mongodb/mongodb": "^1.17"
21+
},
22+
"require-dev": {
23+
"friendsofphp/php-cs-fixer": "^v3.53",
24+
"phpstan/phpstan": "^1.10",
25+
"pestphp/pest": "^2.34",
26+
"pestphp/pest-plugin-type-coverage": "^2.8"
2027
},
2128
"autoload": {
2229
"psr-4": {
2330
"Edd\\MongoDbHelpers\\": "src/"
2431
}
32+
},
33+
"autoload-dev": {
34+
"psr-4": {
35+
"Tests\\": "tests/"
36+
}
37+
},
38+
"replace": {
39+
"symfony/polyfill-php80": "*",
40+
"symfony/polyfill-php81": "*"
41+
},
42+
"config": {
43+
"allow-plugins": {
44+
"pestphp/pest-plugin": true
45+
}
46+
},
47+
"scripts": {
48+
"lint:validate": "php-cs-fixer fix --dry-run --diff",
49+
"lint:fix": "php-cs-fixer fix",
50+
"quality:analysis": "phpstan analyse --no-progress --ansi --configuration=phpstan.neon --memory-limit 512M",
51+
"quality:profiler": "pest --profile",
52+
"test:coverage": "pest --coverage",
53+
"test:type:coverage": "pest --type-coverage --min=100",
54+
"test:unit": "pest"
55+
},
56+
"extra": {
57+
"pest": {
58+
"plugins": [
59+
"Pest\\TypeCoverage\\Plugin"
60+
]
61+
}
2562
}
26-
}
63+
}

0 commit comments

Comments
 (0)