Skip to content

Commit

Permalink
Merge pull request #3 from phalcon/1.x
Browse files Browse the repository at this point in the history
1.0 Release
  • Loading branch information
niden authored Oct 28, 2021
2 parents c67e073 + b755cda commit 00cf986
Show file tree
Hide file tree
Showing 83 changed files with 9,989 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .cz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[tool.commitizen]
name = "cz_conventional_commits"
version = "1.0.0"
tag_format = "$major.$minor.$patch$prerelease"
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]: "
labels: 'bug, status: unverified'
assignees: ''

---

Questions? Forum: https://phalcon.io/forum or Discord: https://phalcon.io/discord

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**

Steps to reproduce the behavior:

```php
// paste output here
```

> Provide minimal script to reproduce the issue
```php
// paste output here
```

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

```php
// paste code
```

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

**Details**
- Phalcon version
- PHP Version: (`php -v`)
- Operating System:
- Server: Nginx | Apache | Other
- Other related info (Database, table schema):

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[NFR]: "
labels: new feature request
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I am 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.
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Hello!

* Type: bug fix | new feature | code quality | documentation

**In raising this pull request, I confirm the following:**

- [ ] I have read and understood the [Contributing Guidelines](https://github.com/phalcon/traits/blob/master/CONTRIBUTING.md)
- [ ] I have checked that another pull request for this purpose does not exist
- [ ] I wrote some tests for this PR
- [ ] I have updated the relevant CHANGELOG
- [ ] I have created a PR for the [documentation](https://github.com/phalcon/docs) about this change

Small description of change:

Thanks
57 changes: 57 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Configuration for probot-stale - https://github.com/probot/stale

# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 90

# Number of days of inactivity before a stale Issue or Pull Request is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 1

# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- "status: high"
- "status: medium"
- "status: low"
- "bug"
- "wip"
- Locked
- "new feature request"
- "enhancement"

# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false

# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: true

# Label to use when marking as stale
staleLabel: stale

# Comment to post when marking as stale. Set to `false` to disable
markComment: >
Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalcon.io/post/github-closing-old-issues
# Comment to post when removing the stale label.
# unmarkComment: >
# Your comment here.

# Comment to post when closing a stale Issue or Pull Request.
#closeComment: >
# Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalcon.io/post/github-closing-old-issues

# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 30

# Limit to only `issues` or `pulls`
only: issues

# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
# pulls:
# daysUntilStale: 30
# markComment: >
# This pull request has been automatically marked as stale because it has not had
# recent activity. It will be closed if no further activity occurs. Thank you
# for your contributions!

# issues:
# exemptLabels:
# - confirmed
139 changes: 139 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: Phalcon CI

on:
schedule:
- cron: '0 2 * * *' # Daily at 02:00 runs only on default branch
push:
paths-ignore:
- '**.md'
- '**.txt'
pull_request:

env:
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
LC_ALL: en_US.UTF-8

jobs:
phpcs:
name: Validate Tests code style
if: "!contains(github.event.head_commit.message, 'ci skip')"

runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: Run PHP_CodeSniffer
run: docker run --rm -v $(pwd):/data cytopia/phpcs --standard=./phpcs.xml

# stubs:
# name: PHP ${{ matrix.php-versions }} Stubs validation
# if: "!contains(github.event.head_commit.message, 'ci skip')"
#
# runs-on: ubuntu-20.04
#
# strategy:
# fail-fast: false
# matrix:
# php-versions: ['7.4', '8.0']
#
# steps:
# - uses: actions/checkout@v2
#
# - name: Validate stubs
# if: always()
# run: vendor/bin/psalm ide/
#
generate:
name: Setup Environments
# To prevent build a particular commit use
# git commit -m "......... [ci skip]"
if: "!contains(github.event.head_commit.message, 'ci skip')"

runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: mbstring, intl, json, psr
tools: pecl
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup APT Repositories
run: |
# We don't need this at all, and our
# builds often fails because Microsoft
# servers are unstable or even offline.
sudo rm -f /etc/apt/sources.list.d/dotnetdev.list
sudo rm -f /etc/apt/sources.list.d/azure*.list
- name: Install System Dependencies
run: |
sudo apt-get update --quiet --yes 1>/dev/null
build-and-test-linux:
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
# To prevent build a particular commit use
# git commit -m "......... [ci skip]"
# git commit -m "......... [linux skip] - to skip only linux builds"
if: "!contains(github.event.head_commit.message, '[linux skip]') || !contains(github.event.head_commit.message, 'ci skip')"

needs: [generate]
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-20.04]
php-versions: ['7.4', '8.0']

steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Validate composer
run: composer validate --no-check-all --no-check-publish

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Setup Composer Cache
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, json, yaml
ini-values: apc.enable_cli=on, session.save_path=/tmp
tools: pecl
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install Composer Packages
run: composer install --prefer-dist

- name: Setup Tests
run: |
cp config/.env.example .env
vendor/bin/codecept build
- name: Run Unit Tests
if: always()
run: vendor/bin/codecept run --coverage-xml=coverage-unit-${{ matrix.php-versions }}.xml --ext DotReporter unit

- name: Upload Code Coverage on ${{ matrix.php-versions }} for unit
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./tests/_output/
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.env
.php_cs.cache
tests/_output/
tests/_support/_generated/
vendor/
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## 1.0.0 (2021-10-27)

### Fix

- **php**: added stricter types to php based traits
- **helper/php/filetrait**: corrected the namespace

### Feat

- **helper/str/dirseparator**: added dirSeparatorTrait and relevant tests
- **helper/str/dirfromfile**: added dirFromFile trait and tests
- **php/infotrait**: added infotrait and relevant tests
- **php/jsontrait**: added json trait and relevant tests
- **php/filetrait**: added file trait and relevant tests with testing assets
- **helper/str/interpolate**: added interpolate trait and relevant tests
- **helper/str/upper**: added upper trait and relevant tests
- **helper/str/lower**: added lower trait and relevant tests
- **helper/str/startswith**: added startsWith trait and relevant tests
- **helper/str/endswith**: added endsWith trait and relevant tests
- **helper/arr/filter**: added filter trait and relevant tests
- **factory/factory**: added factory trait
25 changes: 25 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Contributor Covenant Code of Conduct

## TL;DR

Common sense rules. Treat people the same way you want to be treated.

## Detail

This is an open source project. Everyone and anyone is welcome to contribute
to it as much or as little as they want to.

Personal views of contributors have no effect on the project and should be
kept in the personal realm not this project.

It is a requirement to treat other contributors as well as maintainers with
respect, when communicating in the realm of this project. It is OK to agree to
disagree.

## Conflict

If ever conflict arises, please bring it to the attention of the maintainers
privately. You can always find us on our [Discord](https://phalcon.io/discord)
server or you can send us an email at [team@phalcon.io](mailto:team@phalcon.io)

The core team maintains the final decision on any conflict that may arise.
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Contributing to Phalcon Traits

WIP

Phalcon Team
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020-present The Phalcon PHP Framework

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Phalcon Traits

This package contains traits with methods that are used for Phalcon v6 onward.

It can also be useful to others that want short snippets of code that perform
a task, without having to reinvent the wheel.

Some of these methods are just wrappers to PHP functions, thus allowing developers
to mock the method in order to get different results and cover paths of the
application with relevant tests.

[![PDS Skeleton](https://img.shields.io/badge/pds-skeleton-blue.svg?style=flat-square)](https://github.com/php-pds/skeleton)
[![codecov](https://codecov.io/gh/phalcon/traits/branch/1.x/graph/badge.svg?token=I4bgs0E168)](https://codecov.io/gh/phalcon/traits)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

[Documentation](docs/general.md)
Empty file added bin/.gitkeep
Empty file.
Loading

0 comments on commit 00cf986

Please sign in to comment.