_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q22200 | Collection.getTypesBySpecification | train | public function getTypesBySpecification(SpecificationInterface $spec)
{
$types = [];
foreach ($this as $type) {
| php | {
"resource": ""
} |
q22201 | Collection.onlySpecial | train | public function onlySpecial()
{
if (0 == $this->count()) {
return false;
}
$found | php | {
"resource": ""
} |
q22202 | Collection.areReturnTypesWellKnown | train | public function areReturnTypesWellKnown()
{
if (0 == $this->count() || $this->isSatisfiedByTypeSpec(new Specification\IsSpecial())) {
return false;
}
$spec =
(new Specification\ObjectLike())
->either(new Specification\ArrayCompatible())
->eith... | php | {
"resource": ""
} |
q22203 | Collection.areReturnTypesCompatible | train | public function areReturnTypesCompatible()
{
$numberOfReturnTypes = $this->count();
if (0 == $numberOfReturnTypes || 1 == $numberOfReturnTypes) {
return true;
}
// <Class_1> | <Class_2> | ... | <Class_n>
$classes = $this->getObjectLikeReturnTypes();
// ... | php | {
"resource": ""
} |
q22204 | Variable.doArrayAssignment | train | private function doArrayAssignment(
CodePrinter $codePrinter,
CompiledExpression $resolvedExpr,
ZephirVariable $symbolVariable,
$variable,
array $statement,
CompilationContext $compilationContext
) {
switch ($resolvedExpr->getType()) {
case 'variab... | php | {
"resource": ""
} |
q22205 | Backend.getTypeofCondition | train | public function getTypeofCondition(Variable $variableVariable, $operator, $value, CompilationContext $context)
{
$variableName = $this->getVariableCode($variableVariable);
switch ($value) {
case 'array':
$condition = 'Z_TYPE_P('.$variableName.') '.$operator.' IS_ARRAY';
... | php | {
"resource": ""
} |
q22206 | Backend.getInternalSignature | train | public function getInternalSignature(ClassMethod $method, CompilationContext $context)
{
if ($method->isInitializer() && !$method->isStatic()) {
return 'zend_object_value '.$method->getName().'(zend_class_entry *class_type TSRMLS_DC)';
}
if ($method->isInitializer() && $method->... | php | {
"resource": ""
} |
q22207 | Backend.resolveOffsetExprs | train | private function resolveOffsetExprs($offsetExprs, CompilationContext $compilationContext)
{
$keys = '';
$offsetItems = [];
$numberParams = 0;
foreach ($offsetExprs as $offsetExpr) {
if ('a' == $offsetExpr) {
$keys .= 'a';
++$numberParams;
... | php | {
"resource": ""
} |
q22208 | StatementsBlock.getLastLine | train | public function getLastLine()
{
if (!$this->lastStatement) { | php | {
"resource": ""
} |
q22209 | ClassDefinition.setImplementsInterfaces | train | public function setImplementsInterfaces(array $implementedInterfaces)
{
$interfaces = [];
foreach ($implementedInterfaces as $implementedInterface) {
$interfaces[] = | php | {
"resource": ""
} |
q22210 | ClassDefinition.getExtendsClassDefinition | train | public function getExtendsClassDefinition()
{
if (!$this->extendsClassDefinition && $this->extendsClass) {
if ($this->compiler) { | php | {
"resource": ""
} |
q22211 | ClassDefinition.getDependencies | train | public function getDependencies()
{
$dependencies = [];
if ($this->extendsClassDefinition && $this->extendsClassDefinition instanceof self) {
$dependencies[] = $this->extendsClassDefinition;
}
foreach ($this->implementedInterfaceDefinitions as $interfaceDefinition) {
... | php | {
"resource": ""
} |
q22212 | ClassDefinition.getParsedDocBlock | train | public function getParsedDocBlock()
{
if (!$this->parsedDocblock) {
if (\strlen($this->docBlock) > 0) {
$parser = new DocblockParser('/'.$this->docBlock.'/');
| php | {
"resource": ""
} |
q22213 | ClassDefinition.addProperty | train | public function addProperty(ClassProperty $property)
{
if (isset($this->properties[$property->getName()])) {
throw new CompilerException("Property '".$property->getName()."' was defined more than one time", | php | {
"resource": ""
} |
q22214 | ClassDefinition.addConstant | train | public function addConstant(ClassConstant $constant)
{
if (isset($this->constants[$constant->getName()])) {
| php | {
"resource": ""
} |
q22215 | ClassDefinition.hasProperty | train | public function hasProperty($name)
{
if (isset($this->properties[$name])) {
return true;
} else {
$extendsClassDefinition = $this->getExtendsClassDefinition();
| php | {
"resource": ""
} |
q22216 | ClassDefinition.getProperty | train | public function getProperty($propertyName)
{
if (isset($this->properties[$propertyName])) {
return $this->properties[$propertyName];
}
$extendsClassDefinition = $this->getExtendsClassDefinition();
if ($extendsClassDefinition) {
| php | {
"resource": ""
} |
q22217 | ClassDefinition.hasConstant | train | public function hasConstant($name)
{
if (isset($this->constants[$name])) {
return true;
}
$extendsClassDefinition = $this->getExtendsClassDefinition();
if ($extendsClassDefinition) {
if ($extendsClassDefinition->hasConstant($name)) {
| php | {
"resource": ""
} |
q22218 | ClassDefinition.getConstant | train | public function getConstant($constantName)
{
if (!\is_string($constantName)) {
throw new InvalidArgumentException('$constantName must be string type');
}
if (empty($constantName)) {
throw new InvalidArgumentException('$constantName must not be empty: '.$constantName)... | php | {
"resource": ""
} |
q22219 | ClassDefinition.addMethod | train | public function addMethod(ClassMethod $method, $statement = null)
{
$methodName = strtolower($method->getName());
if (isset($this->methods[$methodName])) { | php | {
"resource": ""
} |
q22220 | ClassDefinition.hasMethod | train | public function hasMethod($methodName)
{
$methodNameLower = strtolower($methodName);
foreach ($this->methods as $name => $method) {
if ($methodNameLower == $name) {
return true;
}
}
$extendsClassDefinition = $this->getExtendsClassDefinition();... | php | {
"resource": ""
} |
q22221 | ClassDefinition.getMethod | train | public function getMethod($methodName, $checkExtends = true)
{
$methodNameLower = strtolower($methodName);
foreach ($this->methods as $name => $method) {
if ($methodNameLower == $name) {
return $method;
}
| php | {
"resource": ""
} |
q22222 | ClassDefinition.getPossibleMethodName | train | public function getPossibleMethodName($methodName)
{
$methodNameLower = strtolower($methodName);
foreach ($this->methods as $name => $method) {
if (metaphone($methodNameLower) == metaphone($name)) {
return $method->getName();
}
| php | {
"resource": ""
} |
q22223 | ClassDefinition.getClassEntry | train | public function getClassEntry(CompilationContext $compilationContext = null)
{
if ($this->external) {
if (!\is_object($compilationContext)) {
throw new Exception('A compilation context is required');
}
$this->compiler = $compilationContext->compiler;
... | php | {
"resource": ""
} |
q22224 | ClassDefinition.getExternalHeader | train | public function getExternalHeader()
{
$parts = explode('\\', $this->namespace);
return | php | {
"resource": ""
} |
q22225 | ClassDefinition.checkInterfaceImplements | train | public function checkInterfaceImplements(self $classDefinition, self $interfaceDefinition)
{
foreach ($interfaceDefinition->getMethods() as $method) {
if (!$classDefinition->hasMethod($method->getName())) {
throw new CompilerException(
sprintf(
... | php | {
"resource": ""
} |
q22226 | ClassDefinition.getLocalOrParentInitMethod | train | public function getLocalOrParentInitMethod()
{
$method = $this->getInitMethod();
if ($method) {
$parentClassDefinition = $this->getExtendsClassDefinition();
if ($parentClassDefinition instanceof self) {
$method = $parentClassDefinition->getInitMethod();
... | php | {
"resource": ""
} |
q22227 | ClassDefinition.addInitMethod | train | public function addInitMethod(StatementsBlock $statementsBlock)
{
if (!$statementsBlock->isEmpty()) {
$initClassName = $this->getCNamespace().'_'.$this->getName();
$classMethod = new ClassMethod(
| php | {
"resource": ""
} |
q22228 | ClassDefinition.addStaticInitMethod | train | public function addStaticInitMethod(StatementsBlock $statementsBlock)
{
$initClassName = $this->getCNamespace().'_'.$this->getName();
$classMethod = new ClassMethod(
$this,
['internal'],
'zephir_init_static_properties_'.$initClassName,
| php | {
"resource": ""
} |
q22229 | ClassDefinition.buildFromReflection | train | public static function buildFromReflection(\ReflectionClass $class)
{
$classDefinition = new self($class->getNamespaceName(), $class->getName(), $class->getShortName());
$methods = $class->getMethods();
if (\count($methods) > 0) {
foreach ($methods as $method) {
... | php | {
"resource": ""
} |
q22230 | Theme.drawFile | train | public function drawFile(AbstractFile $file)
{
$outputFile = ltrim($file->getOutputFile(), '/');
$output = pathinfo($this->outputDir.'/'.$outputFile);
$outputDirname = $output['dirname'];
$outputBasename = $output['basename'];
$outputFilename = $outputDirname.'/'.$outputBase... | php | {
"resource": ""
} |
q22231 | Theme.getThemeInfoExtendAware | train | public function getThemeInfoExtendAware($name)
{
if ($this->extendedTheme) {
$data = $this->extendedTheme->getThemeInfoExtendAware($name);
} else {
$data = [];
}
| php | {
"resource": ""
} |
q22232 | Theme.buildStaticDirectory | train | public function buildStaticDirectory()
{
$outputStt = $this->getOutputPath('asset');
if (!file_exists($outputStt)) {
mkdir($outputStt, 0777, true);
}
if ($this->extendedTheme) {
$this->extendedTheme->buildStaticDirectory();
}
$themeStt = $th... | php | {
"resource": ""
} |
q22233 | Theme.getThemePathExtendsAware | train | public function getThemePathExtendsAware($path)
{
$newPath = $this->getThemePath($path);
if (!$newPath) {
| php | {
"resource": ""
} |
q22234 | Theme.getThemePath | train | public function getThemePath($path)
{
$path = pathinfo($this->themeDir.'/'.$path);
$pathDirname = $path['dirname'];
$pathBasename = $path['basename'];
$pathFilename = $pathDirname.'/'.$pathBasename;
| php | {
"resource": ""
} |
q22235 | ThrowStatement.throwStringException | train | private function throwStringException(CodePrinter $printer, $class, $message, $expression)
{
$message = add_slashes($message);
$path = Compiler::getShortUserPath($expression['file']);
$printer->output(
sprintf(
| php | {
"resource": ""
} |
q22236 | ArrayType.join | train | public function join($caller, CompilationContext $compilationContext, Call $call, array $expression)
{
$functionCall = BuilderFactory::getInstance()->statements()
->functionCall('join', $expression['parameters'])
->addArgument($caller)
->setFile($expression['file'])
... | php | {
"resource": ""
} |
q22237 | ClassMethod.setupOptimized | train | public function setupOptimized(CompilationContext $compilationContext)
{
if (!$compilationContext->config->get('internal-call-transformation', 'optimizations')) {
return $this;
}
$classDefinition = $this->getClassDefinition();
/* Skip for closures */
if ('__invoke... | php | {
"resource": ""
} |
q22238 | ClassMethod.hasReturnTypes | train | public function hasReturnTypes()
{
if (\count($this->returnTypes)) {
return true;
}
| php | {
"resource": ""
} |
q22239 | ClassMethod.areReturnTypesNullCompatible | train | public function areReturnTypesNullCompatible($type = null)
{
if (\count($this->returnTypes)) {
foreach ($this->returnTypes as $returnType => $definition) {
switch ($returnType) {
| php | {
"resource": ""
} |
q22240 | ClassMethod.hasModifier | train | public function hasModifier($modifier)
{
foreach ($this->visibility as $visibility) {
| php | {
"resource": ""
} |
q22241 | ClassMethod.getModifiers | train | public function getModifiers()
{
$modifiers = [];
foreach ($this->visibility as $visibility) {
switch ($visibility) {
case 'public':
$modifiers['ZEND_ACC_PUBLIC'] = $visibility;
break;
case 'protected':
... | php | {
"resource": ""
} |
q22242 | ClassMethod.removeMemoryStackReferences | train | public function removeMemoryStackReferences(SymbolTable $symbolTable, $containerCode)
{
if (!$symbolTable->getMustGrownStack()) {
$containerCode = str_replace('ZEPHIR_THROW_EXCEPTION_STR', 'ZEPHIR_THROW_EXCEPTION_STRW', $containerCode);
$containerCode = str_replace('ZEPHIR_THROW_EXCE... | php | {
"resource": ""
} |
q22243 | ClassMethod.hasChildReturnStatementType | train | public function hasChildReturnStatementType($statement)
{
if (!isset($statement['statements']) || !\is_array($statement['statements'])) {
return false;
}
if ('if' == $statement['type']) {
$ret = false;
$statements = $statement['statements'];
... | php | {
"resource": ""
} |
q22244 | ClassMethod.getArgInfoName | train | public function getArgInfoName(ClassDefinition $classDefinition = null)
{
if (null != $classDefinition) {
return sprintf(
'arginfo_%s_%s_%s',
strtolower($classDefinition->getCNamespace()),
strtolower($classDefinition->getName()),
| php | {
"resource": ""
} |
q22245 | ClassMethod.isReturnTypesHintDetermined | train | public function isReturnTypesHintDetermined()
{
if (0 == \count($this->returnTypes) || $this->isVoid()) {
return false;
}
foreach ($this->returnTypes as $returnType => $definition) {
switch ($returnType) {
case 'variable':
case 'callab... | php | {
"resource": ""
} |
q22246 | ClassMethod.areReturnTypesCompatible | train | public function areReturnTypesCompatible()
{
// null | T1 | T2
if (\count($this->returnTypes) > 2) {
return false;
}
// T1 | T2
if (2 | php | {
"resource": ""
} |
q22247 | Plus.isSatisfiedBy | train | public function isSatisfiedBy(ReturnType\TypeInterface $type)
{
| php | {
"resource": ""
} |
q22248 | StaticCall.callParent | train | protected function callParent($methodName, array $expression, $symbolVariable, $mustInit, $isExpecting, ClassDefinition $classDefinition, CompilationContext $compilationContext, ClassMethod $method)
{
$codePrinter = $compilationContext->codePrinter;
$classCe = $classDefinition->getClassEntry($compil... | php | {
"resource": ""
} |
q22249 | CompiledExpression.getBooleanCode | train | public function getBooleanCode()
{
if ($this->code && ('true' == $this->code || true === $this->code)) {
return '1';
} else {
if ('false' == $this->code || false === | php | {
"resource": ""
} |
q22250 | CompiledExpression.resolve | train | public function resolve($result, CompilationContext $compilationContext)
{
if ($this->code instanceof \Closure) {
$code = $this->code;
if (!$result) {
$tempVariable = $compilationContext->symbolTable->getTempVariableForWrite(
'variable',
... | php | {
"resource": ""
} |
q22251 | InitCommand.recursiveProcess | train | private function recursiveProcess($src, $dst, $pattern = null, $callback = 'copy')
{
$success = true;
$iterator = new \DirectoryIterator($src);
foreach ($iterator as $item) {
$pathName = $item->getPathname();
if (!is_readable($pathName)) {
$this->logg... | php | {
"resource": ""
} |
q22252 | CallGathererPass.getNumberOfMethodCalls | train | public function getNumberOfMethodCalls($className, $methodName)
{
if (isset($this->methodCalls[$className][$methodName])) {
| php | {
"resource": ""
} |
q22253 | BaseBackend.getTemplateFileContents | train | public function getTemplateFileContents($filename)
{
$templatePath = rtrim($this->config->get('templatepath', 'backend'), '\\/');
if (empty($templatepath)) {
$templatePath = $this->templatesPath;
}
| php | {
"resource": ""
} |
q22254 | SkipVariantInit.pass | train | public function pass($branchNumber, StatementsBlock $block)
{
$this->passStatementBlock($branchNumber, | php | {
"resource": ""
} |
q22255 | SkipVariantInit.passLetStatement | train | public function passLetStatement($branchNumber, $statement)
{
foreach ($statement['assignments'] as $assignment) {
if ('variable' == $assignment['assign-type']) {
if ('assign' == $assignment['operator']) {
switch ($assignment['expr']['type']) {
... | php | {
"resource": ""
} |
q22256 | SkipVariantInit.getVariables | train | public function getVariables()
{
$variableStats = [];
foreach ($this->variablesToSkip as $branchNumber => $variables) {
foreach ($variables as $variable => $one) {
if (!isset($variableStats[$variable])) {
$variableStats[$variable] = 1;
... | php | {
"resource": ""
} |
q22257 | Variable.setIdle | train | public function setIdle($idle)
{
$this->idle = false;
if ($this->reusable) {
$this->classTypes = [];
| php | {
"resource": ""
} |
q22258 | Variable.setClassTypes | train | public function setClassTypes($classTypes)
{
if ($classTypes) {
if (\is_string($classTypes)) {
if (!\in_array($classTypes, $this->classTypes)) {
$this->classTypes[] = $classTypes;
}
} else {
foreach ($classTypes as $... | php | {
"resource": ""
} |
q22259 | Variable.setDynamicTypes | train | public function setDynamicTypes($types)
{
if ($types) {
unset($this->dynamicTypes['unknown']);
if (\is_string($types)) {
if (!isset($this->dynamicTypes[$types])) {
$this->dynamicTypes[$types] = true;
}
} else {
... | php | {
"resource": ""
} |
q22260 | Variable.hasAnyDynamicType | train | public function hasAnyDynamicType($types)
{
if (\is_string($types)) {
return isset($this->dynamicTypes[$types]);
} else {
foreach ($types as $type) {
| php | {
"resource": ""
} |
q22261 | Variable.hasDifferentDynamicType | train | public function hasDifferentDynamicType($types)
{
$number = 0;
foreach ($types as $type) {
if (isset($this->dynamicTypes[$type])) {
| php | {
"resource": ""
} |
q22262 | Variable.setIsInitialized | train | public function setIsInitialized($initialized, CompilationContext $compilationContext)
{
$this->initialized = $initialized;
if (!$initialized || !$compilationContext->branchManager instanceof BranchManager) {
return;
}
$currentBranch = | php | {
"resource": ""
} |
q22263 | Variable.enableDefaultAutoInitValue | train | public function enableDefaultAutoInitValue()
{
switch ($this->type) {
case 'char':
case 'boolean':
case 'bool':
case 'int':
case 'uint':
case 'long':
case 'ulong':
case 'double':
case 'zephir_ce_guard... | php | {
"resource": ""
} |
q22264 | Variable.separate | train | public function separate(CompilationContext $compilationContext)
{
if ('this_ptr' != $this->getName() && 'return_value' != | php | {
"resource": ""
} |
q22265 | Variable.initVariant | train | public function initVariant(CompilationContext $compilationContext)
{
if ($this->numberSkips) {
--$this->numberSkips;
return;
}
/*
* Variables are allocated for the first time using ZEPHIR_INIT_VAR
* the second, third, etc times are allocated using... | php | {
"resource": ""
} |
q22266 | Variable.trackVariant | train | public function trackVariant(CompilationContext $compilationContext)
{
if ($this->numberSkips) {
--$this->numberSkips;
return;
}
/*
* Variables are allocated for the first time using ZEPHIR_INIT_VAR
* the second, third, etc times are allocated usin... | php | {
"resource": ""
} |
q22267 | Variable.observeVariant | train | public function observeVariant(CompilationContext $compilationContext)
{
if ($this->numberSkips) {
--$this->numberSkips;
return;
}
$name = $this->getName();
if ('this_ptr' != $name && 'return_value' != $name) {
if (false === $this->initBranch) {
... | php | {
"resource": ""
} |
q22268 | Variable.observeOrNullifyVariant | train | public function observeOrNullifyVariant(CompilationContext $compilationContext)
{
if ($this->numberSkips) {
--$this->numberSkips;
return;
}
$name = $this->getName();
if ('this_ptr' != $name && 'return_value' != $name) {
if (false === $this->initB... | php | {
"resource": ""
} |
q22269 | Variable.setPossibleValue | train | public function setPossibleValue(CompiledExpression $possibleValue, CompilationContext $compilationContext)
{
$this->possibleValue = $possibleValue;
| php | {
"resource": ""
} |
q22270 | BranchManager.addBranch | train | public function addBranch(Branch $branch)
{
if ($this->currentBranch) {
$branch->setParentBranch($this->currentBranch);
$this->currentBranch = $branch;
} else {
$this->currentBranch = $branch;
}
$branch->setUniqueId($this->uniqueId);
| php | {
"resource": ""
} |
q22271 | BranchManager.removeBranch | train | public function removeBranch(Branch $branch)
{
$parentBranch = $branch->getParentBranch();
| php | {
"resource": ""
} |
q22272 | BackendFactory.resolveBackendClass | train | private function resolveBackendClass()
{
$parser = new ArgvInput();
$backend = $parser->getParameterOption('--backend', null);
if (null === $backend) {
// Do not use this feature for typical use case.
// Overriding backend using env var provided only for
... | php | {
"resource": ""
} |
q22273 | CompilerFileFactory.create | train | public function create($className, $filePath)
{
$compiler = new CompilerFile($this->config, new AliasManager(), $this->filesystem);
$compiler->setClassName($className);
| php | {
"resource": ""
} |
q22274 | Documentation.findThemePathByName | train | public function findThemePathByName($name)
{
// check the theme from the config
$path = null;
foreach ($this->themesDirectories as $themeDir) {
$path = rtrim($themeDir, '\\/').\DIRECTORY_SEPARATOR.$name;
if (0 !== strpos($path, 'phar://')) {
| php | {
"resource": ""
} |
q22275 | Documentation.prepareThemeOptions | train | private function prepareThemeOptions($themeConfig, $options = null)
{
$parsedOptions = null;
if (!empty($options)) {
if ('{' == $options[0]) {
$parsedOptions = json_decode(trim($options), true);
if (!$parsedOptions || !\is_array($parsedOptions)) {
... | php | {
"resource": ""
} |
q22276 | Documentation.findOutputDirectory | train | private function findOutputDirectory($outputDir)
{
$outputDir = str_replace('%version%', $this->config->get('version'), $outputDir);
if ('/' !== $outputDir[0]) {
| php | {
"resource": ""
} |
q22277 | Documentation.findThemeDirectory | train | private function findThemeDirectory($themeConfig, $path = null)
{
// check if there are additional theme paths in the config
$themeDirectoriesConfig = $this->config->get('theme-directories', 'api');
if ($themeDirectoriesConfig) {
if (\is_array($themeDirectoriesConfig)) {
... | php | {
"resource": ""
} |
q22278 | EvalExpression.optimizeNot | train | public function optimizeNot($expr, CompilationContext $compilationContext)
{
/*
* Compile the expression negating the evaluated expression
*/
if ('not' == $expr['type']) {
$conditions = $this->optimize($expr['left'], $compilationContext);
if (false !== $cond... | php | {
"resource": ""
} |
q22279 | CompilerFile.genIR | train | public function genIR(Compiler $compiler)
{
$normalizedPath = $this->filesystem->normalizePath($this->filePath);
// TODO: JS => JSON
$compilePath = "{$normalizedPath}.js";
$zepRealPath = realpath($this->filePath);
if ($this->filesystem->exists($compilePath)) {
$... | php | {
"resource": ""
} |
q22280 | CompilerFile.preCompileInterface | train | public function preCompileInterface($namespace, $topStatement, $docblock)
{
$classDefinition = new ClassDefinition($namespace, $topStatement['name']);
$classDefinition->setIsExternal($this->external);
if (isset($topStatement['extends'])) {
foreach ($topStatement['extends'] as &$... | php | {
"resource": ""
} |
q22281 | CompilerFile.checkDependencies | train | public function checkDependencies(Compiler $compiler)
{
$classDefinition = $this->classDefinition;
$extendedClass = $classDefinition->getExtendsClass();
if ($extendedClass) {
if ('class' == $classDefinition->getType()) {
if ($compiler->isClass($extendedClass)) {
... | php | {
"resource": ""
} |
q22282 | CompilerFile.createReturnsType | train | protected function createReturnsType(array $types, $annotated = false)
{
if (!$types) {
return null;
}
$list = [];
foreach ($types as $type) {
$list[] = [
'type' => $annotated ? 'return-type-annotation' : 'return-type-paramater',
... | php | {
"resource": ""
} |
q22283 | Call.processExpectedReturn | train | public function processExpectedReturn(CompilationContext $compilationContext)
{
$expr = $this->expression;
$expression = $expr->getExpression();
/**
* Create temporary variable if needed.
*/
$mustInit = false;
$symbolVariable = null;
$isExpecting = ... | php | {
"resource": ""
} |
q22284 | Call.processExpectedComplexLiteralReturn | train | public function processExpectedComplexLiteralReturn(CompilationContext $compilationContext)
{
$expr = $this->expression;
$expression = $expr->getExpression();
/**
* Create temporary variable if needed.
*/
$mustInit = false;
$isExpecting = $expr->isExpecting... | php | {
"resource": ""
} |
q22285 | Call.getSymbolVariable | train | public function getSymbolVariable($useTemp = false, CompilationContext $compilationContext = null)
{
$symbolVariable = $this->symbolVariable;
if ($useTemp && !\is_object($symbolVariable)) {
| php | {
"resource": ""
} |
q22286 | Call.getResolvedParamsAsExpr | train | public function getResolvedParamsAsExpr($parameters, CompilationContext $compilationContext, $expression, $readOnly = false)
{
if (!$this->resolvedParams) {
$hasParametersByName = false;
foreach ($parameters as $parameter) {
if (isset($parameter['name'])) {
... | php | {
"resource": ""
} |
q22287 | Call.addCallStatusFlag | train | public function addCallStatusFlag(CompilationContext $compilationContext)
{
if (!$compilationContext->symbolTable->hasVariable('ZEPHIR_LAST_CALL_STATUS')) {
$callStatus = new Variable('int', 'ZEPHIR_LAST_CALL_STATUS', $compilationContext->branchManager->getCurrentBranch());
$callStat... | php | {
"resource": ""
} |
q22288 | Call.addCallStatusOrJump | train | public function addCallStatusOrJump(CompilationContext $compilationContext)
{
$compilationContext->headersManager->add('kernel/fcall');
if ($compilationContext->insideTryCatch) {
$compilationContext->codePrinter->output(
| php | {
"resource": ""
} |
q22289 | Call.checkTempParameters | train | public function checkTempParameters(CompilationContext $compilationContext)
{
$compilationContext->headersManager->add('kernel/fcall');
foreach ($this->getMustCheckForCopyVariables() as $checkVariable) {
| php | {
"resource": ""
} |
q22290 | DocblockParser.__tryRegisterAnnotation | train | private function __tryRegisterAnnotation()
{
if (($this->annotationNameOpen || $this->annotationOpen) && \strlen($this->currentAnnotationStr) > 0) {
$annotation = | php | {
"resource": ""
} |
q22291 | DocblockParser.nextCharacter | train | private function nextCharacter()
{
++$this->currentCharIndex;
if ($this->annotationLen <= $this->currentCharIndex) {
$this->currentChar = null;
} else {
| php | {
"resource": ""
} |
q22292 | PregMatchOptimizer.processOptionals | train | private function processOptionals(array &$expression, Call $call, CompilationContext $context)
{
$flags = null;
$offset = null;
$offsetParamOffset = 4;
if (isset($expression['parameters'][4]) && 'int' === $expression['parameters'][4]['parameter']['type']) {
$offset = $ex... | php | {
"resource": ""
} |
q22293 | PregMatchOptimizer.createMatches | train | private function createMatches(array $expression, CompilationContext $context)
{
if (isset($expression['parameters'][2])) {
$type = $expression['parameters'][2]['parameter']['type'];
if ('variable' !== $type) {
throw new CompilerException('Only variables can be passe... | php | {
"resource": ""
} |
q22294 | CompilerFormatter.getFileContents | train | private function getFileContents($file)
{
if (!isset($this->filesContent[$file])) {
| php | {
"resource": ""
} |
q22295 | MethodCall.getRealCalledMethod | train | private function getRealCalledMethod(CompilationContext $compilationContext, Variable $caller, $methodName)
{
$compiler = $compilationContext->compiler;
$numberPoly = 0;
$method = null;
if ('this' == $caller->getRealName()) {
$classDefinition = $compilationContext->clas... | php | {
"resource": ""
} |
q22296 | Pessoa.getNomeDocumento | train | public function getNomeDocumento()
{
if (!$this->getDocumento()) {
return $this->getNome();
} else {
| php | {
"resource": ""
} |
q22297 | Util.nFloat | train | public static function nFloat($number, $decimals = 2, $showThousands = false)
{
if (is_null($number) || empty(self::onlyNumbers($number)) || floatval($number) == 0) {
return 0;
}
$pontuacao = preg_replace('/[0-9]/', '', $number);
$locale = (mb_substr($pontuacao, -1, 1) ==... | php | {
"resource": ""
} |
q22298 | Util.percentOf | train | public static function percentOf($big, $small, $defaultOnZero = 0)
{
$result = $big | php | {
"resource": ""
} |
q22299 | AbstractRetorno.incrementDetalhe | train | protected function incrementDetalhe()
{
$this->increment++;
$detalhe = new Detalhe();
| php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.