Return the composer json file and json manipulator.

@throws \InvalidArgumentException

@return array
492786
public static function getComposerJsonFileAndManipulator(): array
    {
        $json        = new JsonFile(Factory::getComposerFile());
        $manipulator = new JsonManipulator(\file_get_contents($json->getPath()));

        return [$json, $manipulator];
    }
762416
protected function getComposePsrNamespaceList() : array {
        $jsonFilePath = $this->annotationConfig->getConfig()['composerFilePath'];
        if ( !file_exists($jsonFilePath)) throw new AnnotationException('Build Annotation error , composer.json file not found ' . $jsonFilePath);
        return json_decode(file_get_contents($jsonFilePath) , true);
    }
1278878
public function GetComposer() {

		$filepath = "{$this->ProjectRoot}/composer.json";

		try { $composer = new Nether\Project\Composer($filepath); }
		catch(Exception $e) {
			$this->ShowMessage($e->getMessage());
			exit(0);
		}

		return $composer;
	}
933236
protected function setComposerJson() {
    if (file_exists($this->getConfigValue('repo.root') . '/composer.json')) {
      $composer_json = json_decode(file_get_contents($this->getConfigValue('repo.root') . '/composer.json'), TRUE);
      $this->composerJson = $composer_json;

      return $composer_json;
    }

    return [];
  }
918403
public function jsonSerialize() {
    return [
      'request-id'            => $this->requestId,
      'file-urls'             => $this->fileUrls,
      'original-file-size'    => $this->originalFileSize,
      'compressed-file-size'  => $this->compressedFileSize,
      'percentage-saving'     => $this->percentageSaving(),
      'compression-ratio'     => $this->compressionRatio(),
    ];
  }
970022
public function jsonSerialize() {
		return [
			self::JSON_KEY_GET          => $this->get,
			self::JSON_KEY_POST         => $this->post,
			self::JSON_KEY_FILES        => $this->files,
			self::JSON_KEY_COOKIE       => $this->cookie,
			self::JSON_KEY_HEADERS      => $this->HEADERS,
			self::JSON_KEY_METHOD       => $this->getRequestMethod(),
			self::JSON_KEY_INPUT        => $this->INPUT,
			self::JSON_KEY_PARSED_INPUT => $this->PARSED_INPUT,
			self::JSON_KEY_REQUEST_URI  => $this->getRequestUri(),

			self::JSON_KEY_PARSED_REQUEST_URI => $this->parsedUri,
		];
	}
1206089
public static function getJson()
    {
        if (!static::$json) {
            $root = Ioc::getConfig()->get('path.root');
            $file = realpath($root . '/composer.json');

            static::$json = new Structure(is_file($file) ? file_get_contents($file) : null);
        }

        return static::$json;
    }
1055808
public function getJson()
	{
		// Get message and aps array to create JSON from
		$message = array();
		$aps = array();

		// If we have a payload replace the message object by the payload
		if (null !== $this->payload) {
			$message = $this->payload;
		}

		// Add the alert if any
		if (null !== $this->alert) {
			$aps['alert'] = $this->alert;
		}

		// Add the badge if any
		if (null !== $this->badge) {
			$aps['badge'] = $this->badge;
		}

		// Add the sound if any
		if (null !== $this->sound) {
			$aps['sound'] = $this->sound;
		}

		// Add category identifier if any
		if (null !== $this->category) {
			$aps['category'] = $this->category;
		}

		// Add the content-available flag if set
		if (true == $this->contentAvailable) {
			$aps['content-available'] = 1;
		}

		// Check if APS data is set
		if (count($aps) > 0) {
			$message['aps'] = $aps;
		}

		// Encode as JSON object
		$json = json_encode($message);
		if (false == $json) {
			throw new \RuntimeException('Failed to convert APNS\Message to JSON, are all strings UTF-8?', json_last_error());
		}

		return $json;
	}
952221
public static function getModuleFiles(?string $path = null): array
    {
        $configs = [];

        if (empty($path)) {
            throw new InvalidArgumentException((string)__('Specify [path] for the JSON configs'));
        }

        $folder = new Folder($path);
        $files = $folder->findRecursive('.*\.json');

        if (!empty($files)) {
            $configs = $files;
        }

        return $configs;
    }
70087
public function getCode()
    {
        $data = [
            'suite_id' => $this->getSuiteId(),
        ];

        $result = $this->parseJSON('json', [self::GET_PRE_AUTH_CODE, $data]);

        if (empty($result['pre_auth_code'])) {
            throw new InvalidArgumentException('Invalid response.');
        }

        return $result['pre_auth_code'];
    }
663145
public function composer()
    {
        $this->headers['headers'] = ['Accept' => 'application/json'];

        try {
            if ($this->isRunningGuzzle5()) {
                $this->headers['body'] = ['lock' => fopen(config('eyewitness.composer_lock_file_location'), 'r')];
            } else {
                $this->headers['multipart'] = [['name' => 'lock', 'contents' => fopen(config('eyewitness.composer_lock_file_location'), 'r')]];
            }
            $response = $this->client->post('https://security.sensiolabs.org/check_lock', $this->headers);
            return json_decode($response->getBody()->getContents(), true);
        } catch (Exception $e) {
            app(Eye::class)->logger()->error('SensioLabs Composer Lock check failed', $e);
        }

        return null;
    }
1357669
public function jsonSerialize()
    {
        $json = [];

        foreach (['code', 'message', 'description', 'uri'] as $field) {
            if ($this->$field !== null) {
                $json[$field] = $this->$field;
            }
        }

        return $json;
    }
981361
public function toJson()
    {
        array_walk_recursive($this->params, function (&$value) {
            $value = (string) $value;
        });
        return json_encode($this->params);
    }
20542
public function toJson() {
    	$result = array();
    	$result['name'] = $this->getName();
    
    	$modifier = "";
    	if ($this->isPublic()) {
    		$modifier = "public";
    	} elseif ($this->isProtected()) {
    		$modifier = "protected";
    	} elseif ($this->isPrivate()) {
    		$modifier = "private";
    	}
    	$result['modifier'] = $modifier;
    	$result['static'] = $this->isStatic();
    	$result['abstract'] = $this->isAbstract();
    	$result['constructor'] = $this->isConstructor();
    	$result['final'] = $this->isFinal();
    	//$result['comment'] = $this->getDocComment();
    	$result['comment'] = $this->getMoufPhpDocComment()->getJsonArray();
    
    	$result['parameters'] = array();
    	$parameters = $this->getParameters();
    	foreach ($parameters as $parameter) {
    		$result['parameters'][] = $parameter->toJson();
    	}
    
    	//$properties = $this->getAnnotations("Property");
    	try {
    		/*if (!empty($properties)) {
    		 $result['moufProperty'] = true;*/
    		
    		// TODO: is there a need to instanciate a  MoufPropertyDescriptor?
    		
    		// If this is a setter only:
    		
    		if ($this->isSetter()) {
	    		$moufPropertyDescriptor = new MoufPropertyDescriptor($this);
	    		$types = $moufPropertyDescriptor->getTypes();
	    		$result['types'] = $types->toJson();
	    		
	    		if ($types->getWarningMessage()) {
	    			$result['classinerror'] = $types->getWarningMessage();
	    		}
    		}
    		
    		/*if ($moufPropertyDescriptor->isAssociativeArray()) {
    			$result['keytype'] = $moufPropertyDescriptor->getKeyType();
    		}
    		if ($moufPropertyDescriptor->isArray()) {
    			$result['subtype'] = $moufPropertyDescriptor->getSubType();
    		}*/
    		//}
    	} catch (\Exception $e) {
    		$result['classinerror'] = $e->getMessage();
    	}
    	
    
    	return $result;
    }
914874
public function toJson()
    {
        $array = array();
        foreach ($this->disclose() as $key => $disclosure) {
            $values = $disclosure->toArray();
            foreach ($values as &$value) {
                $value = utf8_encode($value);
            }
            $array[$key] = $values;
        }
        return json_encode($array);
    }
233430
function jsonSerialize()
    {
        $result = [
            'title'        => $this->getTitle(),
            'link'         => $this->getLink(),
            'publicId'     => $this->getPublicId(),
            'description'  => $this->getDescription(),
            'lastModified' => $this->getLastModified()->format(\DateTime::ATOM),
            'url'          => $this->getUrl(),
            'items'        => $this->getItems(),
            'relations'    => $this->getRelations(),
        ];
        return $result;
    }
812279
private function getComposer(): string
    {
        $filePath = $this->app->basePath('composer.json');

        if (! File::exists($filePath)) {
            $this->app->abort(400, 'The file composer.json not found');
        }

        return File::get($filePath);
    }