From 8118448a9c12578f3f940da4daae56f53f678112 Mon Sep 17 00:00:00 2001 From: Christopher Joe Date: Fri, 23 Dec 2016 14:09:00 +1300 Subject: [PATCH] Fix PHP linting issues --- admin/client/dist/js/bundle.js | 66 +++++++++---------- admin/client/src/lib/DataFormat.js | 2 +- admin/code/CMSMenu.php | 8 ++- admin/code/LeftAndMain.php | 2 +- admin/code/ModelAdmin.php | 4 +- src/Forms/GridField/GridFieldFilterHeader.php | 2 +- src/Forms/GridField/GridFieldImportButton.php | 5 -- .../GridField/GridFieldSortableHeader.php | 2 +- src/View/Parsers/ShortcodeParser.php | 2 +- 9 files changed, 47 insertions(+), 46 deletions(-) diff --git a/admin/client/dist/js/bundle.js b/admin/client/dist/js/bundle.js index b7da5c3fa..ae0205463 100644 --- a/admin/client/dist/js/bundle.js +++ b/admin/client/dist/js/bundle.js @@ -159,7 +159,7 @@ return Q=t.runOnLoop||t.runOnContext,u()}catch(r){return f()}}function m(e,t){va void 0===r[ae]&&M(r) var a=i._state return a?!function(){var e=n[a-1] -J(function(){return A(a,r,e,i._result)})}():j(i,r,e,t),r}function g(e){var t=this +J(function(){return F(a,r,e,i._result)})}():j(i,r,e,t),r}function g(e){var t=this if(e&&"object"==typeof e&&e.constructor===t)return e var n=new t(v) return P(n,e),n}function v(){}function y(){return new TypeError("You cannot resolve a promise with itself")}function b(){return new TypeError("A promises callback cannot return that same promise.")}function _(e){ @@ -170,17 +170,17 @@ i||(i=!0,k(e,t))},"Settle: "+(e._label||" unknown promise")) }function P(t,n){t===n?k(t,y()):e(n)?E(t,n,_(n)):S(t,n)}function O(e){e._onerror&&e._onerror(e._result),x(e)}function S(e,t){e._state===oe&&(e._result=t,e._state=se,0!==e._subscribers.length&&J(x,e))}function k(e,t){ e._state===oe&&(e._state=le,e._result=t,J(O,e))}function j(e,t,n,i){var r=e._subscribers,a=r.length e._onerror=null,r[a]=t,r[a+se]=n,r[a+le]=i,0===a&&e._state&&J(x,e)}function x(e){var t=e._subscribers,n=e._state -if(0!==t.length){for(var i=void 0,r=void 0,a=e._result,o=0;o127?"x":F[M] -if(!D.match(b)){var U=I.slice(0,S),L=I.slice(S+1),B=F.match(_) +if(!R)for(var I=this.hostname.split(/\./),S=0,F=I.length;S127?"x":A[M] +if(!D.match(b)){var U=I.slice(0,S),L=I.slice(S+1),B=A.match(_) B&&(U.push(B[1]),L.unshift(B[2])),L.length&&(s="/"+L.join(".")+s),this.hostname=U.join(".") break}}}this.hostname.length>y?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=l.toASCII(this.hostname)) var H=this.port?":"+this.port:"",$=this.hostname||"" -this.host=$+H,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!w[h])for(var S=0,A=m.length;S0)&&n.host.split("@") P&&(n.auth=P.shift(),n.host=n.hostname=P.shift())}return b=b||n.host&&w.length,b&&!x&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),u.isNull(n.pathname)&&u.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")), n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=d.exec(e) -t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){var i;(function(e,r){!function(a){function o(e){throw RangeError(F[e])}function s(e,t){ +t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){var i;(function(e,r){!function(a){function o(e){throw RangeError(A[e])}function s(e,t){ for(var n=e.length,i=[];n--;)i[n]=t(e[n]) return i}function l(e,t){var n=e.split("@"),i="" -n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(A,".") +n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(F,".") var r=e.split("."),a=s(r,t).join(".") return i+a}function u(e){for(var t=[],n=0,i=e.length,r,a;n=55296&&r<=56319&&n= 0x80 (not a basic code point)", +var w,C=2147483647,T=36,E=1,P=26,O=38,S=700,k=72,j=128,x="-",R=/^xn--/,I=/[^\x20-\x7E]/,F=/[\x2E\u3002\uFF0E\uFF61]/g,A={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)", "invalid-input":"Invalid input"},D=T-E,M=Math.floor,N=String.fromCharCode,U w={version:"1.3.2",ucs2:{decode:u,encode:c},decode:h,encode:m,toASCII:v,toUnicode:g},i=function(){return w}.call(t,n,t,e),!(void 0!==i&&(e.exports=i))}(this)}).call(t,n(15)(e),function(){return this}()) @@ -1122,7 +1122,7 @@ t.length&&t.remove(),n=$.path.addSearchParams(n,{tempid:e,BackURL:window.locatio }}),$(".leftandmain-logindialog").entwine({onmatch:function j(){this._super(),this.ssdialog({iframeUrl:this.data("url"),dialogClass:"leftandmain-logindialog-dialog",autoOpen:!0,minWidth:500,maxWidth:500, minHeight:370,maxHeight:400,closeOnEscape:!1,open:function e(){$(".ui-widget-overlay").addClass("leftandmain-logindialog-overlay")},close:function t(){$(".ui-widget-overlay").removeClass("leftandmain-logindialog-overlay") -}})},onunmatch:function x(){this._super()},open:function R(){this.ssdialog("open")},close:function I(){this.ssdialog("close")},toggle:function A(e){this.is(":visible")?this.close():this.open()},reauthenticate:function F(e){ +}})},onunmatch:function x(){this._super()},open:function R(){this.ssdialog("open")},close:function I(){this.ssdialog("close")},toggle:function F(e){this.is(":visible")?this.close():this.open()},reauthenticate:function A(e){ "undefined"!=typeof e.SecurityID&&$(":input[name=SecurityID]").val(e.SecurityID),"undefined"!=typeof e.TempID&&$("body").data("member-tempid",e.TempID),this.close()}}),$("form.loading,.cms-content.loading,.cms-content-fields.loading,.cms-content-view.loading").entwine({ onmatch:function D(){this.append('
'),this._super()},onunmatch:function M(){this.find(".cms-content-loading-overlay,.cms-content-loading-spinner").remove(), this._super()}}),$(".cms .cms-panel-link").entwine({onclick:function N(e){if($(this).hasClass("external-link"))return void e.stopPropagation() @@ -1381,7 +1381,7 @@ return t.toggle(),!1}}),e(".cms .profile-link").entwine({onclick:function j(){re onadd:function x(){var t=!!e(".cms-menu").getPersistedStickyState() this.toggleCSS(t),this.toggleIndicator(t),this._super()},toggleCSS:function R(e){this[e?"addClass":"removeClass"]("active")},toggleIndicator:function I(e){this.next(".sticky-status-indicator").text(e?"fixed":"auto") -},onclick:function A(){var e=this.closest(".cms-menu"),t=e.getPersistedCollapsedState(),n=e.getPersistedStickyState(),i=void 0===n?!this.hasClass("active"):!n +},onclick:function F(){var e=this.closest(".cms-menu"),t=e.getPersistedCollapsedState(),n=e.getPersistedStickyState(),i=void 0===n?!this.hasClass("active"):!n void 0===t?e.setPersistedCollapsedState(e.hasClass("collapsed")):void 0!==t&&i===!1&&e.clearPersistedCollapsedState(),e.setPersistedStickyState(i),this.toggleCSS(i),this.toggleIndicator(i),this._super() }})})},function(e,t,n){"use strict" @@ -1452,8 +1452,8 @@ this.addClass("active").siblings().removeClass("active"),e(".cms-preview").chang }}),e(".preview-mode-selector select").entwine({onchange:function I(t){this._super(t),t.preventDefault() var n=e(this).val() -e(".cms-preview").changeMode(n)}}),e(".cms-container--content-mode").entwine({onmatch:function A(){e(".cms-preview .result-selected").hasClass("font-icon-columns")&&statusMessage(s["default"]._t("LeftAndMain.DISABLESPLITVIEW","Screen too small to show site preview in split mode"),"error"), -this._super()}}),e(".preview-size-selector").entwine({changeVisibleSize:function F(e){this.find("select").val(e).trigger("chosen:updated")._addIcon()}}),e(".preview-size-selector select").entwine({onchange:function D(t){ +e(".cms-preview").changeMode(n)}}),e(".cms-container--content-mode").entwine({onmatch:function F(){e(".cms-preview .result-selected").hasClass("font-icon-columns")&&statusMessage(s["default"]._t("LeftAndMain.DISABLESPLITVIEW","Screen too small to show site preview in split mode"),"error"), +this._super()}}),e(".preview-size-selector").entwine({changeVisibleSize:function A(e){this.find("select").val(e).trigger("chosen:updated")._addIcon()}}),e(".preview-size-selector select").entwine({onchange:function D(t){ t.preventDefault() var n=e(this).val() e(".cms-preview").changeSize(n)}}),e(".preview-selector select.preview-dropdown").entwine({"onchosen:ready":function M(){this._super(),this._addIcon()},_addIcon:function N(){var e=this.find(":selected"),t=e.attr("data-icon"),n=this.parent().find(".chosen-container a.chosen-single"),i=n.attr("data-icon") @@ -1772,7 +1772,7 @@ i.setCurrentXhr(null),a.jstree("destroy").bind("loaded.jstree",function(e,r){t.e var r=n.inst.get_checked(null,!0) i.setValue(t.map(r,function(e,n){return t(e).data("id")})),i.setTitle(t.map(r,function(e,t){return n.inst.get_text(e)})),i.data("metadata",t.map(r,function(e,n){return{id:t(e).data("id"),metadata:t(e).getMetaData() }}))})}}),this.setCurrentXhr(o)},getValue:function I(){var e=this._super() -return e.split(/ *, */)},setValue:function A(e){this._super(t.isArray(e)?e.join(","):e)},setTitle:function F(e){this._super(t.isArray(e)?e.join(", "):e)},updateTitle:function D(){}}),t(".TreeDropdownField input[type=hidden]").entwine({ +return e.split(/ *, */)},setValue:function F(e){this._super(t.isArray(e)?e.join(","):e)},setTitle:function A(e){this._super(t.isArray(e)?e.join(", "):e)},updateTitle:function D(){}}),t(".TreeDropdownField input[type=hidden]").entwine({ onadd:function M(){this._super(),this.bind("change.TreeDropdownField",function(){t(this).getField().updateTitle()})},onremove:function N(){this._super(),this.unbind(".TreeDropdownField")}})})}).call(t,n(1)) },,,function(module,exports,__webpack_require__){"use strict" @@ -1865,13 +1865,13 @@ l?e.ajax({url:e.path.addSearchParams(this.attr("action").replace("LinkForm","get }}):n.resolve([]) break -default:n.reject(_i18n2["default"]._t("HtmlEditorField.ANCHORSNOTSUPPORTED","Anchors are not supported for this link type."))}return n.promise()},updateAnchorSelector:function A(){var t=this,n=this.find(":input[name=AnchorSelector]"),i=this.getAnchors() +default:n.reject(_i18n2["default"]._t("HtmlEditorField.ANCHORSNOTSUPPORTED","Anchors are not supported for this link type."))}return n.promise()},updateAnchorSelector:function F(){var t=this,n=this.find(":input[name=AnchorSelector]"),i=this.getAnchors() n.empty(),n.append(e('")),i.done(function(t){if(n.empty(),n.append(e('")), t)for(var i=0;i'+t[i]+""))}).fail(function(t){n.empty(),n.append(e('"))}),e.browser.msie&&n.hide().show() -},updateFromEditor:function F(){var e=/<\S[^><]*>/g,t,n=this.getCurrentLink() +},updateFromEditor:function A(){var e=/<\S[^><]*>/g,t,n=this.getCurrentLink() if(n)for(t in n){var i=this.find(":input[name="+t+"]"),r=n[t] "string"==typeof r&&(r=r.replace(e,"")),i.is(":checkbox")?i.prop("checked",r).change():i.is(":radio")?i.val([r]).change():"file"==t?(i=this.find(':input[name="'+t+'[Uploads][]"]'),i=i.parents(".ss-uploadfield"), function a(e,t){e.getConfig()?e.attachFiles([t]):setTimeout(function(){a(e,t)},50)}(i,r)):i.val(r).change()}},getCurrentLink:function D(){var e=this.getSelection(),t="",n="",i="",r="insert",a="",o=null @@ -1978,7 +1978,7 @@ n.addClass("ui-state-success-text"))),n.attr("title",i).text(i)}}),e('form.htmle var e=this this.bind("change",function(){var t=e.closest("form").find(".grid-field") t.setState("ParentID",e.getValue()),t.reload()})}}),e(".insert-media-react__dialog-wrapper .nav-link").entwine({onclick:function Ie(e){return e.preventDefault()}}),e("#insert-media-react__dialog-wrapper").entwine({ -Element:null,Data:{},onunmatch:function Ae(){this._clearModal()},_clearModal:function Fe(){_reactDom2["default"].unmountComponentAtNode(this[0])},open:function De(){this._renderModal(!0)},close:function Me(){ +Element:null,Data:{},onunmatch:function Fe(){this._clearModal()},_clearModal:function Ae(){_reactDom2["default"].unmountComponentAtNode(this[0])},open:function De(){this._renderModal(!0)},close:function Me(){ this._renderModal(!1)},_renderModal:function Ne(e){var t=this,n=function l(){return t.close()},i=function u(){return t._handleInsert.apply(t,arguments)},r=window.ss.store,a=window.ss.apolloClient,o=this.getOriginalAttributes(),s=window.InsertMediaModal["default"] @@ -2073,7 +2073,7 @@ this.val()&&(e.addClass("filtered"),t.addClass("filtered")),this._super()},onunm if("13"==e.keyCode){var i=this.closest(".filter-header").find(".ss-gridfield-button-filter"),r="show" return!this.hasClass("ss-gridfield-button-close")&&this.closest(".grid-field").hasClass("show-filter")||(r="hidden"),this.getGridField().reload({data:[{name:i.attr("name"),value:i.val(),filter:r}]}),!1 -}t.addClass("hover-alike"),n.addClass("hover-alike")}}}),e(".grid-field .relation-search").entwine({onfocusin:function A(t){this.autocomplete({source:function n(t,i){var r=e(this.element),a=e(this.element).closest("form") +}t.addClass("hover-alike"),n.addClass("hover-alike")}}}),e(".grid-field .relation-search").entwine({onfocusin:function F(t){this.autocomplete({source:function n(t,i){var r=e(this.element),a=e(this.element).closest("form") e.ajax({headers:{"X-Pjax":"Partial"},dataType:"json",type:"GET",url:e(r).data("searchUrl"),data:encodeURIComponent(r.attr("name"))+"="+encodeURIComponent(r.val()),success:i,error:function o(e){alert(s["default"]._t("GRIDFIELD.ERRORINTRANSACTION","An error occured while fetching data from the server\n Please try again later.")) @@ -2081,7 +2081,7 @@ e.ajax({headers:{"X-Pjax":"Partial"},dataType:"json",type:"GET",url:e(r).data("s }})},select:function i(t,n){var i=e('') i.val(n.item.id),e(this).closest(".grid-field").find(".action_gridfield_relationfind").replaceWith(i) var r=e(this).closest(".grid-field").find(".action_gridfield_relationadd") -r.removeAttr("disabled")}})}}),e(".grid-field .pagination-page-number input").entwine({onkeydown:function F(t){if(13==t.keyCode){var n=parseInt(e(this).val(),10),i=e(this).getGridField() +r.removeAttr("disabled")}})}}),e(".grid-field .pagination-page-number input").entwine({onkeydown:function A(t){if(13==t.keyCode){var n=parseInt(e(this).val(),10),i=e(this).getGridField() return i.setState("GridFieldPaginator",{currentPage:n}),i.reload(),!1}}})})},function(e,t,n){"use strict" function i(e){if(e&&e.__esModule)return e var t={} @@ -2097,7 +2097,7 @@ var n={},i=(0,l.combineReducers)(g["default"].getAll()),r=[c["default"],t.middle var v=u(l.createStore),b=v(i,n) b.dispatch(y.setConfig(h["default"].getAll())),window.ss=window.ss||{},window.ss.store=b,window.ss=window.ss||{},window.ss.apolloClient=t var w=new s["default"](b,t) -w.start(window.location.pathname),window.jQuery&&window.jQuery("body").addClass("js-react-boot")}var o=n(204),s=r(o),l=n(107),u=n(226),c=r(u),d=n(109),f=n(225),p=n(147),h=r(p),m=n(227),g=r(m),v=n(228),y=i(v),b=n(230),_=r(b),w=n(231),C=r(w),T=n(232),E=r(T),P=n(233),O=r(P),S=n(235),k=r(S),j=n(236),x=r(j),R=n(252),I=r(R),A=n(253),F=r(A),D=n(10),M=r(D) +w.start(window.location.pathname),window.jQuery&&window.jQuery("body").addClass("js-react-boot")}var o=n(204),s=r(o),l=n(107),u=n(226),c=r(u),d=n(109),f=n(225),p=n(147),h=r(p),m=n(227),g=r(m),v=n(228),y=i(v),b=n(230),_=r(b),w=n(231),C=r(w),T=n(232),E=r(T),P=n(233),O=r(P),S=n(235),k=r(S),j=n(236),x=r(j),R=n(252),I=r(R),F=n(253),A=r(F),D=n(10),M=r(D) M["default"].polyfill(),window.onload=a},function(e,t,n){"use strict" @@ -2196,11 +2196,11 @@ for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}, t["default"]=r},function(e,t,n){"use strict" function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}) var a=function(){function e(e,t){for(var n=0;n0&&(t=e+"/"+this.props.params.id) var n={createFn:this.campaignEditCreateFn.bind(this),schemaUrl:t} return p["default"].createElement("div",null,p["default"].createElement(x["default"],{showBackButton:!0,handleBackButtonClick:this.handleBackButtonClick},p["default"].createElement(C["default"],{multiline:!0 @@ -2544,7 +2544,7 @@ var i=Object.getOwnPropertyDescriptor(e,t) if(void 0===i){var r=Object.getPrototypeOf(e) return null===r?void 0:q(r,t,n)}if("value"in i)return i.value var a=i.get -if(void 0!==a)return a.call(n)},p=n(5),h=r(p),m=n(107),g=n(106),v=n(255),y=i(v),b=n(124),_=i(b),w=n(259),C=i(w),T=n(20),E=r(T),P=n(260),O=r(P),S=n(261),k=r(S),j=n(263),x=r(j),R=n(257),I=r(R),A=n(250),F=r(A),D=n(264),M=r(D),N=n(256),U=r(N),L=n(265),B=r(L),H=n(114),$=r(H),V=function(e){ +if(void 0!==a)return a.call(n)},p=n(5),h=r(p),m=n(107),g=n(106),v=n(255),y=i(v),b=n(124),_=i(b),w=n(259),C=i(w),T=n(20),E=r(T),P=n(260),O=r(P),S=n(261),k=r(S),j=n(263),x=r(j),R=n(257),I=r(R),F=n(250),A=r(F),D=n(264),M=r(D),N=n(256),U=r(N),L=n(265),B=r(L),H=n(114),$=r(H),V=function(e){ function t(e){a(this,t) var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)) return n.handlePublish=n.handlePublish.bind(n),n.handleItemSelected=n.handleItemSelected.bind(n),n.setBreadcrumbs=n.setBreadcrumbs.bind(n),n.handleCloseItem=n.handleCloseItem.bind(n),n}return s(t,e),d(t,[{ @@ -2574,7 +2574,7 @@ if(!e||!e.length)return h["default"].createElement("div",{className:"btn-toolbar var t={} return"open"===this.props.record.State?t=c(t,{title:$["default"]._t("Campaigns.PUBLISHCAMPAIGN"),buttonStyle:"primary",loading:this.props.campaign.isPublishing,handleClick:this.handlePublish,icon:"rocket" }):"published"===this.props.record.State&&(t=c(t,{title:$["default"]._t("Campaigns.REVERTCAMPAIGN"),buttonStyle:"secondary-outline",icon:"back-in-time",disabled:!0})),h["default"].createElement("div",{ -className:"btn-toolbar"},h["default"].createElement(F["default"],t))}},{key:"getItems",value:function m(){return this.props.record&&this.props.record._embedded?this.props.record._embedded.items:null}},{ +className:"btn-toolbar"},h["default"].createElement(A["default"],t))}},{key:"getItems",value:function m(){return this.props.record&&this.props.record._embedded?this.props.record._embedded.items:null}},{ key:"groupItemsForSet",value:function g(){var e={},t=this.getItems() return t?(t.forEach(function(t){var n=t.BaseClass e[n]||(e[n]={singular:t.Singular,plural:t.Plural,items:[]}),e[n].items.push(t)}),e):e}},{key:"handlePublish",value:function v(e){e.preventDefault(),this.props.campaignActions.publishCampaign(this.props.publishApi,this.props.treeClass,this.props.campaignId) diff --git a/admin/client/src/lib/DataFormat.js b/admin/client/src/lib/DataFormat.js index 503e3d89b..99bd17197 100644 --- a/admin/client/src/lib/DataFormat.js +++ b/admin/client/src/lib/DataFormat.js @@ -35,7 +35,7 @@ export function fileSize(size) { number = Math.round(size / 1024 * 1024); metric = 'MB'; } - if (!number || !metric) { + if ((!number && number !== 0) || !metric) { number = Math.round(size / (1024 * 1024 * 1024) * 10) / 10; metric = 'GB'; } diff --git a/admin/code/CMSMenu.php b/admin/code/CMSMenu.php index 5d1b1f892..e237d561e 100644 --- a/admin/code/CMSMenu.php +++ b/admin/code/CMSMenu.php @@ -157,7 +157,13 @@ class CMSMenu extends Object implements IteratorAggregate, i18nEntityProvider } return self::replace_menu_item( - $code, $menuTitle, $url, $controllerClass, $priority, $attributes, $iconClass + $code, + $menuTitle, + $url, + $controllerClass, + $priority, + $attributes, + $iconClass ); } diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index 3f8eccd6e..1a8ed096f 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -833,7 +833,7 @@ class LeftAndMain extends Controller implements PermissionProvider */ public static function menu_icon_class_for_class($class) { - return Config::inst()->get($class, 'menu_icon_class', Config::FIRST_SET); + return Config::inst()->get($class, 'menu_icon_class', Config::FIRST_SET); } /** diff --git a/admin/code/ModelAdmin.php b/admin/code/ModelAdmin.php index c1404c5e0..258ee9481 100644 --- a/admin/code/ModelAdmin.php +++ b/admin/code/ModelAdmin.php @@ -182,7 +182,7 @@ abstract class ModelAdmin extends LeftAndMain $detailform->setValidator($detailValidator); } - if($this->showImportForm) { + if ($this->showImportForm) { $import = CompositeField::create(array( new LiteralField( 'ImportForm', @@ -522,7 +522,7 @@ abstract class ModelAdmin extends LeftAndMain $message = ''; - if($results) { + if ($results) { if ($results->CreatedCount()) { $message .= _t( 'ModelAdmin.IMPORTEDRECORDS', diff --git a/src/Forms/GridField/GridFieldFilterHeader.php b/src/Forms/GridField/GridFieldFilterHeader.php index 01b5deb5c..fafba4c0f 100755 --- a/src/Forms/GridField/GridFieldFilterHeader.php +++ b/src/Forms/GridField/GridFieldFilterHeader.php @@ -229,7 +229,7 @@ class GridFieldFilterHeader implements GridField_HTMLProvider, GridField_DataMan $forTemplate->Fields->push($fields); } - if(!$canFilter) { + if (!$canFilter) { return null; } diff --git a/src/Forms/GridField/GridFieldImportButton.php b/src/Forms/GridField/GridFieldImportButton.php index be7c2245d..b023cf372 100644 --- a/src/Forms/GridField/GridFieldImportButton.php +++ b/src/Forms/GridField/GridFieldImportButton.php @@ -2,13 +2,8 @@ namespace SilverStripe\Forms\GridField; -use SilverStripe\Control\HTTPRequest; -use SilverStripe\Control\HTTPResponse; -use SilverStripe\ORM\DataObject; -use SilverStripe\Forms\Form; use SilverStripe\Forms\CompositeField; - class GridFieldImportButton implements GridField_HTMLProvider { /** diff --git a/src/Forms/GridField/GridFieldSortableHeader.php b/src/Forms/GridField/GridFieldSortableHeader.php index 4cbda2e36..f369c9fbd 100644 --- a/src/Forms/GridField/GridFieldSortableHeader.php +++ b/src/Forms/GridField/GridFieldSortableHeader.php @@ -190,7 +190,7 @@ class GridFieldSortableHeader implements GridField_HTMLProvider, GridField_DataM if ($currentColumn == count($columns)) { $filter = $gridField->getConfig()->getComponentByType('SilverStripe\\Forms\\GridField\\GridFieldFilterHeader'); - if($filter && $filter->canFilterAnyColumns($gridField)) { + if ($filter && $filter->canFilterAnyColumns($gridField)) { $field = new LiteralField( $fieldName, '' diff --git a/src/View/Parsers/ShortcodeParser.php b/src/View/Parsers/ShortcodeParser.php index 4e837f123..8a282d221 100644 --- a/src/View/Parsers/ShortcodeParser.php +++ b/src/View/Parsers/ShortcodeParser.php @@ -213,7 +213,7 @@ class ShortcodeParser extends Object if ($next) { $parent->insertBefore($new, $next); - } else if ($parent) { + } elseif ($parent) { $parent->appendChild($new); } }