@param Pointcut[] $pointcuts

@return Pointcut[]
166120
public function getAnnotationPointcuts(array &$pointcuts) : array
    {
        $keyPointcuts = [];
        foreach ($pointcuts as $key => $pointcut) {
            if ($pointcut->methodMatcher instanceof AnnotatedMatcher) {
                $key = $pointcut->methodMatcher->annotation;
            }
            $keyPointcuts[$key] = $pointcut;
        }

        return $keyPointcuts;
    }
351985
public function shortcutToName($shortcut)
    {
        if (!isset($this->shortcuts[$shortcut])) {
            throw new InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut));
        }

        return $this->shortcuts[$shortcut];
    }
1267689
function pointsToCoordArray(points) {
                var coodinatesArray = new Array(points.length * points[0].length);
                var k = 0;
                for (var i = 0; i < points.length; ++i) {
                    for (var j = 0; j < points[0].length; ++j) {
                        coodinatesArray[k] = points[i][j];
                        ++k;
                    }
                }

                return coodinatesArray;
            }
1306336
public function getManipulators()
    {
        return [
            new Orientation(),
            new Crop(),
            new Size($this->getMaxImageSize()),
            new Brightness(),
            new Contrast(),
            new Gamma(),
            new Sharpen(),
            new Filter(),
            new Flip(),
            new Blur(),
            new Pixelate(),
            new Watermark($this->getWatermarks(), $this->getWatermarksPathPrefix()),
            new Background(),
            new Border(),
            new Encode(),
        ];
    }
1217097
public static function optimize($operations)
    {
        $newOperations = [];
        /** @var $outOperation Operation */
        foreach ($operations as $outIndex => $outOperation) {
            $inOperations = array_slice($operations, $outIndex + 1);

            if ($inOperations) {
                foreach ($inOperations as $inIndex => $inOperation) {
                    // get how many items to fetch
                    $length = $inIndex;

                    $inBetween = array_slice($operations, $outIndex + 1, $length);

                    $result = $outOperation->reduce($inOperation, $inBetween);

                    if ($result) {
                        // add the result of the two merging
                        $newOperations = array_merge($newOperations, $result);
                        // add points that fell in between those that merged
                        $newOperations = array_merge($newOperations, $inBetween);
                        // add points that come after
                        $newOperations = array_merge(
                            $newOperations,
                            array_slice($operations, $outIndex + $inIndex + 2)
                        );

                        return $newOperations;
                    }
                }
                $newOperations[] = $outOperation;
            } else {
                $newOperations[] = $outOperation;
            }
        }

        return $newOperations;
    }
393133
public function setPoints( $points )
    {
        if ( is_array($points) || $points instanceof \Traversable ) {
            array_walk(
                $points,
                function (&$point, $index) {
                    if ( !$point instanceof PointInterface ) {
                        if (is_array($point) && count($point) == 2) {
                            list($x, $y) = array_values($point);
                            $point = new Point($x, $y);
                        } else {
                            $msg = "Point at index #$index does not implement "
                                 . "PointReduction\\Common\\PointInterface";
                            throw new InvalidArgumentException($msg);
                        }
                    }
                }
            );
            $this->points = $points;
        } else {
            $msg = "All points must be a traversable object, or array. "
                 . gettype($points)
                 . " given.";
            throw new InvalidArgumentException($msg);
        }
    }
752353
protected function charsToCodepointsWithSurrogates(array $chars)
	{
		$codepoints = [];
		foreach ($chars as $char)
		{
			$cp = $this->cp($char);
			if ($cp < 0x10000)
			{
				$codepoints[] = $cp;
			}
			else
			{
				$codepoints[] = 0xD7C0 + ($cp >> 10);
				$codepoints[] = 0xDC00 + ($cp & 0x3FF);
			}
		}

		return $codepoints;
	}
1031560
private function combineSumPoints($points1, $points2) {
        $pointsCount = count($points1);
        $currPoint = 0;
        foreach ($points2 as $point2) {
            $pointFound = false;
            //leverage the fact that points are sorted and improve O(n^2)
            while ($currPoint < $pointsCount) {
                $point1 = $points1[$currPoint];
                if ($point1['time'] == $point2['time']) {
                    $points1[$currPoint]['sum'] += $point2['sum'];
                    $currPoint++;
                    $pointFound = true;
                    break;
                }
                $currPoint++;
            }
            //point not found in downsampled array, then just append
            if (!$pointFound) {
                $points1[] = $point2;
            }
        }

        return $points1;
    }
650776
protected function addPolygonNoTransform($points)
    {
        $pointCount = count($points);
        $this->ctx->moveTo($points[0]->x, $points[0]->y);
        for ($i = 1; $i < $pointCount; $i++) {
            $this->ctx->lineTo($points[$i]->x, $points[$i]->y);
        }
        $this->ctx->closePath();
    }
51771
public function aliases(array $aliases = null)
	{
		if (is_null($aliases))
		{
			return $this->aliases;
		}
		else
		{
			$this->aliases = array_merge($this->aliases, $aliases);
		}
	}
598776
protected function completeForOptionShortcuts()
    {
        $word = $this->context->getCurrentWord();

        if (strpos($word, '-') === 0 && strlen($word) == 2) {
            $definition = $this->command ? $this->command->getNativeDefinition() : $this->application->getDefinition();

            if ($definition->hasShortcut(substr($word, 1))) {
                return array($word);
            }
        }

        return false;
    }
708685
@Override
	public Point3d[] getVertices() {
		Point3d[] polygon = new Point3d[2*n];
		Matrix3d m = new Matrix3d();

		Point3d center = new Point3d(0, 0, height/2);

		for (int i = 0; i < n; i++) {
			polygon[i] = new Point3d(0, circumscribedRadius, 0);
			m.rotZ(i*2*Math.PI/n);
			m.transform(polygon[i]);
			polygon[n+i] = new  Point3d(polygon[i]);
			polygon[i].sub(center);
			polygon[n+i].add(center);
		}

		return polygon;
	}
1159888
public function bind(string $class, array $pointcuts)
    {
        if (!$this->cacheable) {
            return (new Bind)->bind($class, $pointcuts);
        }
        $className = str_replace("\\", "_", $class);
        $filePath = $this->path . "/{$className}" . $this->extension;
        if (!$this->filesystem->exists($filePath)) {
            $this->makeCacheDir($this->path);
            $bind = (new Bind)->bind($class, $pointcuts);
            $this->filesystem->put($filePath, serialize($bind));
        }

        return unserialize(file_get_contents($filePath));
    }
894476
private function getShortcuts()
	{
		if (!isset($this->shortcuts))
		{
			foreach ($this->getThisClasses() as $className)
			{
				$annotations = Utils::getClassAnnotations($className);
				$readOnlyProperties = isset($annotations['property-read']) ? $annotations['property-read'] : array();
				foreach ($readOnlyProperties as $property)
				{
					// Splitting @property-read $propertyType $propertyName $propertyDescription
					list($propertyType, $propertyName, $propertyDescription) = preg_split('~\s+~', $property, 3) + array(NULL, NULL, NULL);
					if (substr($propertyName, 0, 1) === '$')
					{
						list($propertyDescription) = preg_split('~\s+#~', $propertyDescription, 2); // Throw away the comment
						$definition = Utils::strToArray($propertyDescription);
						if ($definition)
						{
							// array('id' => 'foo', 'x', 'y') ==> array('id', 'foo', 'x', 'y')
							$strategy = key($definition);
							$strategyValue = array_shift($definition);
							array_unshift($definition, (substr($propertyType, -2) === '[]')); // array of elements
							array_unshift($definition, $strategyValue); // strategy value
							array_unshift($definition, $strategy); // strategy
							$this->shortcuts[substr($propertyName, 1)] = $definition;
						}
					}
				}
			}
		}
		return $this->shortcuts;
	}
124560
public function getRootLocationsBySiteAccesses(array $siteAccesses)
    {
        $rootLocations = [];

        foreach ($siteAccesses as $siteAccess) {
            $rootLocationId = $this->getRootLocationBySiteAccessName($siteAccess);

            $rootLocations[$rootLocationId] = $rootLocationId;
        }

        return array_keys($rootLocations);
    }
109318
public static function getPoints(array $points, $tag = null)
    {
        $set = [];

        foreach ($points as $point) {
            $collector = $point->getData();

            if ($tag && $collector['tag'] != $tag) {
                continue;
            }

            $set[$point->getName()] = $point;
        }

        return $set;
    }
826454
protected function buildPointcutFilters()
    {
        $this->filters = [];
        /** @var PolicyService $policyService */
        $policyService = $this->objectManager->get(PolicyService::class);
        /** @var MethodPrivilegeInterface[] $methodPrivileges */
        $methodPrivileges = $policyService->getAllPrivilegesByType(MethodPrivilegeInterface::class);
        foreach ($methodPrivileges as $privilege) {
            $this->filters[$privilege->getCacheEntryIdentifier()] = $privilege->getPointcutFilterComposite();
        }
    }