Sets $this->templateComposerJson using template composer.json file.

@return array
188491
protected function setTemplateComposerJson() {
    $file_name = $this->getConfigValue('repo.root') . '/vendor/acquia/blt/subtree-splits/blt-project/composer.json';
    if (file_exists($file_name)) {
      $template_composer_json = json_decode(file_get_contents($file_name, TRUE), TRUE);
      $this->templateComposerJson = $template_composer_json;

      return $template_composer_json;
    }

    return [];
  }
897916
protected function getValuesJSON() {
		$value = $this->value;
		if($value instanceof SS_List) {
			$values = $value->column($this->idField);
		}
		else if(is_array($value)) {
			$values = array_keys($value);
		}
		else if(is_string($value)) {
			$values = explode(',', $value);
			$values = str_replace('{comma}', ',', $values);
		}

		return $this->formatJSON($this->source->filter(array(
			$this->idField => $values
		)));
	}
769032
private function getProjectConfig()
    {
        $composerJsonPath = $this->projectDir.'/composer.json';
        if (!is_writable($composerJsonPath)) {
            return [];
        }

        return json_decode(file_get_contents($composerJsonPath), true);
    }
1094352
public function setJsonToArray($inputJson)
    {
        if (!$this->isJsonByDanielGP($inputJson)) {
            return ['error' => $this->lclMsgCmn('i18n_Error_GivenInputIsNotJson')];
        }
        $sReturn   = (json_decode($inputJson, true));
        $jsonError = $this->setJsonErrorInPlainEnglish();
        if ($jsonError == '') {
            return $sReturn;
        }
        return ['error' => $jsonError];
    }
1047816
public function setComposerSettings(array $composerSettings = [])
    {
        /**
         * If array is type array("config.value:true","require:library/src",)
         */
        $settings = [];
        foreach ($composerSettings as $index => $value) {
            if (is_numeric($index) && mb_strpos($value, ':') > 0) {
                $path = implode('', array_slice(explode(':', $value), 0, 1));
                $val = implode(':', array_slice(explode(':', $value), 1));
                self::dotNotationToArray($path, $val, $settings);
            } else {
                $settings[$index] = $value;
            }
        }
        return $this->setOptionValue(self::COMPOSER_SETTINGS, $settings);
    }
1265218
private function setupJson()
    {
        $this->io->title('Creating/updating composer.json');
        $this->app['extend.manager.json']->update();
        $this->io->success('Success');
    }
681466
public function composerFile(): string
    {
        if (!isset($this->cache[self::COMPOSER_FILE])) {
            $this->cache[self::COMPOSER_FILE] = $this->rootDir() . DIRECTORY_SEPARATOR . 'composer.json';
        }

        return $this->cache[self::COMPOSER_FILE];
    }
1218486
public function configureComposerJson(Event $event)
    {
        static::$plugin->getInstanceOf(ComposerConfigurator::class)->configure($event->getComposer(), $event->getIO());
    }
927999
public function formatTemplateFiles() : array
    {
        list(, $presenter) = \Nette\Application\Helpers::splitName($this->getName());
        $dir = dirname($this->getReflection()->getFileName());
        $dir = is_dir("{$dir}/templates") ? $dir : dirname($dir);
        return [
            "{$dir}/template/page/view/{$this->view}",
            "{$dir}/template/page/view/{$presenter}{$this->view}",
        ];
    }
426429
public function buildTemplateAction()
    {
        return [
            'type' => ActionType::DATETIME_PICKER,
            'label' => $this->label,
            'data' => $this->data,
            'mode' => $this->mode,
            'initial' => $this->initial,
            'max' => $this->max,
            'min' => $this->min,
        ];
    }
513948
protected function formatJSON()
    {
        $result = new \stdClass;

        if ($this->outputMode == self::MODE_ERROR) {
            $this->formatFailure($result);
        } else {
            $this->formatSuccess($result);
        }

        // only include if it has valid data
        if ($this->meta) {
            $result->meta = $this->meta;
        }

        return $result;
    }
468778
public function getTemplateDataByIdAction()
    {
        $request = $this->getRequest();
        $data    = array();

        if($request->isPost())
        {
            $templatesModel = $this->getServiceLocator()->get('MelisEngineTableTemplate');
            $templateId = $request->getPost('templateId');

            if(is_numeric($templateId))
                $data = $templatesModel->getEntryById($templateId);
        }

        return new JsonModel($data);
    }
422965
public static function SetTemplates ($templates = []) {
		if (gettype(static::$templates) == 'array') {
			static::$templates = (array) $templates;
		} else {
			static::$templates = (object) $templates;
		}
		return static::$templates;
	}
301234
private static function _getComposerJson()
	{
		self::_init();
		if (!self::$json)
		{
			$file = self::_getFactory()->getComposerFile();
			self::$json = new JsonFile($file);
		}
		return self::$json;
	}
987647
public function toJson() {
		$instanceArray['name'] = $this->name;
		$instanceArray['class'] = $this->getClassName();
		$instanceArray['anonymous'] = $this->isAnonymous();
		$instanceArray['type'] = $this->getType();
		
		if ($instanceArray['type'] == self::TYPE_DECLARATIVE) {
			$classDescriptor = $this->getClassDescriptor();
			
			$instanceArray['constructorArguments'] = array();
			foreach ($classDescriptor->getInjectablePropertiesByConstructor() as $propertyName=>$moufProperty) {
				$instanceArray['constructorArguments'][$propertyName] = $this->getConstructorArgumentProperty($propertyName)->toJson();
			}
	
			$instanceArray['properties'] = array();
			foreach ($classDescriptor->getInjectablePropertiesByPublicProperty() as $propertyName=>$moufProperty) {
				$instanceArray['properties'][$propertyName] = $this->getPublicFieldProperty($propertyName)->toJson();
			}
			
			$instanceArray['setters'] = array();
			foreach ($classDescriptor->getInjectablePropertiesBySetter() as $propertyName=>$moufProperty) {
				$instanceArray['setters'][$propertyName] = $this->getSetterProperty($propertyName)->toJson();
			}
			
			// Now, let's search for properties that would be declared in the configuration but that
			// would not exist in the code (this can happen if the property has been renamed in the code)
			$definedPublicProperties = $this->moufManager->getParameterNames($this->name);
			if ($definedPublicProperties) {
				$missingPublicProperties = array_diff($definedPublicProperties, array_keys($instanceArray['properties']));
				foreach ($missingPublicProperties as $missingPublicPropertyName) {
					$instanceArray['properties'][$missingPublicPropertyName] = [
						'warning' => "The public property '".$missingPublicPropertyName."' is declared but does not exist. It is likely it once existed but was renamed or removed.",
						'orphan' => true,
						'type' => null,
						'value' => null,
						'isset' => true,
						'origin' => null,
						'metadata' => null
					];
				}
			}
			
			$definedSetters = $this->moufManager->getParameterNamesForSetter($this->name);
			if ($definedSetters) {
				$missingSetters = array_diff($definedSetters, array_keys($instanceArray['setters']));
				foreach ($missingSetters as $missingSetterName) {
					$instanceArray['setters'][$missingSetterName] = [
					'warning' => "The setter '".$missingSetterName."' is declared but does not exist. It is likely it once existed but was renamed or removed.",
					'orphan' => true,
					'type' => null,
					'value' => null,
					'isset' => true,
					'origin' => null,
					'metadata' => null
					];
				}
			}
				
			$definedConstructorArguments = $this->moufManager->getParameterNamesForConstructor($this->name);
			if ($definedConstructorArguments) {
				$constructor = $classDescriptor->getConstructor();
				if ($constructor) {
					$nbParameters = $classDescriptor->getConstructor()->getNumberOfParameters();
				} else {
					$nbParameters = 0;
				}
				$missingConstructorArguments = array_filter($definedConstructorArguments, function($nb) use ($nbParameters) { return $nbParameters <= $nb; });
				foreach ($missingConstructorArguments as $missingConstructorArgument) {
					$instanceArray['constructorArguments'][$missingConstructorArgument] = [
					'warning' => "The constructor argument n°'".$missingConstructorArgument."' is declared but does not exist. It is likely it once existed but was removed.",
					'orphan' => true,
					'type' => null,
					'value' => null,
					'isset' => true,
					'origin' => null,
					'metadata' => null
					];
				}
			}
			
		} else {
			$instanceArray['code'] = $this->getCode();
		}
		
		return $instanceArray;
	}
962909
public function onCreateTemplate()
    {
        $type = Request::input('type');
        $template = $this->createTemplate($type);

        if ($type === 'asset') {
            $template->fileName = $this->widget->assetList->getCurrentRelativePath();
        }

        $widget = $this->makeTemplateFormWidget($type, $template);

        $this->vars['templatePath'] = '';

        return [
            'tabTitle' => $this->getTabTitle($type, $template),
            'tab'      => $this->makePartial('form_page', [
                'form'          => $widget,
                'templateType'  => $type,
                'templateTheme' => $this->theme->getDirName(),
                'templateMtime' => null
            ])
        ];
    }
981175
public function json_init()
    {
        if (!($this->output instanceof rcmail_output_json)) {
            $this->output = new rcmail_output_json($this->task);
        }

        return $this->output;
    }