From faae157bfc23c8b279e097b2c9a4388fa4553211 Mon Sep 17 00:00:00 2001 From: corentin Date: Tue, 7 Jun 2016 12:05:43 +0200 Subject: [PATCH 1/7] Fixed: isEmpty() return always false --- src/Model/Translatable/TranslationMethods.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Model/Translatable/TranslationMethods.php b/src/Model/Translatable/TranslationMethods.php index a280afca..8e2ce22e 100644 --- a/src/Model/Translatable/TranslationMethods.php +++ b/src/Model/Translatable/TranslationMethods.php @@ -93,6 +93,13 @@ public function getLocale() */ public function isEmpty() { - return false; + foreach (get_object_vars($this) as $var => $value) { + if (in_array($var, array('id', 'translatable', 'locale'))) + continue; + + if (!empty($value)) + return false; + } + return true; } } From 5eefb9859f321fcf60d3359b9afd3c06657a7cd7 Mon Sep 17 00:00:00 2001 From: corentin Date: Thu, 6 Oct 2016 18:05:05 +0200 Subject: [PATCH 2/7] iso avec knp --- .travis.yml | 2 +- src/Model/Translatable/TranslationMethods.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index db040ffc..46785358 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,4 +57,4 @@ before_script: script: - bin/parallel-lint -e php,phpt --exclude vendor . - bin/yaml-lint config/* -- bin/phpunit --testdox +- bin/phpunit diff --git a/src/Model/Translatable/TranslationMethods.php b/src/Model/Translatable/TranslationMethods.php index 8e2ce22e..f288fa7b 100644 --- a/src/Model/Translatable/TranslationMethods.php +++ b/src/Model/Translatable/TranslationMethods.php @@ -96,7 +96,7 @@ public function isEmpty() foreach (get_object_vars($this) as $var => $value) { if (in_array($var, array('id', 'translatable', 'locale'))) continue; - + if (!empty($value)) return false; } From 8f0b354cb64711f645a34012a9cae8ae8c9e11ed Mon Sep 17 00:00:00 2001 From: corentin Date: Tue, 11 Oct 2016 18:21:44 +0200 Subject: [PATCH 3/7] isempty(): Fix code according to PSR or symfony codestyles --- .idea/.name | 1 + .idea/copyright/profiles_settings.xml | 3 + .idea/encodings.xml | 6 + .idea/headoo-DoctrineBehaviors.iml | 8 + .idea/misc.xml | 13 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 276 ++++++++++++++++++ src/Model/Translatable/TranslationMethods.php | 7 +- 9 files changed, 326 insertions(+), 2 deletions(-) create mode 100644 .idea/.name create mode 100644 .idea/copyright/profiles_settings.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/headoo-DoctrineBehaviors.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 00000000..803b442d --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +headoo-DoctrineBehaviors \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 00000000..e7bedf33 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 00000000..97626ba4 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/headoo-DoctrineBehaviors.iml b/.idea/headoo-DoctrineBehaviors.iml new file mode 100644 index 00000000..c956989b --- /dev/null +++ b/.idea/headoo-DoctrineBehaviors.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..72abef0a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..985ff1ab --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..08c4eb80 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + project + + + + + + + + + + + + + + + + project + + + true + + + + DIRECTORY + + false + + + + + + + + + + + + 1465293658963 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Model/Translatable/TranslationMethods.php b/src/Model/Translatable/TranslationMethods.php index f288fa7b..7b60ff73 100644 --- a/src/Model/Translatable/TranslationMethods.php +++ b/src/Model/Translatable/TranslationMethods.php @@ -94,12 +94,15 @@ public function getLocale() public function isEmpty() { foreach (get_object_vars($this) as $var => $value) { - if (in_array($var, array('id', 'translatable', 'locale'))) + if (in_array($var, ['id', 'translatable', 'locale'])) { continue; + } - if (!empty($value)) + if (!empty($value)) { return false; + } } + return true; } } From 20309396adb6dba071d7cada083473fb18f4b9f3 Mon Sep 17 00:00:00 2001 From: corentin Date: Tue, 11 Oct 2016 18:22:59 +0200 Subject: [PATCH 4/7] isempty(): Fix code according to PSR or symfony codestyles --- .idea/.name | 1 - .idea/copyright/profiles_settings.xml | 3 - .idea/encodings.xml | 6 - .idea/headoo-DoctrineBehaviors.iml | 8 - .idea/misc.xml | 13 -- .idea/modules.xml | 8 - .idea/vcs.xml | 6 - .idea/workspace.xml | 276 -------------------------- 8 files changed, 321 deletions(-) delete mode 100644 .idea/.name delete mode 100644 .idea/copyright/profiles_settings.xml delete mode 100644 .idea/encodings.xml delete mode 100644 .idea/headoo-DoctrineBehaviors.iml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 803b442d..00000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -headoo-DoctrineBehaviors \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index e7bedf33..00000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba4..00000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/headoo-DoctrineBehaviors.iml b/.idea/headoo-DoctrineBehaviors.iml deleted file mode 100644 index c956989b..00000000 --- a/.idea/headoo-DoctrineBehaviors.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 72abef0a..00000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 985ff1ab..00000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f..00000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 08c4eb80..00000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,276 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - DEFINITION_ORDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - project - - - - - - - - - - - - - - - - project - - - true - - - - DIRECTORY - - false - - - - - - - - - - - - 1465293658963 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 0b42125bce637dfab9e297e01809f4bcedc90280 Mon Sep 17 00:00:00 2001 From: corentin Date: Wed, 12 Oct 2016 09:55:47 +0200 Subject: [PATCH 5/7] isempty(): Fix code according to PSR or symfony codestyles --- src/Model/Translatable/TranslationMethods.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Model/Translatable/TranslationMethods.php b/src/Model/Translatable/TranslationMethods.php index 8e2ce22e..89d3d926 100644 --- a/src/Model/Translatable/TranslationMethods.php +++ b/src/Model/Translatable/TranslationMethods.php @@ -94,12 +94,15 @@ public function getLocale() public function isEmpty() { foreach (get_object_vars($this) as $var => $value) { - if (in_array($var, array('id', 'translatable', 'locale'))) + if (in_array($var, ['id', 'translatable', 'locale'])) { continue; + } - if (!empty($value)) + if (!empty($value)) { return false; + } } + return true; } } From 640995ea9ca2497eb414ad7751bff50f6b8caf74 Mon Sep 17 00:00:00 2001 From: corentin Date: Wed, 12 Oct 2016 10:09:50 +0200 Subject: [PATCH 6/7] remove idea --- .idea/workspace.xml | 277 -------------------------------------------- 1 file changed, 277 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 3632cf03..00000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - DEFINITION_ORDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - project - - - - - - - - - - - - - - - - project - - - true - - - - DIRECTORY - - false - - - - - - - - - - - - 1465293658963 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 3aa0af8f1b60e4062de1d57314b3f208125bff0b Mon Sep 17 00:00:00 2001 From: corentin Date: Wed, 12 Oct 2016 10:11:06 +0200 Subject: [PATCH 7/7] travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 46785358..db040ffc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,4 +57,4 @@ before_script: script: - bin/parallel-lint -e php,phpt --exclude vendor . - bin/yaml-lint config/* -- bin/phpunit +- bin/phpunit --testdox