This repository was archived by the owner on May 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
[WIP] EZP-27870: Remove translation of every versions of a content #919
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tool version : jshint v2.9.5 Command executed :
Command executed :
|
Tool version : PHP CS Fixer 2.7.1 Sandy Pool by Fabien Potencier and Dariusz Ruminski diff --git a/ApplicationConfig/Providers/InterfaceLanguages.php b/ApplicationConfig/Providers/InterfaceLanguages.php
index ab8768d..89b6f57 100644
--- a/ApplicationConfig/Providers/InterfaceLanguages.php
+++ b/ApplicationConfig/Providers/InterfaceLanguages.php
@@ -28,7 +28,7 @@ class InterfaceLanguages implements Provider
$defaultLocale = $request->getDefaultLocale();
$languages = [$browserLanguage];
- if (strpos($browserLanguage, '_') !== false) {
+ if (false !== strpos($browserLanguage, '_')) {
$languages[] = explode('_', $browserLanguage)[0];
}
if (!in_array($defaultLocale, $languages)) {
diff --git a/Controller/Rest/ContentController.php b/Controller/Rest/ContentController.php
index 21d0284..330c392 100644
--- a/Controller/Rest/ContentController.php
+++ b/Controller/Rest/ContentController.php
@@ -119,12 +119,12 @@ class ContentController extends Content
private function isUserCreateRequest(Request $request)
{
- if (($contentTypeHeaderValue = $request->headers->get('Content-Type')) == null) {
+ if (null == ($contentTypeHeaderValue = $request->headers->get('Content-Type'))) {
return false;
}
list($mediaType) = explode('+', $contentTypeHeaderValue);
- if (strtolower($mediaType) !== 'application/vnd.ez.api.contentcreate') {
+ if ('application/vnd.ez.api.contentcreate' !== strtolower($mediaType)) {
return false;
}
diff --git a/Controller/TemplateController.php b/Controller/TemplateController.php
index 6639916..3e43565 100644
--- a/Controller/TemplateController.php
+++ b/Controller/TemplateController.php
@@ -41,7 +41,7 @@ class TemplateController extends Controller
*/
public function wrapTemplateAction($module)
{
- if ($this->getModuleSetting($module, 'type') !== 'template') {
+ if ('template' !== $this->getModuleSetting($module, 'type')) {
throw new BadRequestHttpException($module . ' is not declared as a template');
}
$path = $this->getModuleSetting($module, 'path');
diff --git a/Features/Context/Fields.php b/Features/Context/Fields.php
index a6c2cc2..1766fb5 100644
--- a/Features/Context/Fields.php
+++ b/Features/Context/Fields.php
@@ -53,7 +53,7 @@ class Fields extends PlatformUI
$identifier = $fieldManager->getThisFieldTypeIdentifier();
// check if we are editing a field for draft or published content
- if ($fieldManager->getFieldContentState() == FieldType::CONTENT_PUBLISHED) {
+ if (FieldType::CONTENT_PUBLISHED == $fieldManager->getFieldContentState()) {
$contentId = $fieldManager->getThisContentId();
} else {
$contentId = '';
@@ -121,7 +121,7 @@ class Fields extends PlatformUI
*/
public function checkFieldValue()
{
- if ($this->platformStatus == self::WAITING_FOR_PUBLISHING) {
+ if (self::WAITING_FOR_PUBLISHING == $this->platformStatus) {
$this->checkOption($this->getThisFieldIdent());
} else {
throw new \Exception('Cannot publish content, application in wrong state');
@@ -134,7 +134,7 @@ class Fields extends PlatformUI
*/
public function uncheckFieldValue()
{
- if ($this->platformStatus == self::WAITING_FOR_PUBLISHING) {
+ if (self::WAITING_FOR_PUBLISHING == $this->platformStatus) {
$this->uncheckOption($this->getThisFieldIdent());
} else {
throw new \Exception('Cannot publish content, application in wrong state');
@@ -147,7 +147,7 @@ class Fields extends PlatformUI
*/
public function publishContent()
{
- if ($this->platformStatus == self::WAITING_FOR_PUBLISHING) {
+ if (self::WAITING_FOR_PUBLISHING == $this->platformStatus) {
$this->clickEditActionBar('Publish');
} else {
throw new \Exception('Cannot publish content, application in wrong state');
@@ -161,7 +161,7 @@ class Fields extends PlatformUI
*/
public function seeRequiredFieldtOfType($label)
{
- if ($this->platformStatus == self::WAITING_FOR_PUBLISHING) {
+ if (self::WAITING_FOR_PUBLISHING == $this->platformStatus) {
$fieldManager = $this->getFieldTypeManager();
// $type = ...
//$name = $fieldManager->getThisFieldTypeName();
@@ -206,7 +206,7 @@ class Fields extends PlatformUI
*/
public function seeFieldtOfType($type, $label = null)
{
- if ($this->platformStatus == self::WAITING_FOR_PUBLISHING) {
+ if (self::WAITING_FOR_PUBLISHING == $this->platformStatus) {
$this->clickEditActionBar('Publish');
}
$verification = new WebAssert($this->getSession());
@@ -214,7 +214,7 @@ class Field(...)
NOTICE : Report truncated to 5Kb
|
Closed in favor of #949 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[WIP]
First draft for https://jira.ez.no/browse/EZP-27914
Waiting for API REST to be updated (and JS REST client but I guess I'll do it)