_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q22100 | RequirementsChecker.checkPHPversion | train | public function checkPHPversion(string $minPhpVersion = null)
{
$minVersionPhp = $minPhpVersion;
$currentPhpVersion = $this->getPhpVersionInfo();
$supported = false;
if ($minPhpVersion == null) {
$minVersionPhp = $this->getMinPhpVersion();
}
if... | php | {
"resource": ""
} |
q22101 | RequirementsChecker.getPhpVersionInfo | train | private static function getPhpVersionInfo()
{
$currentVersionFull = PHP_VERSION;
preg_match("#^\d+(\.\d+)*#", $currentVersionFull, $filtered);
$currentVersion = $filtered[0];
| php | {
"resource": ""
} |
q22102 | LaravelInstallerServiceProvider.publishFiles | train | protected function publishFiles()
{
$this->publishes([
__DIR__.'/../Config/installer.php' => base_path('config/installer.php'),
], 'laravelinstaller');
$this->publishes([
__DIR__.'/../assets' => public_path('installer'),
], 'laravelinstaller');
... | php | {
"resource": ""
} |
q22103 | EnvironmentManager.getEnvContent | train | public function getEnvContent()
{
if (!file_exists($this->envPath)) {
if (file_exists($this->envExamplePath)) {
copy($this->envExamplePath, $this->envPath);
} else {
| php | {
"resource": ""
} |
q22104 | EnvironmentManager.saveFileClassic | train | public function saveFileClassic(Request $input)
{
$message = trans('installer_messages.environment.success');
try {
file_put_contents($this->envPath, $input->get('envConfig'));
}
| php | {
"resource": ""
} |
q22105 | BranchGraphNode.insert | train | public function insert(self $branch)
{
if (!\in_array($branch, $this->branches)) {
| php | {
"resource": ""
} |
q22106 | BranchGraphNode.show | train | public function show($padding = 0)
{
echo str_repeat(' ', $padding), $this->branch->getUniqueId(), ':' , $this->increase;
if (\count($this->branches)) {
echo ':', PHP_EOL;
foreach ($this->branches as $node) {
| php | {
"resource": ""
} |
q22107 | Reference.setExpectReturn | train | public function setExpectReturn($expecting, Variable $expectingVariable = null)
{
$this->expecting = $expecting;
| php | {
"resource": ""
} |
q22108 | Reference.compile | train | public function compile($expression, CompilationContext $compilationContext)
{
/*
* Resolves the symbol that expects the value
*/
if ($this->expecting) {
if ($this->expectingVariable) {
$symbolVariable = $this->expectingVariable;
if ('var... | php | {
"resource": ""
} |
q22109 | BranchGraph.addLeaf | train | public function addLeaf(Branch $branch)
{
if (isset($this->branchMap[$branch->getUniqueId()])) {
$branchNode = $this->branchMap[$branch->getUniqueId()];
} else {
$branchNode = new BranchGraphNode($branch);
}
$branchNode->increase();
$tempBranch = $bra... | php | {
"resource": ""
} |
q22110 | SymbolTable.hasVariable | train | public function hasVariable($name, CompilationContext $compilationContext = null)
| php | {
"resource": ""
} |
q22111 | SymbolTable.addVariable | train | public function addVariable($type, $name, CompilationContext $compilationContext)
{
$currentBranch = $compilationContext->branchManager->getCurrentBranch();
$branchId = $currentBranch->getUniqueId();
if ($this->globalsManager->isSuperGlobal($name) || 'zephir_fcall_cache_entry' == $type) {
... | php | {
"resource": ""
} |
q22112 | SymbolTable.getVariable | train | public function getVariable($name, $compilationContext = null)
{
/* Check if the variable already is referencing a branch */
$pos = strpos($name, Variable::BRANCH_MAGIC);
if ($pos > -1) {
$branchId = (int) (substr($name, $pos + \strlen(Variable::BRANCH_MAGIC)));
$name... | php | {
"resource": ""
} |
q22113 | SymbolTable.getVariables | train | public function getVariables()
{
$ret = [];
foreach ($this->branchVariables as $branchId => $vars) {
foreach ($vars as $var) {
| php | {
"resource": ""
} |
q22114 | SymbolTable.getVariableForWrite | train | public function getVariableForWrite($name, CompilationContext $compilationContext, array $statement = null)
{
/*
* Create superglobals just in time
*/
if ($this->globalsManager->isSuperGlobal($name)) {
if (!$this->hasVariable($name)) {
/**
... | php | {
"resource": ""
} |
q22115 | SymbolTable.getTempVariable | train | public function getTempVariable($type, CompilationContext $compilationContext)
{
$compilationContext = $compilationContext ?: $this->compilationContext;
$tempVar = $this->getNextTempVar();
| php | {
"resource": ""
} |
q22116 | SymbolTable.getTempVariableForWrite | train | public function getTempVariableForWrite($type, CompilationContext $context, $init = true)
{
$variable = $this->reuseTempVariable($type, 'heap');
if (\is_object($variable)) {
$variable->increaseUses();
$variable->increaseMutates();
if ($init && ('variable' == $type... | php | {
"resource": ""
} |
q22117 | SymbolTable.getTempNonTrackedVariable | train | public function getTempNonTrackedVariable($type, CompilationContext $context, $initNonReferenced = false)
{
$variable = $this->reuseTempVariable($type, 'non-tracked');
if (\is_object($variable)) {
$variable->increaseUses();
$variable->increaseMutates();
if ($init... | php | {
"resource": ""
} |
q22118 | SymbolTable.addTemp | train | public function addTemp($type, CompilationContext $context)
{
$tempVar = $this->getNextTempVar();
$variable = $this->addVariable($type, '_'.$tempVar, $context);
$variable->setIsInitialized(true, $context);
| php | {
"resource": ""
} |
q22119 | SymbolTable.getTempVariableForObserve | train | public function getTempVariableForObserve($type, CompilationContext $context)
{
$variable = $this->reuseTempVariable($type, 'observe');
if (\is_object($variable)) {
$variable->increaseUses();
$variable->increaseMutates();
$variable->observeVariant($context);
| php | {
"resource": ""
} |
q22120 | SymbolTable.markTemporalVariablesIdle | train | public function markTemporalVariablesIdle(CompilationContext $compilationContext)
{
$compilationContext = $compilationContext ?: $this->compilationContext;
$branchId = $compilationContext->branchManager->getCurrentBranchId();
if (!isset($this->branchTempVariables[$branchId])) {
... | php | {
"resource": ""
} |
q22121 | SymbolTable.registerTempVariable | train | protected function registerTempVariable($type, $location, Variable $variable, CompilationContext $compilationContext = null)
{
$compilationContext = $compilationContext ?: $this->compilationContext;
$branchId = $compilationContext->branchManager->getCurrentBranchId();
if (!isset($this->bran... | php | {
"resource": ""
} |
q22122 | SymbolTable.reuseTempVariable | train | protected function reuseTempVariable($type, $location, CompilationContext $compilationContext = null)
{
$compilationContext = $compilationContext ?: $this->compilationContext;
$branchId = $compilationContext->branchManager->getCurrentBranchId();
if (isset($this->branchTempVariables[$branchI... | php | {
"resource": ""
} |
q22123 | MutateGathererPass.increaseMutations | train | public function increaseMutations($variable)
{
if (isset($this->mutations[$variable])) {
| php | {
"resource": ""
} |
q22124 | MutateGathererPass.passExpression | train | public function passExpression(array $expression)
{
switch ($expression['type']) {
case 'bool':
case 'double':
case 'int':
case 'uint':
case 'long':
case 'ulong':
case 'string':
case 'istring':
case '... | php | {
"resource": ""
} |
q22125 | Compiler.reslovePrototypesPath | train | private function reslovePrototypesPath()
{
$prototypesPath = $this->prototypesPath;
// fallback
if (empty($prototypesPath)) {
$prototypesPath = \dirname(__DIR__).'/prototypes';
}
if (!is_dir($prototypesPath) || !is_readable($prototypesPath)) {
| php | {
"resource": ""
} |
q22126 | Compiler.resolveOptimizersPath | train | private function resolveOptimizersPath()
{
$optimizersPath = $this->optimizersPath;
// fallback
if (empty($optimizersPath)) {
$optimizersPath = __DIR__.'/Optimizers';
}
if (!is_dir($optimizersPath) || !is_readable($optimizersPath)) {
| php | {
"resource": ""
} |
q22127 | Compiler.loadExternalClass | train | public function loadExternalClass($className, $location)
{
$filePath = $location.\DIRECTORY_SEPARATOR.
strtolower(str_replace('\\', \DIRECTORY_SEPARATOR, $className)).'.zep';
/**
* Fix the class name.
*/
$className = implode('\\', array_map('ucfirst', e... | php | {
"resource": ""
} |
q22128 | Compiler.isClass | train | public function isClass($className)
{
foreach ($this->definitions as $key => $value) {
if (!strcasecmp($key, $className) && 'class' === $value->getType()) {
return true;
}
}
/*
* Try to autoload the class from an external dependency
... | php | {
"resource": ""
} |
q22129 | Compiler.addClassDefinition | train | public function addClassDefinition(CompilerFileAnonymous $file, ClassDefinition $classDefinition)
{
| php | {
"resource": ""
} |
q22130 | Compiler.setExtensionGlobals | train | public function setExtensionGlobals(array $globals)
{
foreach | php | {
"resource": ""
} |
q22131 | Compiler.getGccFlags | train | public function getGccFlags($development = false)
{
if (is_windows()) {
// TODO
return '';
}
$gccFlags = getenv('CFLAGS');
if (!\is_string($gccFlags)) {
if (false === $development) {
$gccVersion = $this->getGccVersion();
... | php | {
"resource": ""
} |
q22132 | Compiler.preCompileHeaders | train | public function preCompileHeaders()
{
if (is_windows()) {
// TODO: Add Windows support
return;
}
$phpIncludes = $this->getPhpIncludeDirs();
foreach (new \DirectoryIterator('ext/kernel') as $file) {
if ($file->isDir()) {
continue;
... | php | {
"resource": ""
} |
q22133 | Compiler.api | train | public function api(array $options = [], $fromGenerate = false)
{
if (!$fromGenerate) {
$this->generate();
}
$templatesPath = $this->templatesPath;
if (null === $templatesPath) {
// fallback
$templatesPath = \dirname(__DIR__).'/templates';
... | php | {
"resource": ""
} |
q22134 | Compiler.stubs | train | public function stubs($fromGenerate = false)
{
if (!$fromGenerate) {
$this->generate();
}
$this->logger->info('Generating stubs...');
$stubsGenerator = new Stubs\Generator($this->files, $this->config);
$path = $this->config->get('path', 'stubs');
| php | {
"resource": ""
} |
q22135 | Compiler.processCodeInjection | train | public function processCodeInjection(array $entries, $section = 'request')
{
$codes = [];
$includes = [];
if (isset($entries[$section])) {
foreach ($entries[$section] as $entry) {
if (isset($entry['code']) && !empty($entry['code'])) {
| php | {
"resource": ""
} |
q22136 | Compiler.generatePackageDependenciesM4 | train | public function generatePackageDependenciesM4($contentM4)
{
$packageDependencies = $this->config->get('package-dependencies');
if (\is_array($packageDependencies)) {
$pkgconfigM4 = $this->backend->getTemplateFileContents('pkg-config.m4');
$pkgconfigCheckM4 = $this->backend->g... | php | {
"resource": ""
} |
q22137 | Compiler.preCompile | train | private function preCompile($filePath)
{
if (!$this->parserManager->isAvailable()) {
throw new IllegalStateException($this->parserManager->requirements());
}
if (preg_match('#\.zep$#', $filePath)) {
$className = str_replace(\DIRECTORY_SEPARATOR, '\\', $filePath);
... | php | {
"resource": ""
} |
q22138 | Compiler.recursivePreCompile | train | private function recursivePreCompile($path)
{
if (!is_dir($path)) {
throw new InvalidArgumentException(
sprintf(
"An invalid path was passed to the compiler. Unable to obtain the '%s%s%s' directory.",
getcwd(),
\DIRECTOR... | php | {
"resource": ""
} |
q22139 | Compiler.recursiveDeletePath | train | private function recursiveDeletePath($path, $mask)
{
if (!file_exists($path) || !is_dir($path) || !is_readable($path)) {
$this->logger->warning("Directory '{$path}' is not readable. Skip...");
return;
}
$objects = new \RecursiveIteratorIterator(
| php | {
"resource": ""
} |
q22140 | Compiler.loadConstantsSources | train | private function loadConstantsSources($constantsSources)
{
foreach ($constantsSources as $constantsSource) {
if (!file_exists($constantsSource)) {
throw new Exception("File '".$constantsSource."' with constants definitions");
}
foreach (file($constantsSou... | php | {
"resource": ""
} |
q22141 | Compiler.processAddSources | train | private function processAddSources($sources, $project)
{
$groupSources = [];
foreach ($sources as $source) {
$dirName = str_replace(\DIRECTORY_SEPARATOR, '/', \dirname($source));
if (!isset($groupSources[$dirName])) {
$groupSources[$dirName] = [];
... | php | {
"resource": ""
} |
q22142 | Compiler.assertRequiredExtensionsIsPresent | train | private function assertRequiredExtensionsIsPresent()
{
$extensionRequires = $this->config->get('extensions', 'requires');
if (true === empty($extensionRequires)) {
return;
}
$extensions = [];
foreach ($extensionRequires as $key => $value) {
if (false ... | php | {
"resource": ""
} |
q22143 | Compiler.checkKernelFile | train | private function checkKernelFile($src, $dst)
{
if (preg_match('#kernels/ZendEngine[2-9]/concat\.#', $src)) {
return true;
}
if (!file_exists($dst)) { | php | {
"resource": ""
} |
q22144 | Compiler.checkKernelFiles | train | private function checkKernelFiles()
{
$kernelPath = 'ext'.\DIRECTORY_SEPARATOR.'kernel';
if (!file_exists($kernelPath)) {
if (!mkdir($kernelPath, 0775, true)) {
throw new Exception("Cannot create kernel directory: {$kernelPath}");
}
}
$kernel... | php | {
"resource": ""
} |
q22145 | Compiler.checkDirectory | train | private function checkDirectory()
{
$namespace = $this->config->get('namespace');
if (!$namespace) {
// TODO: Add more user friendly message.
// For example assume if the user call the command from the wrong dir
throw new Exception('Extension namespace cannot be l... | php | {
"resource": ""
} |
q22146 | Compiler.getGccVersion | train | private function getGccVersion()
{
if (is_windows()) {
return '0.0.0';
}
if ($this->filesystem->exists('gcc-version')) {
return $this->filesystem->read('gcc-version');
}
$this->filesystem->system('gcc -dumpversion', 'stdout', 'gcc-version');
... | php | {
"resource": ""
} |
q22147 | CacheManager.getFunctionCache | train | public function getFunctionCache()
{
if (!$this->functionCache) {
| php | {
"resource": ""
} |
q22148 | Manager.isAvailable | train | public function isAvailable()
{
return $this->parser->isAvailable() &&
| php | {
"resource": ""
} |
q22149 | ArgInfoDefinition.render | train | public function render()
{
if ($this->richFormat &&
$this->functionLike->isReturnTypesHintDetermined() &&
$this->functionLike->areReturnTypesCompatible()
) {
$this->richRenderStart();
if (false == $this->hasParameters()) {
$this->codeP... | php | {
"resource": ""
} |
q22150 | FunctionCall.getReflector | train | public function getReflector($funcName)
{
/*
* Check if the optimizer is already cached
*/
if (!isset(self::$functionReflection[$funcName])) {
try {
$reflectionFunction = new \ReflectionFunction($funcName);
} catch (\ReflectionException $e) { | php | {
"resource": ""
} |
q22151 | FunctionCall.functionExists | train | public function functionExists($functionName, CompilationContext $context)
{
if (\function_exists($functionName)) {
return true;
}
if ($this->isBuiltInFunction($functionName)) {
return true;
}
$internalName = ['f__'.$functionName];
if (isset($... | php | {
"resource": ""
} |
q22152 | FunctionCall.isReadOnly | train | protected function isReadOnly($funcName, array $expression)
{
if ($this->isBuiltInFunction($funcName)) {
return false;
}
/*
* These functions are supposed to be read-only but they change parameters ref-count
*/
switch ($funcName) {
case 'min... | php | {
"resource": ""
} |
q22153 | FunctionCall.markReferences | train | protected function markReferences(
$funcName,
$parameters,
CompilationContext $compilationContext,
&$references,
$expression
) {
if ($this->isBuiltInFunction($funcName)) {
return;
}
$reflector = $this->getReflector($funcName);
if (... | php | {
"resource": ""
} |
q22154 | FunctionCall.optimize | train | protected function optimize($funcName, array $expression, Call $call, CompilationContext $compilationContext)
{
$optimizer = false;
/*
* Check if the optimizer is already cached
*/
if (!isset(self::$optimizers[$funcName])) {
$camelizeFunctionName = camelize($fu... | php | {
"resource": ""
} |
q22155 | CodePrinter.preOutput | train | public function preOutput($code)
{
$this->lastLine = $code;
| php | {
"resource": ""
} |
q22156 | CodePrinter.outputNoIndent | train | public function outputNoIndent($code)
{
$this->lastLine = $code;
| php | {
"resource": ""
} |
q22157 | CodePrinter.output | train | public function output($code)
{
$this->lastLine = $code;
$this->code .= str_repeat("\t", | php | {
"resource": ""
} |
q22158 | CodePrinter.outputDocBlock | train | public function outputDocBlock($docblock, $replaceTab = true)
{
$code = '';
$docblock = '/'.$docblock.'/';
foreach (explode("\n", $docblock) as $line) {
if ($replaceTab) {
$code .= str_repeat("\t", $this->level).preg_replace('/^[ \t]+/', ' ', $line).PHP_EOL;
... | php | {
"resource": ""
} |
q22159 | CodePrinter.preOutputBlankLine | train | public function preOutputBlankLine($ifPrevNotBlank = false)
{
if (!$ifPrevNotBlank) {
$this->code = PHP_EOL.$this->code;
$this->lastLine = PHP_EOL;
++$this->currentPrints;
} else {
| php | {
"resource": ""
} |
q22160 | Config.get | train | public function get($key, $namespace = null)
{
return null !== $namespace ? | php | {
"resource": ""
} |
q22161 | Config.populate | train | protected function populate()
{
if (!file_exists('config.json')) {
return;
}
$config = json_decode(file_get_contents('config.json'), true);
if (!\is_array($config)) {
throw new Exception(
'The config.json file is | php | {
"resource": ""
} |
q22162 | Generator.generate | train | public function generate($path)
{
if ('tabs' === $this->config->get('indent', 'extra')) {
$indent = "\t";
} else {
$indent = ' ';
}
$namespace = $this->config->get('namespace');
foreach ($this->files as $file) {
$class = $file->getClas... | php | {
"resource": ""
} |
q22163 | Generator.buildClass | train | protected function buildClass(ClassDefinition $class, $indent)
{
$source = <<<EOF
<?php
namespace {$class->getNamespace()};
EOF;
$source .= (new DocBlock($class->getDocBlock(), ''))."\n";
if ($class->isFinal()) {
$source .= 'final ';
} elseif ($class->isAbstract()) {... | php | {
"resource": ""
} |
q22164 | Generator.buildProperty | train | protected function buildProperty(ClassProperty $property, $indent)
{
$visibility = 'public';
if (false === $property->isPublic()) {
$visibility = $property->isProtected() ? 'protected' : 'private';
}
if ($property->isStatic()) {
$visibility = 'static '.$visi... | php | {
"resource": ""
} |
q22165 | Generator.wrapPHPValue | train | protected function wrapPHPValue($parameter)
{
switch ($parameter['default']['type']) {
case 'null':
return 'null';
break;
case 'string':
case 'char':
return '\''.addslashes($parameter['default']['value']).'\'';
... | php | {
"resource": ""
} |
q22166 | StaticTypeInference.markVariableIfUnknown | train | public function markVariableIfUnknown($variable, $type)
{
$this->variables[$variable] = | php | {
"resource": ""
} |
q22167 | StaticTypeInference.reduce | train | public function reduce()
{
$pass = false;
foreach ($this->variables as $variable => $type) {
if ('variable' == $type || 'string' == $type || 'istring' == $type || 'array' == $type || 'null' == $type || 'numeric' == $type) {
unset($this->variables[$variable]);
| php | {
"resource": ""
} |
q22168 | ArithmeticalBaseOperator.optimizeConstantFolding | train | public function optimizeConstantFolding(array $expression, CompilationContext $compilationContext)
{
if ('int' != $expression['left']['type'] && 'double' != $expression['left']['type']) {
return false;
}
if ($compilationContext->config->get('constant-folding', 'optimizations')) ... | php | {
"resource": ""
} |
q22169 | ArithmeticalBaseOperator.getDynamicTypes | train | private function getDynamicTypes(Variable $left, Variable $right)
{
if ('/' == $this->operator) {
return 'double';
}
switch ($left->getType()) {
case 'int':
case 'uint':
case 'long':
case 'ulong':
switch ($right->ge... | php | {
"resource": ""
} |
q22170 | EventsManager.listen | train | public function listen($event, $callback)
{
if (!isset($this->listeners[$event])) {
$this->listeners[$event] = [];
| php | {
"resource": ""
} |
q22171 | EventsManager.dispatch | train | public function dispatch($event, array $param = [])
{
foreach ($this->listeners[$event] as | php | {
"resource": ""
} |
q22172 | ObjectPropertyIncr.assign | train | public function assign($variable, $property, ZephirVariable $symbolVariable, CompilationContext $compilationContext, $statement)
{
if (!$symbolVariable->isInitialized()) {
throw new CompilerException("Cannot mutate variable '".$variable."' because it is not initialized", $statement);
}
... | php | {
"resource": ""
} |
q22173 | WriteDetector.passLetStatement | train | public function passLetStatement(array $statement)
{
foreach ($statement['assignments'] as $assignment) {
if (isset($assignment['expr'])) {
$this->passExpression($assignment['expr']);
}
$this->increaseMutations($assignment['variable']);
if (sel... | php | {
"resource": ""
} |
q22174 | WriteDetector.passArray | train | public function passArray(array $expression)
{
foreach ($expression['left'] as $item) {
$usePass = self::DETECT_ARRAY_USE == ($this->detectionFlags & self::DETECT_ARRAY_USE);
| php | {
"resource": ""
} |
q22175 | WriteDetector.passNew | train | public function passNew(array $expression)
{
if (isset($expression['parameters'])) {
foreach ($expression['parameters'] as $parameter) {
$usePass = self::DETECT_PARAM_PASS == ($this->detectionFlags & self::DETECT_PARAM_PASS);
if ($usePass && 'variable' == $paramet... | php | {
"resource": ""
} |
q22176 | WriteDetector.declareVariables | train | public function declareVariables(array $statement)
{
if (isset($statement['data-type'])) {
if ('variable' != $statement['data-type']) {
return;
}
}
foreach ($statement['variables'] as $variable) {
if (isset($variable['expr'])) {
... | php | {
"resource": ""
} |
q22177 | BaseOperator.getExpectedNonLiteral | train | public function getExpectedNonLiteral(CompilationContext $compilationContext, $expression, $init = true)
{
$isExpecting = $this->expecting;
$symbolVariable = $this->expectingVariable;
if ($isExpecting) {
if (\is_object($symbolVariable)) {
if ('variable' == $symbo... | php | {
"resource": ""
} |
q22178 | BaseOperator.getExpected | train | public function getExpected(CompilationContext $compilationContext, $expression, $init = true)
{
$isExpecting = $this->expecting;
$symbolVariable = $this->expectingVariable;
if ($isExpecting) {
if (\is_object($symbolVariable)) {
if ('variable' == $symbolVariable-... | php | {
"resource": ""
} |
q22179 | BaseOperator.getExpectedComplexLiteral | train | public function getExpectedComplexLiteral(CompilationContext $compilationContext, $expression, $type = 'variable')
{
$isExpecting = $this->expecting;
$symbolVariable = $this->expectingVariable;
if ($isExpecting) {
if (\is_object($symbolVariable)) {
if ($symbolVar... | php | {
"resource": ""
} |
q22180 | NewInstanceTypeOperator.compile | train | public function compile(array $expression, CompilationContext $compilationContext)
{
if (!isset($expression['parameters'])) {
throw new CompilerException("Invalid 'parameters' for new-type", $expression);
}
switch ($expression['internal-type']) {
case 'array':
... | php | {
"resource": ""
} |
q22181 | TypeHintOperator.compile | train | public function compile(array $expression, CompilationContext $compilationContext)
{
$expr = new Expression($expression['right']);
$expr->setReadOnly(true);
$resolved = $expr->compile($compilationContext);
if ('variable' != $resolved->getType()) {
throw new CompilerExcep... | php | {
"resource": ""
} |
q22182 | Template.themeOption | train | public function themeOption($name)
{
return isset($this->themeOptions[$name]) ? | php | {
"resource": ""
} |
q22183 | Template.url | train | public function url($url)
{
if (\is_string($url)) {
if ('/' == $url[0]) {
return $this->getPathToRoot().ltrim($url, '/');
} elseif (\is_string($url)) {
return $url;
}
} elseif ($url instanceof ClassDefinition) { | php | {
"resource": ""
} |
q22184 | MethodCache.isClassCacheable | train | private function isClassCacheable($classDefinition)
{
if ($classDefinition instanceof ClassDefinition) {
return true;
}
if ($classDefinition instanceof \ReflectionClass) {
if ($classDefinition->isInternal() && $classDefinition->isInstantiable()) {
$ext... | php | {
"resource": ""
} |
q22185 | SlotsCache.getFunctionSlot | train | public static function getFunctionSlot($functionName)
{
if (isset(self::$cacheFunctionSlots[$functionName])) {
return self::$cacheFunctionSlots[$functionName];
}
$slot = self::$slot++;
if ($slot >= self::MAX_SLOTS_NUMBER) {
| php | {
"resource": ""
} |
q22186 | SlotsCache.getMethodSlot | train | public static function getMethodSlot(ClassMethod $method)
{
$className = $method->getClassDefinition()->getCompleteName();
$methodName = $method->getName();
if (isset(self::$cacheMethodSlots[$className][$methodName])) {
return self::$cacheMethodSlots[$className][$methodName];
... | php | {
"resource": ""
} |
q22187 | SlotsCache.getExistingMethodSlot | train | public static function getExistingMethodSlot(ClassMethod $method)
{
$className = $method->getClassDefinition()->getCompleteName();
$methodName = $method->getName();
| php | {
"resource": ""
} |
q22188 | AbstractType.invokeMethod | train | public function invokeMethod(
$methodName,
$caller,
CompilationContext
$compilationContext,
Call $call,
array $expression
) {
/*
* Checks first whether the method exist in the array type definition
*/
if (method_exists($this, $methodN... | php | {
"resource": ""
} |
q22189 | MinusOperator.compile | train | public function compile($expression, CompilationContext $compilationContext)
{
if (!isset($expression['left'])) {
throw new CompilerException('Missing left part of the expression');
}
$leftExpr = new Expression($expression['left']);
$leftExpr->setReadOnly($this->readOnly... | php | {
"resource": ""
} |
q22190 | HeadersManager.add | train | public function add($path, $position = 0)
{
if (!\is_string($path)) {
throw new \InvalidArgumentException('$path must be only string type');
}
if (!$position) {
$this->headers[$path] = $path;
} else {
switch ($position) {
case self... | php | {
"resource": ""
} |
q22191 | ClassConstant.processValue | train | public function processValue(CompilationContext $compilationContext)
{
if ('constant' == $this->value['type']) {
$constant = new Constants();
$compiledExpression = $constant->compile($this->value, $compilationContext);
$this->value = [
'type' => $compiled... | php | {
"resource": ""
} |
q22192 | ClassConstant.compile | train | public function compile(CompilationContext $compilationContext)
{
$this->processValue($compilationContext);
$constanValue = isset($this->value['value']) ? $this->value['value'] : null;
$compilationContext->backend->declareConstant(
| php | {
"resource": ""
} |
q22193 | DevelopmentModeAwareTrait.isDevelopmentModeEnabled | train | protected function isDevelopmentModeEnabled(InputInterface $input)
{
if (false == | php | {
"resource": ""
} |
q22194 | AliasManager.add | train | public function add(array $useStatement)
{
foreach ($useStatement['aliases'] as $alias) {
if (isset($alias['alias'])) {
$this->aliases[$alias['alias']] = $alias['name'];
} else {
$parts = explode('\\', | php | {
"resource": ""
} |
q22195 | ClassProperty.getVisibilityAccessor | train | public function getVisibilityAccessor()
{
$modifiers = [];
foreach ($this->visibility as $visibility) {
switch ($visibility) {
case 'protected':
$modifiers['ZEND_ACC_PROTECTED'] = true;
break;
case 'private':
... | php | {
"resource": ""
} |
q22196 | ClassProperty.compile | train | public function compile(CompilationContext $compilationContext)
{
switch ($this->defaultValue['type']) {
case 'long':
case 'int':
case 'string':
case 'double':
case 'bool':
$this->declareProperty($compilationContext, $this->defaultV... | php | {
"resource": ""
} |
q22197 | ClassProperty.removeInitializationStatements | train | protected function removeInitializationStatements(&$statements)
{
foreach ($statements as $index => $statement) {
if (!$this->isStatic()) {
if ($statement['expr']['left']['right']['value'] == $this->name) {
unset($statements[$index]);
}
... | php | {
"resource": ""
} |
q22198 | ClassProperty.declareProperty | train | protected function declareProperty(CompilationContext $compilationContext, $type, $value)
{
$codePrinter = $compilationContext->codePrinter;
if (\is_object($value)) {
return;
}
$classEntry = $compilationContext->classDefinition->getClassEntry();
switch ($type) ... | php | {
"resource": ""
} |
q22199 | Backend.assignZval | train | public function assignZval(Variable $variable, $code, CompilationContext $context)
{
$code = $this->resolveValue($code, $context);
if (!$variable->isDoublePointer()) {
$context->symbolTable->mustGrownStack(true);
$symbolVariable = $this->getVariableCode($variable);
| php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.