diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cab9f5e..ad8944e 100755 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,9 +12,7 @@ If you have a good idea for improvement feel free to create a new issue with all ### Issues -Feel free to grab any open issue implement it and create a new pull request. Most issues can be found in the `Project.md` file in the `Docs` repository. - -The issue information can be used to provide additional information such as priority, difficulty and type. For your first issue try to find a issue marked `[d:first]` or `[d:beginner]`. +Feel free to grab any open issue implement it and create a new pull request. Most issues can be found in the code marked with `@todo` or in the [PROJECT.md](https://github.com/Orange-Management/Docs/blob/master/Project/PROJECT.md) file. ### Code Style diff --git a/Controller/ApiController.php b/Controller/ApiController.php index a750d32..0dd86ab 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -220,7 +220,7 @@ final class ApiController extends Controller */ private function createWikiCategoryL11nFromRequest(RequestAbstract $request) : WikiCategoryL11n { - $l11nWikiCategory = new WikiCategoryL11n(); + $l11nWikiCategory = new WikiCategoryL11n(); $l11nWikiCategory->category = (int) ($request->getData('category') ?? 0); $l11nWikiCategory->setLanguage((string) ( $request->getData('language') ?? $request->getLanguage() @@ -281,7 +281,7 @@ final class ApiController extends Controller */ private function updateDocFromRequest(RequestAbstract $request) : WikiDoc { - $doc = WikiDocMapper::get((int) $request->getData('id')); + $doc = WikiDocMapper::get((int) $request->getData('id')); $doc->name = (string) ($request->getData('title') ?? $doc->name); return $doc; @@ -567,7 +567,7 @@ final class ApiController extends Controller */ private function updateAppFromRequest(RequestAbstract $request) : WikiApp { - $app = WikiAppMapper::get((int) $request->getData('id')); + $app = WikiAppMapper::get((int) $request->getData('id')); $app->name = (string) ($request->getData('name') ?? $app->name); return $app; diff --git a/Models/WikiCategory.php b/Models/WikiCategory.php index a5a7180..16ce5a7 100755 --- a/Models/WikiCategory.php +++ b/Models/WikiCategory.php @@ -132,8 +132,8 @@ class WikiCategory implements \JsonSerializable public function toArray() : array { return [ - 'id' => $this->id, - 'app' => $this->app, + 'id' => $this->id, + 'app' => $this->app, 'virtualPath' => $this->virtualPath, ]; } diff --git a/Models/WikiCategoryMapper.php b/Models/WikiCategoryMapper.php index 0d4b14b..08ebea0 100755 --- a/Models/WikiCategoryMapper.php +++ b/Models/WikiCategoryMapper.php @@ -101,9 +101,9 @@ final class WikiCategoryMapper extends DataMapperAbstract /** * Get by parent. * - * @param int $value Parent value id - * @param int $app App - * @param int $depth Relation depth + * @param int $value Parent value id + * @param int $app App + * @param int $depth Relation depth * * @return array * diff --git a/Models/WikiDoc.php b/Models/WikiDoc.php index 583dfd8..9cef780 100755 --- a/Models/WikiDoc.php +++ b/Models/WikiDoc.php @@ -18,7 +18,6 @@ use Modules\Media\Models\Media; use Modules\Tag\Models\Tag; use phpOMS\Localization\ISO639x1Enum; - /** * Wiki document class. * @@ -233,15 +232,15 @@ class WikiDoc implements \JsonSerializable public function toArray() : array { return [ - 'id' => $this->id, - 'app' => $this->app, - 'name' => $this->name, - 'status' => $this->status, - 'doc' => $this->doc, - 'docRaw' => $this->docRaw, + 'id' => $this->id, + 'app' => $this->app, + 'name' => $this->name, + 'status' => $this->status, + 'doc' => $this->doc, + 'docRaw' => $this->docRaw, 'language' => $this->language, - 'tags' => $this->tags, - 'media' => $this->media, + 'tags' => $this->tags, + 'media' => $this->media, ]; } diff --git a/tests/Models/WikiAppMapperTest.php b/tests/Models/WikiAppMapperTest.php index 0610b5f..f5ba69e 100755 --- a/tests/Models/WikiAppMapperTest.php +++ b/tests/Models/WikiAppMapperTest.php @@ -16,7 +16,6 @@ namespace Modules\Knowledgebase\tests\Models; use Modules\Knowledgebase\Models\WikiApp; use Modules\Knowledgebase\Models\WikiAppMapper; -use phpOMS\Utils\RnG\Text; /** * @testdox Modules\tests\Knowledgebase\Models\WikiAppMapperTest: Wiki application mapper diff --git a/tests/Models/WikiAppTest.php b/tests/Models/WikiAppTest.php index 0bdc9ce..5f7a979 100755 --- a/tests/Models/WikiAppTest.php +++ b/tests/Models/WikiAppTest.php @@ -67,7 +67,7 @@ final class WikiAppTest extends \PHPUnit\Framework\TestCase self::assertEquals( [ - 'id' => 0, + 'id' => 0, 'name' => 'Title', ], $serialized diff --git a/tests/Models/WikiCategoryL11nTest.php b/tests/Models/WikiCategoryL11nTest.php index 2225218..3b889a4 100644 --- a/tests/Models/WikiCategoryL11nTest.php +++ b/tests/Models/WikiCategoryL11nTest.php @@ -70,16 +70,16 @@ final class WikiCategoryL11nTest extends \PHPUnit\Framework\TestCase */ public function testSerialize() : void { - $this->l11n->name = 'Title'; + $this->l11n->name = 'Title'; $this->l11n->category = 2; $this->l11n->setLanguage(ISO639x1Enum::_DE); self::assertEquals( [ - 'id' => 0, - 'name' => 'Title', + 'id' => 0, + 'name' => 'Title', 'category' => 2, - 'language' => ISO639x1Enum::_DE, + 'language' => ISO639x1Enum::_DE, ], $this->l11n->jsonSerialize() ); diff --git a/tests/Models/WikiCategoryMapperTest.php b/tests/Models/WikiCategoryMapperTest.php index 7fc22df..6dea428 100755 --- a/tests/Models/WikiCategoryMapperTest.php +++ b/tests/Models/WikiCategoryMapperTest.php @@ -14,10 +14,10 @@ declare(strict_types=1); namespace Modules\Knowledgebase\tests\Models; +use Modules\Knowledgebase\Models\NullWikiApp; use Modules\Knowledgebase\Models\NullWikiCategory; use Modules\Knowledgebase\Models\WikiCategory; use Modules\Knowledgebase\Models\WikiCategoryMapper; -use phpOMS\Utils\RnG\Text; /** * @testdox Modules\tests\Knowledgebase\Models\WikiCategoryMapperTest: Wiki category mapper @@ -62,6 +62,7 @@ final class WikiCategoryMapperTest extends \PHPUnit\Framework\TestCase */ public function testChildCR() : void { + $this->category->app = new NullWikiApp(1); $this->category->setL11n('Test Category2'); $this->category->parent = new NullWikiCategory(1); diff --git a/tests/Models/WikiCategoryTest.php b/tests/Models/WikiCategoryTest.php index 5e11fb0..fdf7bb5 100755 --- a/tests/Models/WikiCategoryTest.php +++ b/tests/Models/WikiCategoryTest.php @@ -103,15 +103,15 @@ final class WikiCategoryTest extends \PHPUnit\Framework\TestCase */ public function testSerialize() : void { - $this->category->app = new NullWikiApp(1); + $this->category->app = new NullWikiApp(1); $this->category->virtualPath = '/test/path'; $serialized = $this->category->jsonSerialize(); self::assertEquals( [ - 'id' => 0, - 'app' => $this->category->app, + 'id' => 0, + 'app' => $this->category->app, 'virtualPath' => '/test/path', ], $serialized diff --git a/tests/Models/WikiDocMapperTest.php b/tests/Models/WikiDocMapperTest.php index debe47d..73d3638 100755 --- a/tests/Models/WikiDocMapperTest.php +++ b/tests/Models/WikiDocMapperTest.php @@ -18,7 +18,6 @@ use Modules\Knowledgebase\Models\NullWikiCategory; use Modules\Knowledgebase\Models\WikiDoc; use Modules\Knowledgebase\Models\WikiDocMapper; use Modules\Knowledgebase\Models\WikiStatus; -use phpOMS\Utils\RnG\Text; /** * @testdox Modules\tests\Knowledgebase\Models\WikiDocMapperTest: Wiki document mapper diff --git a/tests/Models/WikiDocTest.php b/tests/Models/WikiDocTest.php index cadde23..4cd1699 100755 --- a/tests/Models/WikiDocTest.php +++ b/tests/Models/WikiDocTest.php @@ -18,8 +18,8 @@ use Modules\Knowledgebase\Models\NullWikiApp; use Modules\Knowledgebase\Models\NullWikiCategory; use Modules\Knowledgebase\Models\WikiDoc; use Modules\Knowledgebase\Models\WikiStatus; -use Modules\Tag\Models\NullTag; use Modules\Media\Models\Media; +use Modules\Tag\Models\NullTag; use phpOMS\Localization\ISO639x1Enum; /** @@ -161,25 +161,25 @@ final class WikiDocTest extends \PHPUnit\Framework\TestCase */ public function testSerialize() : void { - $this->doc->app = new NullWikiApp(1); + $this->doc->app = new NullWikiApp(1); $this->doc->name = '/test/path'; $this->doc->setStatus(WikiStatus::DRAFT); - $this->doc->doc = 'TestDoc'; + $this->doc->doc = 'TestDoc'; $this->doc->docRaw = 'TestDocRaw'; $serialized = $this->doc->jsonSerialize(); self::assertEquals( [ - 'id' => 0, - 'app' => $this->doc->app, + 'id' => 0, + 'app' => $this->doc->app, 'name' => '/test/path', - 'status' => WikiStatus::DRAFT, - 'doc' => 'TestDoc', - 'docRaw' => 'TestDocRaw', - 'language' => ISO639x1Enum::_EN, - 'tags' => [], - 'media' => [], + 'status' => WikiStatus::DRAFT, + 'doc' => 'TestDoc', + 'docRaw' => 'TestDocRaw', + 'language' => ISO639x1Enum::_EN, + 'tags' => [], + 'media' => [], ], $serialized );