-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/slick-module' into develop
- Loading branch information
Showing
179 changed files
with
7,935 additions
and
11,484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: "Continuous Integration" | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
env: | ||
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist" | ||
|
||
jobs: | ||
tests: | ||
name: "CI" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php-version: | ||
- "8.2" | ||
- "8.3" | ||
dependencies: [ highest ] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
name: "Checkout" | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
coverage: "xdebug" | ||
php-version: "${{ matrix.php-version }}" | ||
extensions: json | ||
|
||
- name: Get composer cache directory | ||
id: composercache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composercache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: "Install latest dependencies" | ||
run: | | ||
composer update ${{ env.COMPOSER_FLAGS }} | ||
- name: "Run tests" | ||
run: "composer test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
composer.phar | ||
/vendor/ | ||
.idea | ||
|
||
docker-compose.override.yml | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,15 @@ | ||
filter: | ||
excluded_paths: [tests/*, features/*] | ||
excluded_paths: [features/*, tests/*] | ||
|
||
checks: | ||
php: | ||
remove_extra_empty_lines: true | ||
remove_php_closing_tag: true | ||
remove_trailing_whitespace: true | ||
fix_use_statements: | ||
remove_unused: true | ||
preserve_multiple: false | ||
preserve_blanklines: true | ||
order_alphabetically: true | ||
fix_php_opening_tag: true | ||
fix_linefeed: true | ||
fix_line_ending: true | ||
fix_identation_4spaces: true | ||
fix_doc_comments: true | ||
php: true | ||
|
||
tools: | ||
external_code_coverage: | ||
timeout: 600 | ||
runs: 2 | ||
build: | ||
image: default-jammy | ||
environment: | ||
php: 8.2.15 | ||
nodes: | ||
analysis: | ||
tests: | ||
override: | ||
- php-scrutinizer-ru |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,30 @@ | ||
# Changelog | ||
|
||
All Notable changes to `Slick/orm` will be documented in this file. | ||
All notable changes to this project will be documented in this file. | ||
|
||
## 1.2.0 - 2016-03-31 | ||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
### Added | ||
- Doctrine DBAL driver middleware to log database operations with duration | ||
- `EntityCollection`, `EntityManagerFactory` to manages ORM and DBAL access to databases | ||
- `doctrine/orm` and `doctrine/migrations` console commands | ||
- `doctrine/orm` and `doctrine/migrations` integration module on `slick/webstack` | ||
- Code quality tools: `phpstan` `phpmd` | ||
|
||
### Changed | ||
- Converted to a slick v2.* module | ||
|
||
### Removed | ||
- PHP <= 8.1 support | ||
- All API from slick <= v1.2 | ||
|
||
## [v1.2.0] - 2016-03-31 | ||
### Added | ||
- Completely remake for Slick v1.2.0. | ||
- First released stand alone ORM package for Slick framework. | ||
- First released stand alone ORM package for Slick framework. | ||
|
||
[Unreleased]: https://github.com/slickframework/orm/compare/v1.2.0...HEAD | ||
[v1.2.0]: https://github.com/slickframework/orm/compare/724593...v1.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,16 +2,13 @@ | |
|
||
[![Latest Version](https://img.shields.io/github/release/slickframework/orm.svg?style=flat-square)](https://github.com/slickframework/orm/releases) | ||
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) | ||
[![Build Status](https://img.shields.io/travis/slickframework/orm/master.svg?style=flat-square)](https://travis-ci.org/slickframework/orm) | ||
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/slickframework/orm/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/slickframework/orm/code-structure?branch=master) | ||
[![Build Status](https://img.shields.io/github/actions/workflow/status/slickframework/orm/continuous-integration.yml?style=flat-square)](https://github.com/slickframework/orm/actions/workflows/continuous-integration.yml) | ||
[![Quality Score](https://img.shields.io/scrutinizer/g/slickframework/orm/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/slickframework/orm?branch=master) | ||
[![Total Downloads](https://img.shields.io/packagist/dt/slick/orm.svg?style=flat-square)](https://packagist.org/packages/slick/orm) | ||
|
||
|
||
`Slick\Orm` is a simple, lightweight, ORM (object-relational mapping) library that | ||
can help you with the task of mapping you domain entities with your database. | ||
It uses simple annotations on entity classes to determine how data is mapped | ||
when you select and/or update it. It also supports relations between entities. | ||
`Slick\Orm` This module offers Migrations, Database Abstraction (DBA), and Object-Relational Mapping (ORM) | ||
features utilizing the doctrine/migrations and doctrine/orm packages. | ||
|
||
This package is compliant with PSR-2 code standards and PSR-4 autoload standards. | ||
It also applies the semantic version 2.0.0 specification. | ||
|
@@ -25,65 +22,7 @@ $ composer require slick/orm | |
``` | ||
|
||
## Usage | ||
|
||
### Create an entity; | ||
|
||
Entities are classes that most of the time had only properties and annotations | ||
and you need to define them before you can actually use them. | ||
|
||
So lets create a simple `Post` entity: | ||
|
||
```php | ||
|
||
namespace Domain; | ||
|
||
use Slick\Orm\Annotations as Orm; | ||
use Slick\Orm\Entity; | ||
use Slick\Orm\EntityInterface; | ||
|
||
class Post extends Entity | ||
{ | ||
/** | ||
* @readwrite | ||
* @Orm\Column type=integer, primaryKey, autoIncrement | ||
* @var integer | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* @readwrite | ||
* @Orm\Column type=text | ||
* @var string | ||
*/ | ||
protected $title; | ||
|
||
/** | ||
* @readwrite | ||
* @Orm\Column type=text | ||
* @var string | ||
*/ | ||
protected $body; | ||
|
||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
public function setId($entityId) | ||
{ | ||
$this->id = $entityId; | ||
return $this; | ||
} | ||
} | ||
``` | ||
|
||
Now with our entity defined lets crate a post: | ||
```php | ||
use Domain\Post; | ||
|
||
$post = new Post(['title' => 'My blog post title', 'body' => 'This is really long...']); | ||
$post->save(); // Persists data in database | ||
``` | ||
Please read `slick/orm` documentation at []https://www.slick-framework.com/modules/orm) | ||
|
||
## Testing | ||
|
||
|
@@ -102,7 +41,7 @@ If you discover any security related issues, please email [email protected] | |
## Credits | ||
|
||
- [Slick framework](https://github.com/slickframework) | ||
- [All Contributors](https://github.com/slickframework/common/graphs/contributors) | ||
- [All Contributors](https://github.com/slickframework/orm/graphs/contributors) | ||
|
||
## License | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
* | ||
* | ||
!phpmd.xml | ||
!phpstan-bootstrap.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="Rule set for TrackMyTime project" | ||
xmlns="http://pmd.sf.net/ruleset/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | ||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> | ||
<description>This is a PHPMD ruleset to support Track My Time project development with php.</description> | ||
<rule ref="rulesets/cleancode.xml/BooleanArgumentFlag" /> | ||
<rule ref="rulesets/cleancode.xml/ElseExpression" /> | ||
<rule ref="rulesets/cleancode.xml/StaticAccess"> | ||
<properties> | ||
<property name="exceptions" value="Firebase\JWT\JWT,TrackMyTime\MoneyTrackr\Infrastructure\Filesystem\FilesystemTools" /> | ||
<property name="ignorepattern" value="/^(create(\w*)|from|isValid|instance)/i" /> | ||
</properties> | ||
|
||
</rule> | ||
<rule ref="rulesets/codesize.xml/CyclomaticComplexity" /> | ||
<rule ref="rulesets/codesize.xml/NPathComplexity" /> | ||
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength" /> | ||
<rule ref="rulesets/codesize.xml/ExcessiveClassLength" /> | ||
<rule ref="rulesets/codesize.xml/ExcessiveParameterList" /> | ||
<rule ref="rulesets/codesize.xml/ExcessivePublicCount" /> | ||
<rule ref="rulesets/codesize.xml/TooManyFields" /> | ||
<rule ref="rulesets/codesize.xml/TooManyMethods" /> | ||
<rule ref="rulesets/codesize.xml/TooManyPublicMethods" /> | ||
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity" /> | ||
<rule ref="rulesets/controversial.xml/Superglobals" /> | ||
<rule ref="rulesets/controversial.xml/CamelCaseClassName" /> | ||
<rule ref="rulesets/controversial.xml/CamelCasePropertyName" /> | ||
<rule ref="rulesets/controversial.xml/CamelCaseMethodName" /> | ||
<rule ref="rulesets/controversial.xml/CamelCaseParameterName" /> | ||
<rule ref="rulesets/controversial.xml/CamelCaseVariableName" /> | ||
<rule ref="rulesets/design.xml/ExitExpression" /> | ||
<rule ref="rulesets/design.xml/EvalExpression" /> | ||
<rule ref="rulesets/design.xml/GotoStatement" /> | ||
<rule ref="rulesets/design.xml/NumberOfChildren" /> | ||
<rule ref="rulesets/design.xml/DepthOfInheritance" /> | ||
<rule ref="rulesets/design.xml/CouplingBetweenObjects"> | ||
<properties> | ||
<property name="maximum" value="13" /> | ||
</properties> | ||
</rule> | ||
<rule ref="rulesets/design.xml/DevelopmentCodeFragment" /> | ||
<rule ref="rulesets/naming.xml/ShortVariable" /> | ||
<rule ref="rulesets/naming.xml/LongVariable" /> | ||
<rule ref="rulesets/naming.xml/ShortMethodName" /> | ||
<rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass" /> | ||
<rule ref="rulesets/naming.xml/ConstantNamingConventions" /> | ||
<rule ref="rulesets/naming.xml/BooleanGetMethodName" /> | ||
<rule ref="rulesets/unusedcode.xml/UnusedPrivateField" /> | ||
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable" /> | ||
<rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod" /> | ||
<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter" /> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
define('APP_ROOT', dirname(__DIR__)); |
Oops, something went wrong.