From 09b3ba78e086f4e9eead701c841b00bdcd30a07f Mon Sep 17 00:00:00 2001 From: Tony NGUEREZA Date: Sat, 2 Dec 2023 12:28:38 +0100 Subject: [PATCH] Update README and fix code style --- README.MD | 11 +++++------ composer.json | 2 -- src/Entity.php | 2 +- src/Mapper/DataMapper.php | 2 +- src/Relation/ShareRelation.php | 2 +- src/Repository.php | 4 ++-- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/README.MD b/README.MD index 66d75d8..cee4f27 100644 --- a/README.MD +++ b/README.MD @@ -5,11 +5,10 @@ [![Latest Stable Version](https://poser.pugx.org/platine-php/orm/v)](https://packagist.org/packages/platine-php/orm) [![Latest Unstable Version](https://poser.pugx.org/platine-php/orm/v/unstable)](https://packagist.org/packages/platine-php/orm) [![Total Downloads](https://poser.pugx.org/platine-php/orm/downloads)](https://packagist.org/packages/platine-php/orm) -[![License](https://poser.pugx.org/platine-php/orm/license)](https://packagist.org/packages/platine-php/orm) -[![Build Status](https://img.shields.io/travis/com/platine-php/orm?style=flat-square)](https://travis-ci.com/platine-php/orm) +[![License](https://poser.pugx.org/platine-php/orm/license)](https://packagist.org/packages/platine-php/orm) [![Quality Score](https://img.shields.io/scrutinizer/g/platine-php/orm.svg?style=flat-square)](https://scrutinizer-ci.com/g/platine-php/orm) -[![Maintainability](https://api.codeclimate.com/v1/badges/5722b474126d86d58e57/maintainability)](https://codeclimate.com/github/platine-php/orm/maintainability) -[![Test Coverage](https://api.codeclimate.com/v1/badges/5722b474126d86d58e57/test_coverage)](https://codeclimate.com/github/platine-php/orm/test_coverage) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/852e352455644c8abd8209f2036eaab2)](https://app.codacy.com/gh/platine-php/orm/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) +[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/852e352455644c8abd8209f2036eaab2)](https://app.codacy.com/gh/platine-php/orm/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage) ### Requirements - **PHP >= 7.4**, **PHP 8** @@ -23,8 +22,8 @@ composer require platine-php/orm ### License MIT License See [LICENSE.MD](LICENSE.MD) -### Documentation -Coming soon, be patient +### Resources +- [Documentation](https://docs.platine-php.com/packages/orm) ### Change make to opis/orm version 1.0.x-dev **Platine ORM** get inspiration from **opis/orm**. diff --git a/composer.json b/composer.json index c9c96b0..734b40e 100644 --- a/composer.json +++ b/composer.json @@ -48,8 +48,6 @@ "sort-packages": true }, - - "scripts": { "test": "phpunit --colors=always", "static": "phpstan analyze", diff --git a/src/Entity.php b/src/Entity.php index 3d37813..4f9cb21 100644 --- a/src/Entity.php +++ b/src/Entity.php @@ -110,7 +110,7 @@ public function jsonSerialize() foreach ($rawColumns as $name => $value) { if ($this->mapper()->hasRelation($name)) { $relation = $this->mapper()->getRelated($name); - if($relation instanceof self){ + if ($relation instanceof self) { $data[$name] = $relation->jsonSerialize(); } else { $data[$name] = $relation; diff --git a/src/Mapper/DataMapper.php b/src/Mapper/DataMapper.php index fd39b1e..4abb555 100644 --- a/src/Mapper/DataMapper.php +++ b/src/Mapper/DataMapper.php @@ -85,7 +85,7 @@ class DataMapper implements DataMapperInterface * @var array> */ protected array $loaders = []; - + /** * The Entity manager instance * @var EntityManager diff --git a/src/Relation/ShareRelation.php b/src/Relation/ShareRelation.php index 2b6629e..c8bb0e8 100644 --- a/src/Relation/ShareRelation.php +++ b/src/Relation/ShareRelation.php @@ -217,7 +217,7 @@ public function getLoader(EntityManager $manager, EntityMapper $owner, array $op } $queryStatement = new QueryStatement(); - + $select = new class ($manager, $related, $queryStatement, $junctionTable) extends EntityQuery { /** diff --git a/src/Repository.php b/src/Repository.php index 074a7dc..dd805f6 100644 --- a/src/Repository.php +++ b/src/Repository.php @@ -474,8 +474,8 @@ public function delete(Entity $entity, bool $force = false): bool return true; } - - /** + + /** * Set the filters * @param EntityQuery $query * @return $this