Skip to content

Commit

Permalink
Merge branch 'feature/slick-module' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
silvamfilipe committed Jul 10, 2024
2 parents 48eba20 + af6fa68 commit eda06d1
Show file tree
Hide file tree
Showing 179 changed files with 7,935 additions and 11,484 deletions.
10 changes: 8 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
# Ignore all test and documentation with "export-ignore".
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/.scrutinizer.yml export-ignore
/tests export-ignore
/features export-ignore
/features export-ignore
/docker-compose.yml export-ignore
/phpunit.xml export-ignore
/phpstan.neon.dist export-ignore
/CONTRIBUTING.md export-ignore
/docker export-ignore
/build export-ignore
/.github export-ignore
50 changes: 50 additions & 0 deletions .github/workflows/continuous-integration.yml
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"
3 changes: 2 additions & 1 deletion .gitignore
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
30 changes: 11 additions & 19 deletions .scrutinizer.yml
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
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

27 changes: 24 additions & 3 deletions CHANGELOG.md
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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Remember that this is a bundle from the Slick framework library.
## Running Tests

``` bash
$ vendor/bin/phpunit
$ composer test
```


Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Slick Team
Copyright (c) 2014-2024 The Slick Team <https://github.com/orgs/slickframework/people>

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
71 changes: 5 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand All @@ -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

Expand Down
9 changes: 0 additions & 9 deletions behat.yml

This file was deleted.

4 changes: 3 additions & 1 deletion build/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*
*
!phpmd.xml
!phpstan-bootstrap.php
54 changes: 54 additions & 0 deletions build/phpmd.xml
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>
3 changes: 3 additions & 0 deletions build/phpstan-bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

define('APP_ROOT', dirname(__DIR__));
Loading

0 comments on commit eda06d1

Please sign in to comment.