3v4l.org

run code in 300+ PHP versions simultaneously
<?php import { Injectable, OnDestroy } from "@angular/core"; import { CreditAnalysisService } from "../credit-analysis.service"; import { ProgressTimelineService } from "@sw/shared/progress-timeline/progress-timeline.service"; import { BehaviorSubject } from "rxjs"; import { TemplateEnum } from "@sw/credit-review/enums/template-enum"; declare let $: any; declare let bootstrap: any; @Injectable() export class CASectionService implements OnDestroy { creditAnalysisData: any; sequenceCreditAnalysisData: any; enableDragndDrop: boolean = false; enableSimultaneous: boolean = false; constructor( private creditAnalysisService: CreditAnalysisService, private timelineStatusService: ProgressTimelineService ) {} private sectionDataChange = new BehaviorSubject<any>(null); private templateId: number; sectionData$ = this.sectionDataChange.asObservable(); setTemplateId(id: number) { this.templateId = id; } addSectionToCreditAnalysis(section: any) { if (!this.creditAnalysisData) { this.creditAnalysisData = []; } const existingIndex = this.creditAnalysisData.findIndex( item => item.parameterId === section.parameterId ); if (existingIndex === -1) { this.creditAnalysisData.push(section); this.creditAnalysisData.sort( (a, b) => (a.data?.sequence || a.sequence) - (b.data?.sequence || b.sequence) ); this.sequenceCreditAnalysisData = [...this.creditAnalysisData]; this.updateSectionData(section); } } updateSectionData(sectionData: any) { this.sectionDataChange.next(sectionData); } generateCAObject(data): any { if (this.creditAnalysisData && this.creditAnalysisData.length > 0) { const mergedSections = [...this.creditAnalysisData]; data?.forEach(newSection => { if ( !mergedSections.some( existing => existing.parameterId === newSection.parameterId ) ) { if (this.shouldIncludeSection(newSection)) { mergedSections.push(newSection); } } }); this.creditAnalysisData = mergedSections; } else { if ( this.templateId === TemplateEnum.Rbar || this.templateId === TemplateEnum.Standard ) { this.creditAnalysisData = data?.filter( obj => obj.isMandatory === true || obj.checked || obj.isSaved || obj.isDefaultView === true ); } else { this.creditAnalysisData = data?.filter( obj => obj.isMandatory === true || obj.checked || obj.isSaved ); } } this.sequenceCreditAnalysisData = this.creditAnalysisData; return this.creditAnalysisData; } private shouldIncludeSection(section: any): boolean { if ( this.templateId === TemplateEnum.Rbar || this.templateId === TemplateEnum.Standard ) { return ( section.isMandatory === true || section.checked === true || section.isSaved === true || section.isDefaultView === true ); } else { return ( section.isMandatory === true || section.checked === true || section.isSaved === true ); } } enableActionBox(data): any { for (const item of this.creditAnalysisData) { if (item.parameterId === data.parameterId && !item.isOpen) { item.isActionbox = true; item.isOpen = true; if (this.creditAnalysisService.isDragAndDropRequired) { this.enableDragndDrop = false; } } else { item.isActionbox = false; item.isOpen = false; } } return this.creditAnalysisData; } onEditAction(data): any { this.enableSimultaneous = false; let result; for (const obj of this.creditAnalysisData) { if (obj.parameterName === data.parameterName) { obj.isRTE = true; result = data.data.editorData; if (this.creditAnalysisService.isDragAndDropRequired) { this.enableDragndDrop = false; } } } return result; } onSaveAction(data, isSimultaneous?: boolean): any { if (data.data !== "" && data.data !== undefined) { this.timelineStatusService.updateStatus( data.parameterName, data.data?.editorData && data.data?.editorData !== "" ); for (const obj of this.creditAnalysisData) { if (obj.parameterName === data.parameterName) { obj.sectionDescription = data.data?.editorData; if (this.creditAnalysisService.isDragAndDropRequired) { this.enableDragndDrop = true; } obj.isRTE = false; if (isSimultaneous) { } else { this.collapseAll(); } } } } } collapseAll() { $(".collapse").collapse("hide"); for (const obj of this.creditAnalysisData) { obj.isActionbox = false; obj.isOpen = false; } if (this.creditAnalysisService.isDragAndDropRequired) { this.enableDragndDrop = true; } } ngOnDestroy(): void { this.enableDragndDrop = false; } }
Output for git.master, git.master_jit
Parse error: syntax error, unexpected token "{" in /in/JLCLn on line 3
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
142.56 ms | 1085 KiB | 8 Q