Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Base field type #191

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

[WIP] Base field type #191

wants to merge 9 commits into from

Conversation

kore
Copy link

@kore kore commented Jul 10, 2017

Prototype with base field type, can be cleaned up & moved to correct / own repo at later point if this can be used for anything.

@ezrobot
Copy link
Contributor

ezrobot commented Jul 10, 2017

Tool version : PHP CS Fixer 2.1.2 by Fabien Potencier and Dariusz Ruminski
Command executed php-cs-fixer --dry-run -v fix
This Pull Request does not respect PSR-2 Coding Standards, please, see the suggested diff below:

diff --git a/src/Kore/RatingFieldTypeBundle/DependencyInjection/KoreRatingFieldTypeExtension.php b/src/Kore/RatingFieldTypeBundle/DependencyInjection/KoreRatingFieldTypeExtension.php
index a6c7be9..d281063 100644
--- a/src/Kore/RatingFieldTypeBundle/DependencyInjection/KoreRatingFieldTypeExtension.php
+++ b/src/Kore/RatingFieldTypeBundle/DependencyInjection/KoreRatingFieldTypeExtension.php
@@ -30,7 +30,7 @@ class KoreRatingFieldTypeExtension extends Extension implements PrependExtension
         $configuration = new Configuration();
         $config = $this->processConfiguration($configuration, $configs);
 
-        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
+        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
         $loader->load('services.xml');
     }
 }
diff --git a/src/Kore/RatingFieldTypeBundle/Storage/FieldType/Type.php b/src/Kore/RatingFieldTypeBundle/Storage/FieldType/Type.php
index cd8be21..b74066a 100644
--- a/src/Kore/RatingFieldTypeBundle/Storage/FieldType/Type.php
+++ b/src/Kore/RatingFieldTypeBundle/Storage/FieldType/Type.php
@@ -3,7 +3,6 @@
 namespace Kore\RatingFieldTypeBundle\Storage\FieldType;
 
 use eZ\Publish\Core\FieldType\FieldType;
-use eZ\Publish\API\Repository\Values\ContentType\FieldDefinition;
 use eZ\Publish\SPI\FieldType\Value as SPIValue;
 use eZ\Publish\Core\FieldType\Value as CoreValue;
 use eZ\Publish\SPI\Persistence\Content\FieldValue;
@@ -51,7 +50,7 @@ class Type extends FieldType
      *
      * @param mixed $inputValue
      *
-     * @return mixed The potentially converted input value.
+     * @return mixed the potentially converted input value
      */
     protected function createValueFromInput($inputValue)
     {
@@ -84,7 +83,7 @@ class Type extends FieldType
      *  }
      * </code>
      *
-     * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException If the value does not match the expected structure.
+     * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if the value does not match the expected structure
      *
      * @param \eZ\Publish\Core\FieldType\Value $value
      */
diff --git a/src/Kore/RatingFieldTypeBundle/Storage/Legacy/Converter.php b/src/Kore/RatingFieldTypeBundle/Storage/Legacy/Converter.php
index 33943d5..d502112 100644
--- a/src/Kore/RatingFieldTypeBundle/Storage/Legacy/Converter.php
+++ b/src/Kore/RatingFieldTypeBundle/Storage/Legacy/Converter.php
@@ -24,12 +24,10 @@ class Converter implements ConverterInterface
 
     public function toStorageFieldDefinition(FieldDefinition $fieldDef, StorageFieldDefinition $storageDef)
     {
-
     }
 
     public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)
     {
-
     }
 
     public function getIndexColumn()

@ezrobot
Copy link
Contributor

ezrobot commented Jul 10, 2017

Tool version : PHP CS Fixer 2.1.2 by Fabien Potencier and Dariusz Ruminski
Command executed php-cs-fixer --dry-run -v fix
This Pull Request does not respect PSR-2 Coding Standards, please, see the suggested diff below:

diff --git a/src/Kore/RatingFieldTypeBundle/DependencyInjection/KoreRatingFieldTypeExtension.php b/src/Kore/RatingFieldTypeBundle/DependencyInjection/KoreRatingFieldTypeExtension.php
index a6c7be9..d281063 100644
--- a/src/Kore/RatingFieldTypeBundle/DependencyInjection/KoreRatingFieldTypeExtension.php
+++ b/src/Kore/RatingFieldTypeBundle/DependencyInjection/KoreRatingFieldTypeExtension.php
@@ -30,7 +30,7 @@ class KoreRatingFieldTypeExtension extends Extension implements PrependExtension
         $configuration = new Configuration();
         $config = $this->processConfiguration($configuration, $configs);
 
-        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
+        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
         $loader->load('services.xml');
     }
 }
diff --git a/src/Kore/RatingFieldTypeBundle/Storage/FieldType/Type.php b/src/Kore/RatingFieldTypeBundle/Storage/FieldType/Type.php
index a539abf..f446296 100644
--- a/src/Kore/RatingFieldTypeBundle/Storage/FieldType/Type.php
+++ b/src/Kore/RatingFieldTypeBundle/Storage/FieldType/Type.php
@@ -3,7 +3,6 @@
 namespace Kore\RatingFieldTypeBundle\Storage\FieldType;
 
 use eZ\Publish\Core\FieldType\FieldType;
-use eZ\Publish\API\Repository\Values\ContentType\FieldDefinition;
 use eZ\Publish\SPI\FieldType\Value as SPIValue;
 use eZ\Publish\Core\FieldType\Value as CoreValue;
 use eZ\Publish\SPI\Persistence\Content\FieldValue;
@@ -51,7 +50,7 @@ class Type extends FieldType
      *
      * @param mixed $inputValue
      *
-     * @return mixed The potentially converted input value.
+     * @return mixed the potentially converted input value
      */
     protected function createValueFromInput($inputValue)
     {
@@ -87,7 +86,7 @@ class Type extends FieldType
      *  }
      * </code>
      *
-     * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException If the value does not match the expected structure.
+     * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if the value does not match the expected structure
      *
      * @param \eZ\Publish\Core\FieldType\Value $value
      */
diff --git a/src/Kore/RatingFieldTypeBundle/Storage/Legacy/Converter.php b/src/Kore/RatingFieldTypeBundle/Storage/Legacy/Converter.php
index 33943d5..d502112 100644
--- a/src/Kore/RatingFieldTypeBundle/Storage/Legacy/Converter.php
+++ b/src/Kore/RatingFieldTypeBundle/Storage/Legacy/Converter.php
@@ -24,12 +24,10 @@ class Converter implements ConverterInterface
 
     public function toStorageFieldDefinition(FieldDefinition $fieldDef, StorageFieldDefinition $storageDef)
     {
-
     }
 
     public function toFieldDefinition(StorageFieldDefinition $storageDef, FieldDefinition $fieldDef)
     {
-
     }
 
     public function getIndexColumn()

@ezrobot
Copy link
Contributor

ezrobot commented Jul 12, 2017

Tool version : PHP CS Fixer 2.1.2 by Fabien Potencier and Dariusz Ruminski
Command executed php-cs-fixer --dry-run -v fix
This Pull Request does not respect PSR-2 Coding Standards, please, see the suggested diff below:

diff --git a/src/Kore/RatingFieldTypeBundle/DependencyInjection/KoreRatingFieldTypeExtension.php b/src/Kore/RatingFieldTypeBundle/DependencyInjection/KoreRatingFieldTypeExtension.php
index a6c7be9..d281063 100644
--- a/src/Kore/RatingFieldTypeBundle/DependencyInjection/KoreRatingFieldTypeExtension.php
+++ b/src/Kore/RatingFieldTypeBundle/DependencyInjection/KoreRatingFieldTypeExtension.php
@@ -30,7 +30,7 @@ class KoreRatingFieldTypeExtension extends Extension implements PrependExtension
         $configuration = new Configuration();
         $config = $this->processConfiguration($configuration, $configs);
 
-        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
+        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
         $loader->load('services.xml');
     }
 }
diff --git a/src/Kore/RatingFieldTypeBundle/Storage/FieldType/Type.php b/src/Kore/RatingFieldTypeBundle/Storage/FieldType/Type.php
index b710d82..ee55c83 100644
--- a/src/Kore/RatingFieldTypeBundle/Storage/FieldType/Type.php
+++ b/src/Kore/RatingFieldTypeBundle/Storage/FieldType/Type.php
@@ -3,7 +3,6 @@
 namespace Kore\RatingFieldTypeBundle\Storage\FieldType;
 
 use eZ\Publish\Core\FieldType\FieldType;
-use eZ\Publish\API\Repository\Values\ContentType\FieldDefinition;
 use eZ\Publish\SPI\FieldType\Value as SPIValue;
 use eZ\Publish\Core\FieldType\Value as CoreValue;
 use eZ\Publish\SPI\Persistence\Content\FieldValue;
@@ -52,7 +51,7 @@ class Type extends FieldType
      *
      * @param mixed $inputValue
      *
-     * @return mixed The potentially converted input value.
+     * @return mixed the potentially converted input value
      */
     protected function createValueFromInput($inputValue)
     {
@@ -92,7 +91,7 @@ class Type extends FieldType
      *  }
      * </code>
      *
-     * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException If the value does not match the expected structure.
+     * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if the value does not match the expected structure
      *
      * @param \eZ\Publish\Core\FieldType\Value $value
      */
diff --git a/src/Kore/RatingFieldTypeBundle/Tests/TypeIntegrationTest.php b/src/Kore/RatingFieldTypeBundle/Tests/TypeIntegrationTest.php
index 3349cae..96f1194 100644
--- a/src/Kore/RatingFieldTypeBundle/Tests/TypeIntegrationTest.php
+++ b/src/Kore/RatingFieldTypeBundle/Tests/TypeIntegrationTest.php
@@ -6,7 +6,6 @@ use eZ\Publish\SPI\Tests\FieldType\BaseIntegrationTest;
 use eZ\Publish\Core\FieldType;
 use eZ\Publish\SPI\Persistence\Content;
 use eZ\Publish\SPI\Persistence\Content\Field;
-
 use Kore\RatingFieldTypeBundle\Storage\FieldType\Type;
 use Kore\RatingFieldTypeBundle\Storage\FieldType\Value;
 use Kore\RatingFieldTypeBundle\Storage\Legacy\Converter;
diff --git a/src/Kore/RatingFieldTypeBundle/Tests/TypeTest.php b/src/Kore/RatingFieldTypeBundle/Tests/TypeTest.php
index 1ad84bc..7dcc75d 100644
--- a/src/Kore/RatingFieldTypeBundle/Tests/TypeTest.php
+++ b/src/Kore/RatingFieldTypeBundle/Tests/TypeTest.php
@@ -3,7 +3,6 @@
 namespace Kore\RatingFieldTypeBundle\Tests;
 
 use eZ\Publish\Core\FieldType\Tests\FieldTypeTest;
-
 use Kore\RatingFieldTypeBundle\Storage\FieldType\Type;
 use Kore\RatingFieldTypeBundle\Storage\FieldType\Value;
 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants