Skip to content

Update code #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,33 @@ about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Version**

What version do you have installed?

**PHP Version**

What version of PHP are you using?

**Describe the bug**

A clear and concise description of what the bug is.

**To Reproduce**

Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
A clear and concise description of what you expected to happen.

**Additional context**

Add any other context about the problem here.
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ assignees: ''
---

**Is your feature request related to a problem? Please describe.**

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**

A clear and concise description of what you want to happen.

**Describe alternatives you've considered**

A clear and concise description of any alternative solutions or features you've considered.

**Additional context**

Add any other context or screenshots about the feature request here.
19 changes: 19 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Lint
on:
pull_request
jobs:
Lint:
runs-on: ubuntu-latest

steps:
- name: Checkout codebase ⬇️
uses: actions/checkout@v4
- name: Setup PHP 🔧
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer:v2
- name: Install Dependencies 📦️
run: composer install --no-interaction --prefer-dist --optimize-autoloader
- name: Run Lint 🔍️
run: composer run-script lint:validate
19 changes: 19 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Testing
on:
pull_request
jobs:
Testing:
runs-on: ubuntu-latest

steps:
- name: Checkout codebase ⬇️
uses: actions/checkout@v4
- name: Setup PHP 🔧
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer:v2
- name: Install Dependencies 📦️
run: composer install --no-interaction --prefer-dist --optimize-autoloader
- name: Run tests 🧪
run: composer run-script test:unit
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.idea/

composer.phar
/vendor/
vendor/
.php-cs-fixer.cache
17 changes: 17 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

$finder = (new PhpCsFixer\Finder())
->in(__DIR__);

return (new PhpCsFixer\Config())
->setRules([
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
'import_functions' => true,
],
'no_superfluous_phpdoc_tags' => false,
'trailing_comma_in_multiline' => false,
'yoda_style' => false
])
->setFinder($finder);
6 changes: 2 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

## Pull Requests

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

## Coding Conventions

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

```php
if (condition)
{
if (condition) {
}
```
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Eman Development & Design
Copyright (c) 2024 Eman Development & Design

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# mongodb-helpers

Helper Objects to make writing MongoDB apps easier.

## Helpers
Expand Down Expand Up @@ -47,7 +48,7 @@ class User implements Serializable, MongoModelInterface
public $email;
public $firstName;
public $lastName;

public function bsonSerialize() : array
{
return [
Expand Down
47 changes: 42 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "eman-development-design/mongodb-helpers",
"description": "Helper Objects to make writing MongoDB apps easier.",
"keywords": ["helper", "mongodb", "mongo", "sorting", "model", "repository"],
"homepage": "http://emandevelopmentdesign.com",
"homepage": "https://emandevelopmentdesign.com",
"type": "library",
"license": "MIT",
"authors": [
Expand All @@ -14,13 +14,50 @@
],
"version": "1.0.5",
"require": {
"php": ">=7.2.0",
"ext-mongodb": "^1.8.1",
"mongodb/mongodb": "^1.8"
"php": ">=8.2",
"ext-json": "*",
"ext-mongodb": "^1.17",
"mongodb/mongodb": "^1.17"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^v3.53",
"phpstan/phpstan": "^1.10",
"pestphp/pest": "^2.34",
"pestphp/pest-plugin-type-coverage": "^2.8"
},
"autoload": {
"psr-4": {
"Edd\\MongoDbHelpers\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"replace": {
"symfony/polyfill-php80": "*",
"symfony/polyfill-php81": "*"
},
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"scripts": {
"lint:validate": "php-cs-fixer fix --dry-run --diff",
"lint:fix": "php-cs-fixer fix",
"quality:analysis": "phpstan analyse --no-progress --ansi --configuration=phpstan.neon --memory-limit 512M",
"quality:profiler": "pest --profile",
"test:coverage": "pest --coverage",
"test:type:coverage": "pest --type-coverage --min=100",
"test:unit": "pest"
},
"extra": {
"pest": {
"plugins": [
"Pest\\TypeCoverage\\Plugin"
]
}
}
}
}
Loading