\Composer\ConfigJsonConfigSource

JSON Configuration Source

Summary

Methods
Properties
Constants
__construct()
getName()
addRepository()
removeRepository()
addConfigSetting()
removeConfigSetting()
addProperty()
removeProperty()
addLink()
removeLink()
No public properties found
No constants found
manipulateJson()
No protected properties found
N/A
arrayUnshiftRef()
$file
$authConfig
N/A

Properties

$authConfig

$authConfig : boolean

Type

boolean

Methods

__construct()

__construct(\Composer\Json\JsonFile  $file, boolean  $authConfig = false) 

Constructor

Parameters

\Composer\Json\JsonFile $file
boolean $authConfig

getName()

getName() : string

Gives a user-friendly name to this source (file path or so)

Returns

string

addRepository()

addRepository(string  $name, array  $config) 

Add a repository

Parameters

string $name

Name

array $config

Configuration

removeRepository()

removeRepository(string  $name) 

Remove a repository

Parameters

string $name

addConfigSetting()

addConfigSetting(string  $name, string  $value) 

Add a config setting

Parameters

string $name

Name

string $value

Value

removeConfigSetting()

removeConfigSetting(string  $name) 

Remove a config setting

Parameters

string $name

addProperty()

addProperty(string  $name, string  $value) 

Add a property

Parameters

string $name

Name

string $value

Value

removeProperty()

removeProperty(string  $name) 

Remove a property

Parameters

string $name

addLink()

addLink(string  $type, string  $name, string  $value) 

Add a package link

Parameters

string $type

Type (require, require-dev, provide, suggest, replace, conflict)

string $name

Name

string $value

Value

removeLink()

removeLink(string  $type, string  $name) 

Remove a package link

Parameters

string $type

Type (require, require-dev, provide, suggest, replace, conflict)

string $name

Name

manipulateJson()

manipulateJson(  $method,   $args,   $fallback) 

Parameters

$method
$args
$fallback

arrayUnshiftRef()

arrayUnshiftRef(array  $array, mixed  $value) : array

Prepend a reference to an element to the beginning of an array.

Parameters

array $array
mixed $value

Returns

array