PHP Class Leafo\ScssPhp\Compiler

Author: Leaf Corcoran ([email protected])
Afficher le fichier Open project: leafo/scssphp Class Usage Examples

Méthodes publiques

Свойство Type Description
$defaultValue
$emptyList
$emptyMap
$emptyString
$false
$null
$nullString
$selfSelector
$true
$with
$without

Protected Properties

Свойство Type Description
$charsetSeen
$encoding
$env
$formatter
$importCache
$importPaths
$importedFiles
$libAbs
$libAdjustColor
$libAdjustHue
$libAlpha
$libAppend
$libBlue
$libCeil
$libChangeColor
$libComparable
$libComplement
$libDarken
$libDesaturate
$libFadeIn
$libFadeOut
$libFeatureExists
$libFloor
$libFunctionExists
$libGlobalVariableExists
$libGrayscale
$libGreen
$libHsl
$libHsla
$libHue
$libIeHexStr
$libIf
$libIndex
$libInspect
$libInvert
$libJoin
$libKeywords
$libLength
$libLighten
$libLightness
$libMapGet
$libMapHasKey
$libMapKeys
$libMapMerge
$libMapRemove
$libMapValues
$libMix mix two colors
$libMixinExists
$libNth
$libOpacify increases opacity by amount
$libOpacity
$libPercentage
$libQuote
$libRandom
$libRed
$libRgb
$libRgba
$libRound
$libSaturate
$libSaturation
$libScaleColor
$libSetNth
$libStrIndex
$libStrInsert
$libStrLength
$libStrSlice
$libToLowerCase
$libToUpperCase
$libTransparentize decreases opacity by amount
$libTypeOf
$libUnit
$libUnitless
$libUnquote
$libVariableExists
$lineNumberStyle
$namespaces array
$operatorNames array
$registeredFeatures
$registeredVars
$rootBlock
$rootEnv
$scope
$sourceNames
$storeEnv
$userFunctions

Méthodes publiques

Méthode Description
__construct ( ) Constructor
addFeature ( string $name ) Add feature
addImportPath ( string $path ) Add import path
addParsedFile ( string $path ) Adds to list of parsed files
assertColor ( array $value ) : array Assert value is a color
assertList ( array $value ) : array Assert value is a list
assertMap ( array $value ) : array Assert value is a map
assertNumber ( array $value ) : integer | float Assert value is a number
compile ( string $code, string $path = null ) : string Compile scss
compileValue ( array $value ) : string Compiles a primitive value into a CSS property value.
findImport ( string $url ) : string | null Return the file path for an import url if it exists
get ( string $name, boolean $shouldThrow = true, Leafo\ScssPhp\Compiler\Environment $env = null ) : mixed Get variable
getParsedFiles ( ) : array Returns list of parsed files
getVariables ( ) : array Returns list of variables
normalizeValue ( array $value ) : array Normalize value
registerFunction ( string $name, callable $func, array $prototype = null ) Register function
setEncoding ( string $encoding ) Set encoding
setFormatter ( string $formatterName ) Set formatter
setIgnoreErrors ( boolean $ignoreErrors ) : Compiler Ignore errors?
setImportPaths ( string | array $path ) Set import paths
setLineNumberStyle ( string $lineNumberStyle ) Set line number style
setNumberPrecision ( integer $numberPrecision ) Set number precision
setVariables ( array $variables ) Set variables
throwError ( string $msg ) Throw error (exception)
toBool ( mixed $thing ) : array Cast to boolean
toHSL ( integer $red, integer $green, integer $blue ) : array Convert RGB to HSL
toRGB ( integer $hue, integer $saturation, integer $lightness ) : array Convert HSL to RGB
unregisterFunction ( string $name ) Unregister function
unsetVariable ( string $name ) Unset variable

Méthodes protégées

Méthode Description
adjustHsl ( $color, $idx, $amount )
alterColor ( $args, $fn ) helper function for adjust_color, change_color, and scale_color
applyArguments ( array $argDef, array $argValues ) Apply argument values per definition
callNativeFunction ( string $name, array $args, array &$returnValue ) : boolean Call built-in and registered (PHP) functions
callScssFunction ( string $name, $argValues, array &$returnValue ) : boolean Call SCSS @function
coerceColor ( array $value ) : array | null Coerce value to color
coerceForExpression ( array $value ) : array | null Coerce color for expression
coerceList ( array $item, $delim = ',' ) : array Coerce something to list
coerceMap ( array $item ) : array Coerce something to map
coercePercent ( array $value ) : integer | float Coerce value to a percentage
coerceString ( array $value ) : array | null Coerce value to string
collapseSelectors ( array $selectors ) : string Collapse selectors
combineSelectorSingle ( array $base, array $other ) : array Combine selector single
compileAtRoot ( Leafo\ScssPhp\Block $block ) Compile at-root
compileBlock ( Leafo\ScssPhp\Block $block ) Recursively compiles a block.
compileChild ( array $child, Leafo\ScssPhp\Formatter\OutputBlock $out ) : array Compile child; returns a value to halt execution
compileChildren ( array $stms, Leafo\ScssPhp\Formatter\OutputBlock $out ) : array Compile children and return result
compileChildrenNoReturn ( array $stms, Leafo\ScssPhp\Formatter\OutputBlock $out ) Compile children and throw exception if unexpected @return
compileComment ( array $block ) Compile root level comment
compileDirective ( Leafo\ScssPhp\Block $block ) Compile directive
compileImport ( array $rawPath, array $out, boolean $once = false ) : boolean Compile import; returns true if the value was something that could be imported
compileKeyframeBlock ( Leafo\ScssPhp\Block $block, array $selectors ) Compile keyframe block
compileMedia ( Leafo\ScssPhp\Block $media ) Compile media
compileMediaQuery ( array $queryList ) : string Compile media query
compileNestedBlock ( Leafo\ScssPhp\Block $block, array $selectors ) Compile nested block
compileRoot ( Leafo\ScssPhp\Block $rootBlock ) Compile root
compileSelector ( array $selector ) : string Compile selector to string; self(&) should have been replaced by now
compileSelectorPart ( arary $piece ) : string Compile selector part
compileStringContent ( array $string ) : string Compile string content
evalSelector ( array $selector ) : array Evaluate selector
evalSelectorPart ( array $part ) : array Evaluate selector part; replaces all the interpolates, stripping quotes
evalSelectors ( array $selectors ) : array Evaluate selectors
expToString ( array $exp ) : array Reduce expression to string
extractInterpolation ( array $list ) : array Extract interpolation; it doesn't need to be recursive, compileValue will handle that
extractRelationshipFromFragment ( array $fragment ) : array Extract a relationship from the fragment.
fileExists ( string $name ) : boolean Does file exist?
fixColor ( array $c ) : array Make sure a color's components don't go out of bounds
flattenList ( array $list ) : string Flatten list
flattenSelectorSingle ( array $single ) : array Flatten selector single; joins together .classes and #ids
flattenSelectors ( Leafo\ScssPhp\Formatter\OutputBlock $block, string $parentKey = null ) Flatten selectors
getBuiltinFunction ( string $name ) : array Get built-in function
getNormalizedNumbers ( array $args ) : array Helper to normalize args containing numbers
getStoreEnv ( ) : Leafo\ScssPhp\Compiler\Environment Get store environment
handleImportLoop ( string $name ) Handle import loop
has ( string $name, Leafo\ScssPhp\Compiler\Environment $env = null ) : boolean Has variable?
hasSelectorPlaceholder ( array $selector ) : boolean Has selector placeholder?
importFile ( string $path, array $out ) Import file
injectVariables ( array $args ) Inject variables
isImmediateRelationshipCombinator ( string $value ) : boolean Is the value a direct relationship combinator?
isSelfExtend ( array $target, array $origin ) : boolean Is self extend?
isTruthy ( array $value ) : array Is truthy?
joinSelectors ( array $parent, array $child ) : array Join selectors; looks for & to replace, or append parent before child
libAbs ( $args )
libAdjustColor ( $args )
libAdjustHue ( $args )
libAlpha ( $args )
libAppend ( $args )
libBlue ( $args )
libCall ( $args, $kwargs ) protected static $libCall = ['name', 'args.
libCeil ( $args )
libChangeColor ( $args )
libComparable ( $args )
libComplement ( $args )
libCounter ( array $args ) Workaround IE7's content counter bug.
libDarken ( $args )
libDesaturate ( $args )
libFadeIn ( $args )
libFadeOut ( $args )
libFeatureExists ( $args )
libFloor ( $args )
libFunctionExists ( $args )
libGlobalVariableExists ( $args )
libGrayscale ( $args )
libGreen ( $args )
libHsl ( $args )
libHsla ( $args )
libHue ( $args )
libIeHexStr ( $args )
libIf ( $args )
libIndex ( $args )
libInspect ( $args )
libInvert ( $args )
libJoin ( $args )
libKeywords ( $args )
libLength ( $args )
libLighten ( $args )
libLightness ( $args )
libListSeparator ( $args ) protected static $libListSeparator = ['list.
libMapGet ( $args )
libMapHasKey ( $args )
libMapKeys ( $args )
libMapMerge ( $args )
libMapRemove ( $args )
libMapValues ( $args )
libMax ( $args )
libMin ( $args )
libMix ( $args )
libMixinExists ( $args )
libNth ( $args )
libOpacify ( $args )
libOpacity ( $args )
libPercentage ( $args )
libQuote ( $args )
libRandom ( $args )
libRed ( $args )
libRgb ( $args )
libRgba ( $args )
libRound ( $args )
libSaturate ( $args )
libSaturation ( $args )
libScaleColor ( $args )
libSetNth ( $args )
libStrIndex ( $args )
libStrInsert ( $args )
libStrLength ( $args )
libStrSlice ( $args )
libToLowerCase ( $args )
libToUpperCase ( $args )
libTransparentize ( $args )
libTypeOf ( $args )
libUniqueId ( )
libUnit ( $args )
libUnitless ( $args )
libUnquote ( $args )
libVariableExists ( $args )
libZip ( $args )
listSeparatorForJoin ( $list1, $sep )
makeOutputBlock ( string $type, array $selectors = null ) : Leafo\ScssPhp\Formatter\OutputBlock Make output block
matchExtends ( array $selector, array &$out, integer $from, boolean $initial = true ) Match extends
matchExtendsSingle ( array $rawSingle, array &$outOrigin ) : boolean Match extends single
mediaParent ( Leafo\ScssPhp\Formatter\OutputBlock $scope ) : Leafo\ScssPhp\Formatter\OutputBlock Media parent
mergeDirectRelationships ( $selectors1, $selectors2 )
mergeMediaTypes ( array $type1, array $type2 ) : array | null Merge media types
missingSelectors ( ) Report missing selectors
multiplyMedia ( Leafo\ScssPhp\Compiler\Environment $env = null, array $childQueries = null ) : array Multiply media
multiplySelectors ( Leafo\ScssPhp\Compiler\Environment $env ) : array Find the final set of selectors
normalizeName ( string $name ) : string Normalize name
opAdd ( array $left, array $right ) : array Add strings
opAddNumberNumber ( array $left, array $right ) : array Add numbers
opAnd ( array $left, array $right, boolean $shouldEval ) : array Boolean and
opCmpNumberNumber ( array $left, array $right ) : array Three-way comparison, aka spaceship operator
opColorColor ( string $op, array $left, array $right ) : array Compare colors
opColorNumber ( string $op, array $left, array $right ) : array Compare color and number
opDivNumberNumber ( array $left, array $right ) : array Divide numbers
opEq ( array $left, array $right ) : array Compare number1 == number2
opGtNumberNumber ( array $left, array $right ) : array Compare number1 > number2
opGteNumberNumber ( array $left, array $right ) : array Compare number1 >= number2
opLtNumberNumber ( array $left, array $right ) : array Compare number1 < number2
opLteNumberNumber ( array $left, array $right ) : array Compare number1 <= number2
opModNumberNumber ( array $left, array $right ) : array Mod numbers
opMulNumberNumber ( array $left, array $right ) : array Multiply numbers
opNeq ( array $left, array $right ) : array Compare number1 != number2
opNumberColor ( string $op, array $left, array $right ) : array Compare number and color
opOr ( array $left, array $right, boolean $shouldEval ) : array Boolean or
opSubNumberNumber ( array $left, array $right ) : array Subtract numbers
parserFactory ( string $path ) : Parser Instantiate parser
popEnv ( ) Pop environment
pushEnv ( Leafo\ScssPhp\Block $block = null ) : Leafo\ScssPhp\Compiler\Environment Push environment
pushExtends ( array $target, array $origin, stdClass $block ) Push extends
reduce ( array $value, boolean $inExp = false ) : array Reduce value
set ( string $name, mixed $value, boolean $shadow = false, Leafo\ScssPhp\Compiler\Environment $env = null ) Set variable
setExisting ( string $name, mixed $value, Leafo\ScssPhp\Compiler\Environment $env ) Set existing variable
setRaw ( string $name, mixed $value, Leafo\ScssPhp\Compiler\Environment $env ) Set raw variable
shouldEval ( array $value ) : boolean Should $value cause its operand to eval
sortArgs ( array $prototype, array $args ) : array Sorts keyword arguments

Private Methods

Méthode Description
coerceValue ( mixed $value ) : array Coerce a php value into a scss one
compactEnv ( Leafo\ScssPhp\Compiler\Environment $env ) : array Convert env linked list to stack
compileWith ( array $with ) : integer Compile @at-root's with: inclusion / without: exclusion into filter flags
extractEnv ( array $envs ) : Leafo\ScssPhp\Compiler\Environment Convert env stack to singly linked list
filterWithout ( array $envs, integer $without ) : Leafo\ScssPhp\Compiler\Environment Filter env stack
fncall ( string $name, array $argValues ) : array | null Function caller
hueToRGB ( float $m1, float $m2, float $h ) : float Hue to RGB helper
isWithout ( integer $without, Leafo\ScssPhp\Block $block ) : boolean Filter WITH rules
spliceTree ( array $envs, Leafo\ScssPhp\Block $block, integer $without ) : array Splice parse tree

Method Details

__construct() public méthode

Constructor
public __construct ( )

addFeature() public méthode

Add feature
public addFeature ( string $name )
$name string

addImportPath() public méthode

Add import path
public addImportPath ( string $path )
$path string

addParsedFile() public méthode

Adds to list of parsed files
public addParsedFile ( string $path )
$path string

adjustHsl() protected méthode

protected adjustHsl ( $color, $idx, $amount )

alterColor() protected méthode

helper function for adjust_color, change_color, and scale_color
protected alterColor ( $args, $fn )

applyArguments() protected méthode

Apply argument values per definition
protected applyArguments ( array $argDef, array $argValues )
$argDef array
$argValues array

assertColor() public méthode

Assert value is a color
public assertColor ( array $value ) : array
$value array
Résultat array

assertList() public méthode

Assert value is a list
public assertList ( array $value ) : array
$value array
Résultat array

assertMap() public méthode

Assert value is a map
public assertMap ( array $value ) : array
$value array
Résultat array

assertNumber() public méthode

Assert value is a number
public assertNumber ( array $value ) : integer | float
$value array
Résultat integer | float

callNativeFunction() protected méthode

Call built-in and registered (PHP) functions
protected callNativeFunction ( string $name, array $args, array &$returnValue ) : boolean
$name string
$args array
$returnValue array
Résultat boolean Returns true if returnValue is set; otherwise, false

callScssFunction() protected méthode

Call SCSS @function
protected callScssFunction ( string $name, $argValues, array &$returnValue ) : boolean
$name string
$returnValue array
Résultat boolean Returns true if returnValue is set; otherwise, false

coerceColor() protected méthode

Coerce value to color
protected coerceColor ( array $value ) : array | null
$value array
Résultat array | null

coerceForExpression() protected méthode

Coerce color for expression
protected coerceForExpression ( array $value ) : array | null
$value array
Résultat array | null

coerceList() protected méthode

Coerce something to list
protected coerceList ( array $item, $delim = ',' ) : array
$item array
Résultat array

coerceMap() protected méthode

Coerce something to map
protected coerceMap ( array $item ) : array
$item array
Résultat array

coercePercent() protected méthode

Coerce value to a percentage
protected coercePercent ( array $value ) : integer | float
$value array
Résultat integer | float

coerceString() protected méthode

Coerce value to string
protected coerceString ( array $value ) : array | null
$value array
Résultat array | null

collapseSelectors() protected méthode

Collapse selectors
protected collapseSelectors ( array $selectors ) : string
$selectors array
Résultat string

combineSelectorSingle() protected méthode

Combine selector single
protected combineSelectorSingle ( array $base, array $other ) : array
$base array
$other array
Résultat array

compile() public méthode

Compile scss
public compile ( string $code, string $path = null ) : string
$code string
$path string
Résultat string

compileAtRoot() protected méthode

Compile at-root
protected compileAtRoot ( Leafo\ScssPhp\Block $block )
$block Leafo\ScssPhp\Block

compileBlock() protected méthode

A block is analogous to a CSS block in most cases. A single SCSS document is encapsulated in a block when parsed, but it does not have parent tags so all of its children appear on the root level when compiled. Blocks are made up of selectors and children. The children of a block are just all the blocks that are defined within. Compiling the block involves pushing a fresh environment on the stack, and iterating through the props, compiling each one.
See also: Compiler::compileChild()
protected compileBlock ( Leafo\ScssPhp\Block $block )
$block Leafo\ScssPhp\Block

compileChild() protected méthode

Compile child; returns a value to halt execution
protected compileChild ( array $child, Leafo\ScssPhp\Formatter\OutputBlock $out ) : array
$child array
$out Leafo\ScssPhp\Formatter\OutputBlock
Résultat array

compileChildren() protected méthode

Compile children and return result
protected compileChildren ( array $stms, Leafo\ScssPhp\Formatter\OutputBlock $out ) : array
$stms array
$out Leafo\ScssPhp\Formatter\OutputBlock
Résultat array

compileChildrenNoReturn() protected méthode

Compile children and throw exception if unexpected @return
protected compileChildrenNoReturn ( array $stms, Leafo\ScssPhp\Formatter\OutputBlock $out )
$stms array
$out Leafo\ScssPhp\Formatter\OutputBlock

compileComment() protected méthode

Compile root level comment
protected compileComment ( array $block )
$block array

compileDirective() protected méthode

Compile directive
protected compileDirective ( Leafo\ScssPhp\Block $block )
$block Leafo\ScssPhp\Block

compileImport() protected méthode

Compile import; returns true if the value was something that could be imported
protected compileImport ( array $rawPath, array $out, boolean $once = false ) : boolean
$rawPath array
$out array
$once boolean
Résultat boolean

compileKeyframeBlock() protected méthode

Compile keyframe block
protected compileKeyframeBlock ( Leafo\ScssPhp\Block $block, array $selectors )
$block Leafo\ScssPhp\Block
$selectors array

compileMedia() protected méthode

Compile media
protected compileMedia ( Leafo\ScssPhp\Block $media )
$media Leafo\ScssPhp\Block

compileMediaQuery() protected méthode

Compile media query
protected compileMediaQuery ( array $queryList ) : string
$queryList array
Résultat string

compileNestedBlock() protected méthode

Compile nested block
protected compileNestedBlock ( Leafo\ScssPhp\Block $block, array $selectors )
$block Leafo\ScssPhp\Block
$selectors array

compileRoot() protected méthode

Compile root
protected compileRoot ( Leafo\ScssPhp\Block $rootBlock )
$rootBlock Leafo\ScssPhp\Block

compileSelector() protected méthode

Compile selector to string; self(&) should have been replaced by now
protected compileSelector ( array $selector ) : string
$selector array
Résultat string

compileSelectorPart() protected méthode

Compile selector part
protected compileSelectorPart ( arary $piece ) : string
$piece arary
Résultat string

compileStringContent() protected méthode

Compile string content
protected compileStringContent ( array $string ) : string
$string array
Résultat string

compileValue() public méthode

Values in scssphp are typed by being wrapped in arrays, their format is typically: array(type, contents [, additional_contents]*) The input is expected to be reduced. This function will not work on things like expressions and variables.
public compileValue ( array $value ) : string
$value array
Résultat string

evalSelector() protected méthode

Evaluate selector
protected evalSelector ( array $selector ) : array
$selector array
Résultat array

evalSelectorPart() protected méthode

Evaluate selector part; replaces all the interpolates, stripping quotes
protected evalSelectorPart ( array $part ) : array
$part array
Résultat array

evalSelectors() protected méthode

Evaluate selectors
protected evalSelectors ( array $selectors ) : array
$selectors array
Résultat array

expToString() protected méthode

Reduce expression to string
protected expToString ( array $exp ) : array
$exp array
Résultat array

extractInterpolation() protected méthode

Extract interpolation; it doesn't need to be recursive, compileValue will handle that
protected extractInterpolation ( array $list ) : array
$list array
Résultat array

extractRelationshipFromFragment() protected méthode

When extracting the last portion of a selector we will be left with a fragment which may end with a direction relationship combinator. This method will extract the relationship fragment and return it along side the rest.
protected extractRelationshipFromFragment ( array $fragment ) : array
$fragment array The selector fragment maybe ending with a direction relationship combinator.
Résultat array The selector without the relationship fragment if any, the relationship fragment.

fileExists() protected méthode

Does file exist?
protected fileExists ( string $name ) : boolean
$name string
Résultat boolean

findImport() public méthode

Return the file path for an import url if it exists
public findImport ( string $url ) : string | null
$url string
Résultat string | null

fixColor() protected méthode

Make sure a color's components don't go out of bounds
protected fixColor ( array $c ) : array
$c array
Résultat array

flattenList() protected méthode

Flatten list
protected flattenList ( array $list ) : string
$list array
Résultat string

flattenSelectorSingle() protected méthode

Flatten selector single; joins together .classes and #ids
protected flattenSelectorSingle ( array $single ) : array
$single array
Résultat array

flattenSelectors() protected méthode

Flatten selectors
protected flattenSelectors ( Leafo\ScssPhp\Formatter\OutputBlock $block, string $parentKey = null )
$block Leafo\ScssPhp\Formatter\OutputBlock
$parentKey string

get() public méthode

Get variable
public get ( string $name, boolean $shouldThrow = true, Leafo\ScssPhp\Compiler\Environment $env = null ) : mixed
$name string
$shouldThrow boolean
$env Leafo\ScssPhp\Compiler\Environment
Résultat mixed

getBuiltinFunction() protected méthode

Get built-in function
protected getBuiltinFunction ( string $name ) : array
$name string Normalized name
Résultat array

getNormalizedNumbers() protected méthode

Helper to normalize args containing numbers
protected getNormalizedNumbers ( array $args ) : array
$args array
Résultat array

getParsedFiles() public méthode

Returns list of parsed files
public getParsedFiles ( ) : array
Résultat array

getStoreEnv() protected méthode

Get store environment
protected getStoreEnv ( ) : Leafo\ScssPhp\Compiler\Environment
Résultat Leafo\ScssPhp\Compiler\Environment

getVariables() public méthode

Returns list of variables
public getVariables ( ) : array
Résultat array

handleImportLoop() protected méthode

Handle import loop
protected handleImportLoop ( string $name )
$name string

has() protected méthode

Has variable?
protected has ( string $name, Leafo\ScssPhp\Compiler\Environment $env = null ) : boolean
$name string
$env Leafo\ScssPhp\Compiler\Environment
Résultat boolean

hasSelectorPlaceholder() protected méthode

Has selector placeholder?
protected hasSelectorPlaceholder ( array $selector ) : boolean
$selector array
Résultat boolean

importFile() protected méthode

Import file
protected importFile ( string $path, array $out )
$path string
$out array

injectVariables() protected méthode

Inject variables
protected injectVariables ( array $args )
$args array

isImmediateRelationshipCombinator() protected méthode

Is the value a direct relationship combinator?
protected isImmediateRelationshipCombinator ( string $value ) : boolean
$value string
Résultat boolean

isSelfExtend() protected méthode

Is self extend?
protected isSelfExtend ( array $target, array $origin ) : boolean
$target array
$origin array
Résultat boolean

isTruthy() protected méthode

Is truthy?
protected isTruthy ( array $value ) : array
$value array
Résultat array

joinSelectors() protected méthode

Join selectors; looks for & to replace, or append parent before child
protected joinSelectors ( array $parent, array $child ) : array
$parent array
$child array
Résultat array

libAbs() protected méthode

protected libAbs ( $args )

libAdjustColor() protected méthode

protected libAdjustColor ( $args )

libAdjustHue() protected méthode

protected libAdjustHue ( $args )

libAlpha() protected méthode

protected libAlpha ( $args )

libAppend() protected méthode

protected libAppend ( $args )

libBlue() protected méthode

protected libBlue ( $args )

libCall() protected méthode

..'];
protected libCall ( $args, $kwargs )

libCeil() protected méthode

protected libCeil ( $args )

libChangeColor() protected méthode

protected libChangeColor ( $args )

libComparable() protected méthode

protected libComparable ( $args )

libComplement() protected méthode

protected libComplement ( $args )

libCounter() protected méthode

Workaround IE7's content counter bug.
protected libCounter ( array $args )
$args array

libDarken() protected méthode

protected libDarken ( $args )

libDesaturate() protected méthode

protected libDesaturate ( $args )

libFadeIn() protected méthode

protected libFadeIn ( $args )

libFadeOut() protected méthode

protected libFadeOut ( $args )

libFeatureExists() protected méthode

protected libFeatureExists ( $args )

libFloor() protected méthode

protected libFloor ( $args )

libFunctionExists() protected méthode

protected libFunctionExists ( $args )

libGlobalVariableExists() protected méthode

protected libGlobalVariableExists ( $args )

libGrayscale() protected méthode

protected libGrayscale ( $args )

libGreen() protected méthode

protected libGreen ( $args )

libHsl() protected méthode

protected libHsl ( $args )

libHsla() protected méthode

protected libHsla ( $args )

libHue() protected méthode

protected libHue ( $args )

libIeHexStr() protected méthode

protected libIeHexStr ( $args )

libIf() protected méthode

protected libIf ( $args )

libIndex() protected méthode

protected libIndex ( $args )

libInspect() protected méthode

protected libInspect ( $args )

libInvert() protected méthode

protected libInvert ( $args )

libJoin() protected méthode

protected libJoin ( $args )

libKeywords() protected méthode

protected libKeywords ( $args )

libLength() protected méthode

protected libLength ( $args )

libLighten() protected méthode

protected libLighten ( $args )

libLightness() protected méthode

protected libLightness ( $args )

libListSeparator() protected méthode

..'];
protected libListSeparator ( $args )

libMapGet() protected méthode

protected libMapGet ( $args )

libMapHasKey() protected méthode

protected libMapHasKey ( $args )

libMapKeys() protected méthode

protected libMapKeys ( $args )

libMapMerge() protected méthode

protected libMapMerge ( $args )

libMapRemove() protected méthode

protected libMapRemove ( $args )

libMapValues() protected méthode

protected libMapValues ( $args )

libMax() protected méthode

protected libMax ( $args )

libMin() protected méthode

protected libMin ( $args )

libMix() protected méthode

protected libMix ( $args )

libMixinExists() protected méthode

protected libMixinExists ( $args )

libNth() protected méthode

protected libNth ( $args )

libOpacify() protected méthode

protected libOpacify ( $args )

libOpacity() protected méthode

protected libOpacity ( $args )

libPercentage() protected méthode

protected libPercentage ( $args )

libQuote() protected méthode

protected libQuote ( $args )

libRandom() protected méthode

protected libRandom ( $args )

libRed() protected méthode

protected libRed ( $args )

libRgb() protected méthode

protected libRgb ( $args )

libRgba() protected méthode

protected libRgba ( $args )

libRound() protected méthode

protected libRound ( $args )

libSaturate() protected méthode

protected libSaturate ( $args )

libSaturation() protected méthode

protected libSaturation ( $args )

libScaleColor() protected méthode

protected libScaleColor ( $args )

libSetNth() protected méthode

protected libSetNth ( $args )

libStrIndex() protected méthode

protected libStrIndex ( $args )

libStrInsert() protected méthode

protected libStrInsert ( $args )

libStrLength() protected méthode

protected libStrLength ( $args )

libStrSlice() protected méthode

protected libStrSlice ( $args )

libToLowerCase() protected méthode

protected libToLowerCase ( $args )

libToUpperCase() protected méthode

protected libToUpperCase ( $args )

libTransparentize() protected méthode

protected libTransparentize ( $args )

libTypeOf() protected méthode

protected libTypeOf ( $args )

libUniqueId() protected méthode

protected libUniqueId ( )

libUnit() protected méthode

protected libUnit ( $args )

libUnitless() protected méthode

protected libUnitless ( $args )

libUnquote() protected méthode

protected libUnquote ( $args )

libVariableExists() protected méthode

protected libVariableExists ( $args )

libZip() protected méthode

protected libZip ( $args )

listSeparatorForJoin() protected méthode

protected listSeparatorForJoin ( $list1, $sep )

makeOutputBlock() protected méthode

Make output block
protected makeOutputBlock ( string $type, array $selectors = null ) : Leafo\ScssPhp\Formatter\OutputBlock
$type string
$selectors array
Résultat Leafo\ScssPhp\Formatter\OutputBlock

matchExtends() protected méthode

Match extends
protected matchExtends ( array $selector, array &$out, integer $from, boolean $initial = true )
$selector array
$out array
$from integer
$initial boolean

matchExtendsSingle() protected méthode

Match extends single
protected matchExtendsSingle ( array $rawSingle, array &$outOrigin ) : boolean
$rawSingle array
$outOrigin array
Résultat boolean

mediaParent() protected méthode

Media parent
protected mediaParent ( Leafo\ScssPhp\Formatter\OutputBlock $scope ) : Leafo\ScssPhp\Formatter\OutputBlock
$scope Leafo\ScssPhp\Formatter\OutputBlock
Résultat Leafo\ScssPhp\Formatter\OutputBlock

mergeDirectRelationships() protected méthode

protected mergeDirectRelationships ( $selectors1, $selectors2 )

mergeMediaTypes() protected méthode

Merge media types
protected mergeMediaTypes ( array $type1, array $type2 ) : array | null
$type1 array
$type2 array
Résultat array | null

missingSelectors() protected méthode

Report missing selectors
protected missingSelectors ( )

multiplyMedia() protected méthode

Multiply media
protected multiplyMedia ( Leafo\ScssPhp\Compiler\Environment $env = null, array $childQueries = null ) : array
$env Leafo\ScssPhp\Compiler\Environment
$childQueries array
Résultat array

multiplySelectors() protected méthode

Find the final set of selectors
protected multiplySelectors ( Leafo\ScssPhp\Compiler\Environment $env ) : array
$env Leafo\ScssPhp\Compiler\Environment
Résultat array

normalizeName() protected méthode

Normalize name
protected normalizeName ( string $name ) : string
$name string
Résultat string

normalizeValue() public méthode

Normalize value
public normalizeValue ( array $value ) : array
$value array
Résultat array

opAdd() protected méthode

Add strings
protected opAdd ( array $left, array $right ) : array
$left array
$right array
Résultat array

opAddNumberNumber() protected méthode

Add numbers
protected opAddNumberNumber ( array $left, array $right ) : array
$left array
$right array
Résultat array

opAnd() protected méthode

Boolean and
protected opAnd ( array $left, array $right, boolean $shouldEval ) : array
$left array
$right array
$shouldEval boolean
Résultat array

opCmpNumberNumber() protected méthode

Three-way comparison, aka spaceship operator
protected opCmpNumberNumber ( array $left, array $right ) : array
$left array
$right array
Résultat array

opColorColor() protected méthode

Compare colors
protected opColorColor ( string $op, array $left, array $right ) : array
$op string
$left array
$right array
Résultat array

opColorNumber() protected méthode

Compare color and number
protected opColorNumber ( string $op, array $left, array $right ) : array
$op string
$left array
$right array
Résultat array

opDivNumberNumber() protected méthode

Divide numbers
protected opDivNumberNumber ( array $left, array $right ) : array
$left array
$right array
Résultat array

opEq() protected méthode

Compare number1 == number2
protected opEq ( array $left, array $right ) : array
$left array
$right array
Résultat array

opGtNumberNumber() protected méthode

Compare number1 > number2
protected opGtNumberNumber ( array $left, array $right ) : array
$left array
$right array
Résultat array

opGteNumberNumber() protected méthode

Compare number1 >= number2
protected opGteNumberNumber ( array $left, array $right ) : array
$left array
$right array
Résultat array

opLtNumberNumber() protected méthode

Compare number1 < number2
protected opLtNumberNumber ( array $left, array $right ) : array
$left array
$right array
Résultat array

opLteNumberNumber() protected méthode

Compare number1 <= number2
protected opLteNumberNumber ( array $left, array $right ) : array
$left array
$right array
Résultat array

opModNumberNumber() protected méthode

Mod numbers
protected opModNumberNumber ( array $left, array $right ) : array
$left array
$right array
Résultat array

opMulNumberNumber() protected méthode

Multiply numbers
protected opMulNumberNumber ( array $left, array $right ) : array
$left array
$right array
Résultat array

opNeq() protected méthode

Compare number1 != number2
protected opNeq ( array $left, array $right ) : array
$left array
$right array
Résultat array

opNumberColor() protected méthode

Compare number and color
protected opNumberColor ( string $op, array $left, array $right ) : array
$op string
$left array
$right array
Résultat array

opOr() protected méthode

Boolean or
protected opOr ( array $left, array $right, boolean $shouldEval ) : array
$left array
$right array
$shouldEval boolean
Résultat array

opSubNumberNumber() protected méthode

Subtract numbers
protected opSubNumberNumber ( array $left, array $right ) : array
$left array
$right array
Résultat array

parserFactory() protected méthode

Instantiate parser
protected parserFactory ( string $path ) : Parser
$path string
Résultat Parser

popEnv() protected méthode

Pop environment
protected popEnv ( )

pushEnv() protected méthode

Push environment
protected pushEnv ( Leafo\ScssPhp\Block $block = null ) : Leafo\ScssPhp\Compiler\Environment
$block Leafo\ScssPhp\Block
Résultat Leafo\ScssPhp\Compiler\Environment

pushExtends() protected méthode

Push extends
protected pushExtends ( array $target, array $origin, stdClass $block )
$target array
$origin array
$block stdClass

reduce() protected méthode

Reduce value
protected reduce ( array $value, boolean $inExp = false ) : array
$value array
$inExp boolean
Résultat array

registerFunction() public méthode

Register function
public registerFunction ( string $name, callable $func, array $prototype = null )
$name string
$func callable
$prototype array

set() protected méthode

Set variable
protected set ( string $name, mixed $value, boolean $shadow = false, Leafo\ScssPhp\Compiler\Environment $env = null )
$name string
$value mixed
$shadow boolean
$env Leafo\ScssPhp\Compiler\Environment

setEncoding() public méthode

Set encoding
public setEncoding ( string $encoding )
$encoding string

setExisting() protected méthode

Set existing variable
protected setExisting ( string $name, mixed $value, Leafo\ScssPhp\Compiler\Environment $env )
$name string
$value mixed
$env Leafo\ScssPhp\Compiler\Environment

setFormatter() public méthode

Set formatter
public setFormatter ( string $formatterName )
$formatterName string

setIgnoreErrors() public méthode

Ignore errors?
public setIgnoreErrors ( boolean $ignoreErrors ) : Compiler
$ignoreErrors boolean
Résultat Compiler

setImportPaths() public méthode

Set import paths
public setImportPaths ( string | array $path )
$path string | array

setLineNumberStyle() public méthode

Set line number style
public setLineNumberStyle ( string $lineNumberStyle )
$lineNumberStyle string

setNumberPrecision() public méthode

Set number precision
public setNumberPrecision ( integer $numberPrecision )
$numberPrecision integer

setRaw() protected méthode

Set raw variable
protected setRaw ( string $name, mixed $value, Leafo\ScssPhp\Compiler\Environment $env )
$name string
$value mixed
$env Leafo\ScssPhp\Compiler\Environment

setVariables() public méthode

Set variables
public setVariables ( array $variables )
$variables array

shouldEval() protected méthode

Should $value cause its operand to eval
protected shouldEval ( array $value ) : boolean
$value array
Résultat boolean

sortArgs() protected méthode

Sorts keyword arguments
protected sortArgs ( array $prototype, array $args ) : array
$prototype array
$args array
Résultat array

throwError() public méthode

Throw error (exception)
public throwError ( string $msg )
$msg string Message with optional sprintf()-style vararg parameters

toBool() public méthode

Cast to boolean
public toBool ( mixed $thing ) : array
$thing mixed
Résultat array

toHSL() public méthode

Convert RGB to HSL
public toHSL ( integer $red, integer $green, integer $blue ) : array
$red integer
$green integer
$blue integer
Résultat array

toRGB() public méthode

Convert HSL to RGB
public toRGB ( integer $hue, integer $saturation, integer $lightness ) : array
$hue integer H from 0 to 360
$saturation integer S from 0 to 100
$lightness integer L from 0 to 100
Résultat array

unregisterFunction() public méthode

Unregister function
public unregisterFunction ( string $name )
$name string

unsetVariable() public méthode

Unset variable
public unsetVariable ( string $name )
$name string

Property Details

$charsetSeen protected_oe property

protected $charsetSeen

$defaultValue public_oe static_oe property

public static $defaultValue

$emptyList public_oe static_oe property

public static $emptyList

$emptyMap public_oe static_oe property

public static $emptyMap

$emptyString public_oe static_oe property

public static $emptyString

$encoding protected_oe property

protected $encoding

$env protected_oe property

protected $env

$false public_oe static_oe property

public static $false

$formatter protected_oe property

protected $formatter

$importCache protected_oe property

protected $importCache

$importPaths protected_oe property

protected $importPaths

$importedFiles protected_oe property

protected $importedFiles

$libAbs protected_oe static_oe property

protected static $libAbs

$libAdjustColor protected_oe static_oe property

protected static $libAdjustColor

$libAdjustHue protected_oe static_oe property

protected static $libAdjustHue

$libAlpha protected_oe static_oe property

protected static $libAlpha

$libAppend protected_oe static_oe property

protected static $libAppend

$libBlue protected_oe static_oe property

protected static $libBlue

$libCeil protected_oe static_oe property

protected static $libCeil

$libChangeColor protected_oe static_oe property

protected static $libChangeColor

$libComparable protected_oe static_oe property

protected static $libComparable

$libComplement protected_oe static_oe property

protected static $libComplement

$libDarken protected_oe static_oe property

protected static $libDarken

$libDesaturate protected_oe static_oe property

protected static $libDesaturate

$libFadeIn protected_oe static_oe property

protected static $libFadeIn

$libFadeOut protected_oe static_oe property

protected static $libFadeOut

$libFeatureExists protected_oe static_oe property

protected static $libFeatureExists

$libFloor protected_oe static_oe property

protected static $libFloor

$libFunctionExists protected_oe static_oe property

protected static $libFunctionExists

$libGlobalVariableExists protected_oe static_oe property

protected static $libGlobalVariableExists

$libGrayscale protected_oe static_oe property

protected static $libGrayscale

$libGreen protected_oe static_oe property

protected static $libGreen

$libHsl protected_oe static_oe property

protected static $libHsl

$libHsla protected_oe static_oe property

protected static $libHsla

$libHue protected_oe static_oe property

protected static $libHue

$libIeHexStr protected_oe static_oe property

protected static $libIeHexStr

$libIf protected_oe static_oe property

protected static $libIf

$libIndex protected_oe static_oe property

protected static $libIndex

$libInspect protected_oe static_oe property

protected static $libInspect

$libInvert protected_oe static_oe property

protected static $libInvert

$libJoin protected_oe static_oe property

protected static $libJoin

$libKeywords protected_oe static_oe property

protected static $libKeywords

$libLength protected_oe static_oe property

protected static $libLength

$libLighten protected_oe static_oe property

protected static $libLighten

$libLightness protected_oe static_oe property

protected static $libLightness

$libMapGet protected_oe static_oe property

protected static $libMapGet

$libMapHasKey protected_oe static_oe property

protected static $libMapHasKey

$libMapKeys protected_oe static_oe property

protected static $libMapKeys

$libMapMerge protected_oe static_oe property

protected static $libMapMerge

$libMapRemove protected_oe static_oe property

protected static $libMapRemove

$libMapValues protected_oe static_oe property

protected static $libMapValues

$libMix protected_oe static_oe property

mix two colors
protected static $libMix

$libMixinExists protected_oe static_oe property

protected static $libMixinExists

$libNth protected_oe static_oe property

protected static $libNth

$libOpacify protected_oe static_oe property

increases opacity by amount
protected static $libOpacify

$libOpacity protected_oe static_oe property

protected static $libOpacity

$libPercentage protected_oe static_oe property

protected static $libPercentage

$libQuote protected_oe static_oe property

protected static $libQuote

$libRandom protected_oe static_oe property

protected static $libRandom

$libRed protected_oe static_oe property

protected static $libRed

$libRgb protected_oe static_oe property

protected static $libRgb

$libRgba protected_oe static_oe property

protected static $libRgba

$libRound protected_oe static_oe property

protected static $libRound

$libSaturate protected_oe static_oe property

protected static $libSaturate

$libSaturation protected_oe static_oe property

protected static $libSaturation

$libScaleColor protected_oe static_oe property

protected static $libScaleColor

$libSetNth protected_oe static_oe property

protected static $libSetNth

$libStrIndex protected_oe static_oe property

protected static $libStrIndex

$libStrInsert protected_oe static_oe property

protected static $libStrInsert

$libStrLength protected_oe static_oe property

protected static $libStrLength

$libStrSlice protected_oe static_oe property

protected static $libStrSlice

$libToLowerCase protected_oe static_oe property

protected static $libToLowerCase

$libToUpperCase protected_oe static_oe property

protected static $libToUpperCase

$libTransparentize protected_oe static_oe property

decreases opacity by amount
protected static $libTransparentize

$libTypeOf protected_oe static_oe property

protected static $libTypeOf

$libUnit protected_oe static_oe property

protected static $libUnit

$libUnitless protected_oe static_oe property

protected static $libUnitless

$libUnquote protected_oe static_oe property

protected static $libUnquote

$libVariableExists protected_oe static_oe property

protected static $libVariableExists

$lineNumberStyle protected_oe property

protected $lineNumberStyle

$namespaces protected_oe static_oe property

protected static array $namespaces
Résultat array

$null public_oe static_oe property

public static $null

$nullString public_oe static_oe property

public static $nullString

$operatorNames protected_oe static_oe property

protected static array $operatorNames
Résultat array

$registeredFeatures protected_oe property

protected $registeredFeatures

$registeredVars protected_oe property

protected $registeredVars

$rootBlock protected_oe property

protected $rootBlock

$rootEnv protected_oe property

protected $rootEnv

$scope protected_oe property

protected $scope

$selfSelector public_oe static_oe property

public static $selfSelector

$sourceNames protected_oe property

protected $sourceNames

$storeEnv protected_oe property

protected $storeEnv

$true public_oe static_oe property

public static $true

$userFunctions protected_oe property

protected $userFunctions

$with public_oe static_oe property

public static $with

$without public_oe static_oe property

public static $without